blackberry / Boost

The Boost C++ Libraries
Boost Software License 1.0
224 stars 120 forks source link

Boost fails to build on OSX #10

Open ghost opened 10 years ago

ghost commented 10 years ago

When running bootstrap.sh I get the following error in bootstrap.log:

###
### Using 'darwin' toolset.
###
rm -rf bootstrap
mkdir bootstrap
cc -o bootstrap/jam0 command.c compile.c constants.c debug.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c
./bootstrap/jam0 -f build.jam --toolset=darwin --toolset-root= clean
./build.sh: line 15: ./bootstrap/jam0: cannot execute binary file

It looks like the cc command fails to build boostrap/jam0 because none of the .c files are present.

ghost commented 10 years ago

I think I found the problem.

On OSX, when you source the environment variables script from the NDK it changes the user's PATH. This means that in the bootstrap.sh compilation step instead of using the host cc command it uses cc found in the NDK (the one for BlackBerry devices). This version of cc is unable to compile the necessary source files to create ./bootstrap/jam0

The solution is to not run bbndk.sh first but to run ./bootstrap.sh in a fresh shell. This creates an executable jam0 file. After that: