ios编译boost

下载解压到boost_1.55.0目录

cd boost_1.55.0

vi tools/build/v2/user_config.jam

在尾部添加:

using darwin : 6.1~iphone
   : /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -arch armv7 -fvisibility=hidden -fvisibility-inlines-hidden
   : <striper>
   : <architecture>arm <target-os>iphone
   ;


using darwin : 6.1~iphonesim
   : /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -fvisibility=hidden -fvisibility-inlines-hidden
   : <striper>
   : <architecture>x86 <target-os>iphone
   ;


然后执行

./booststrap.sh

export SDK_VERSION="6.1"

./bjam --prefix=/users/youname/boost --build-type=complete --layout=versioned toolset=darwin architecture=arm target-os=iphone macosx-version=iphone-${SDK_VERSION} define=_LITTLE_ENDIAN threading=multi install


编译simulator版本(1.53.0):

./bjam --prefix=/users/youname/boost --build-type=complete --layout=versioned toolset=darwin architecture=i386 target-os=iphone macosx-version=iphone-${SDK_VERSION} threading=multi install


编译osx版本:

./bjam --prefix=/users/youname/boost--build-type=complete --layout=versioned toolset=darwin cxxflags="-arch x86_64" linkflags="-arch x86_64" threading=multi install


cxxflags="-arch i386 -arch x86_64"可以得到32位64位通用库

可以使用lipo -info xxx.a来查看编译的到的库的类型


你可能感兴趣的:(ios编译boost)