Skip to content

Can't build on macOS #50

@beaumartinez

Description

@beaumartinez

Hello, I'm having issues trying to build on macOS.

I use the latest version of bash (not the outdated version macOS comes with, so it should support bash plugins)

$ bash --version
GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin18.6.0)

Running ./configure gives me

configure: WARNING: elfutils is not available, struct support will not be available
[...]
checking whether bash symbols are exported... no
configure: error: in `~/code/ctypes.sh':
configure: error: unable to build a test extension
See `config.log' for more details

In config.log I see

configure:13864: checking whether bash symbols are exported
configure:13891: gcc -o conftest -g -O2  -I./include  -shared -fPIC conftest.c -lelf  >&5
Undefined symbols for architecture x86_64:
  "_num_shell_builtins", referenced from:
      _conftest_function in conftest-efa94e.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:13891: $? = 1
configure: failed program was:
| /* confdefs.h */
[...]
|     #include "builtins.h"
| 
|     int conftest_function(WORD_LIST *list)
|     {
|         exit(num_shell_builtins
|                 ? EXIT_SUCCESS
|                 : EXIT_FAILURE);
|     }
| 
|     struct builtin conftest_struct = {
|         .name       = "conftest",
|         .function   = conftest_function,
|         .flags      = BUILTIN_ENABLED,
|         .long_doc   = NULL,
|         .short_doc  = NULL,
|         .handle     = NULL,
|     };
[...]
configure:13911: result: no
configure:13913: error: in `~/code/ctypes.sh':
configure:13915: error: unable to build a test extension
See `config.log' for more details

I don't know if this has something to do with include/builtins.h since that what defines the extern of num_shell_builtins. The only other thing I can think of is not having struct support since I don't have elfutils installed (I don't think it builds for macOS), and the code it tries to compile has a struct. I might be barking up the wrong tree though; I don't know how to resolve this myself.

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions