|
Boost-Build : |
Subject: Re: [Boost-build] building program_options for iPhone
From: James Gregurich (bayoubengal_at_[hidden])
Date: 2011-02-15 22:16:42
On Feb 6, 2011, at 8:39 AM, John Maddock wrote:
>> I'm attempting to build boost 1.45 for iOS. I have it configured with link=static. I'm running into a problem with parsers.cpp in program_options due to the following line:
>>
>>
>>
>> #if defined(__APPLE__) && defined(__DYNAMIC__)
>> #include <crt_externs.h>
>> #define environ (*_NSGetEnviron())
>>
>>
>>
>> crt_externs.h does not exist in the iOS sdk. I THINK I can switch of the __DYNAMIC__ macro by passing in -static. Is there an entry I can put into user-config.jam that instructs bjam to pass in an extra flag when compiling parsers.cpp? I've been going through the documentation, but I'm not exactly sure what I'm looking for. I'd appreciate some guidance.
>
> bjam link=static runtime-link=static
>
> Would probably do that (which is to say pass -static to the compiler).
this recommendation did not work...
bjam command:
bjam -d2 --layout=tagged --debug-configuration --user-config=./user-config.jam -sBZIP2_INCLUDE=/iopt/include -sBZIP2_LIBPATH=/iopt/lib -sEXPAT_INCLUDE=/iopt/include -sEXPAT_LIBPATH=/iopt/lib -sZLIB_INCLUDE=/iopt/include -sZLIB_LIBPATH=/iopt/lib variant=release threading=single,multi link=static runtime-link=static -j8 define=_LITTLE_ENDIAN
compilation of parsers.o:
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2" "-arch" "armv6" "-isysroot" "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -no-cpp-precomp -gdwarf-2 -DBOOST_ALL_NO_LIB=1 -DNDEBUG -D_LITTLE_ENDIAN -I"." -c -o "bin.v2/libs/program_options/build/darwin-4.2.1/release/link-static/runtime-link-static/parsers.o" "libs/program_options/src/parsers.cpp"
libs/program_options/src/parsers.cpp:48:25: error: crt_externs.h: No such file or directory
>
> Otherwise:
>
> bjam cxxflags=-static
>
> Lets you inject arbitrary compiler flags.
>
> But it sounds to me like program_options might need patching for this platform? If so please file a Trac ticket at svn.boost.org and set the component to "program_options".
>
since program_options isn't particularly useful on an iOS device and a patch is coming anyway, I'm just going to set up the macports portfile to skip program_options until the next update is released.
thanks,
James
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk