Boost logo

Boost-Build :

Subject: [Boost-build] compiling boost with clang for iPhone
From: Laurențiu Păncescu (lpancescu_at_[hidden])
Date: 2011-03-14 08:33:52


Hello,

I'm trying to build Boost with Clang for iPhone. There's already
support for "native" Clang in Boost, in clang-darwin.jam, but not for
cross-compiling to iOS on arm. I tried to take a part of darwin.jam,
which supports iphone, but I'm getting some errors:

/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/build/toolset.jam:38:
in toolset.using
*** argument error
* rule clang-darwin.init ( version ? : command * : options * )
* called with: ( 2.0~iphone :
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ -arch
armv7 -mthumb -fvisibility=hidden -fvisibility-inlines-hidden
-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS : <striper> :
<architecture>arm <target-os>iphone : : : : )
* extra argument <architecture>arm
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/tools/clang-darwin.jam:57:see
definition of rule 'init' being called
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/tools/clang.jam:20:
in clang.init
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/build/toolset.jam:38:
in toolset.using
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/build/project.jam:886:
in using
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/user-config.jam:96:
in modules.load
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/build-system.jam:257:
in load-config
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/build-system.jam:399:
in load-configuration-files
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/build-system.jam:554:
in load
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/kernel/modules.jam:283:
in import
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/tools/build/v2/kernel/bootstrap.jam:142:
in boost-build
/Users/laur/Development/boostoniphone-boostoniphone/src/boost_1_46_0/boost-build.jam:17:
in module scope

     =================================================================
     Done

I attached my changes; I'm building with 'bjam -d+2 -j4
--prefix="$PREFIXDIR" toolset=clang architecture=arm target-os=iphone
macosx-version=iphone-${IPHONE_SDKVERSION} define=_LITTLE_ENDIAN
link=static install'. Here's what my user-config.jam:

using clang : 2.0~iphone
    : /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++
-arch armv7 -mthumb -fvisibility=hidden -fvisibility-inlines-hidden
$EXTRA_CPPFLAGS
    : <striper>
    : <architecture>arm <target-os>iphone
    ;
using clang : 2.0~iphonesim
    :
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++
-arch i386 -fvisibility=hidden -fvisibility-inlines-hidden $EXTRA_CPPFLAGS
    : <striper>
    : <architecture>x86 <target-os>iphone
    ;
EOF

darwin.jam is huge, I'm not sure what I need to copy to clang-darwin.jam
and what only applies to gcc. Any suggestions?

Thanks in advance,
Laurentiu




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