Changes between Version 1 and Version 2 of SystemNotesiOS


Ignore:
Timestamp:
Mar 10, 2015, 12:00:51 AM (3 years ago)
Author:
fdupont
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SystemNotesiOS

    v1 v2  
    33**0. install necessary tools.**
    44
    5 You need a recent version of Xcode (e.g., Xcode 6.1.1) on OS X (e.g., OS X 10.10.2) with the iPhoneOS SDK installed. Note as
    6 ToBeFinshed
     5You need a recent version of Xcode (e.g., Xcode 6.1.1) on OS X (e.g., OS X 10.10.2) with the iPhoneOS SDK installed. Note as you'll need a version of the message compiler for the building system (i.e., OS X here) you have to install Xcode command line tools, a package system like brew, etc, as explained in wiki:SystemNotesMacOSX109.
     6
     7**1. setup build environment.**
     8
     9Most of the dependencies and Kea itself are based on GNU autotools. The required environment variables are:
     10{{{
     11PLATFORM=iphoneos
     12ARCH=<the ARM version, e.g., armv7>
     13ROOTDIR=<the directory where you want to install things>
     14PPATH=`xcrun --show-sdk-platform-path --sdk $PLATFORM`
     15SDK=$PPATH/Developer/SDKs/iPhoneOS`xcrun --show-sdk-version --sdk $PLATFORM`.sdk
     16
     17export CC="xcrun -sdk $PLATFORM gcc -arch $ARCH"
     18export CXX="xcrun -sdk $PLATFORM g++ -arch $ARCH"
     19
     20export AR="xcrun -sdk $PLATFORM ar"
     21export DSYMUTIL="xcrun -sdk $PLATFORM dsymutil"
     22export LIPO="xcrun -sdk $PLATFORM lipo"
     23export NM="xcrun -sdk $PLATFORM nm"
     24export NMEDIT="xcrun -sdk $PLATFORM nmedit"
     25export RANLIB="xcrun -sdk $PLATFORM ranlib"
     26export STRIP="xcrun -sdk $PLATFORM strip"
     27export OTOOL="xcrun -sdk $PLATFORM otool"
     28
     29export CFLAGS="-O2 -isysroot $SDK"
     30export CXXFLAGS="-O2 -isysroot $SDK"
     31
     32export BUILD_CC=gcc
     33export BUILD_CXX=g++
     34
     35export PKG_CONFIG_PATH=$ROOTDIR/lib/pkgconfig
     36}}}
     37
     38The list of SDKs is given by {{{xcodebuild -showsdks}}}, note the iOS simulator won't really help as its goal is only the user interface.
     39Typically dependencies (lib4cplus, sqlite, etc) and Kea are built by:
     40{{{
     41./configure --prefix=$ROOTDIR --host=$ARCH-apple-darwin
     42make
     43make install
     44}}}
     45
     46When you need to provide an explicit path usually {{{$ROOTDIR}}} is the right answer.
     47
     48**2. special cases.**
     49
     50**Boos**t is a special but easy case: you have to copy the boost directory in {{{$ROOTDIR/include}}} and refers to it, e.g., by:
     51{{{
     52--with-boost-include=$ROOTDIR/include
     53}}}
     54
     55**Botan** is a nightmare. First you must get the Makefile by:
     56{{{
     57python configure.py --cpu=$ARCH --cc=gcc --os=darwin --prefix=$ROOTDIR --with-tr1-implementation=none
     58}}}
     59and edit it replacing command definitions by xcrun calls. Note the {{{MACH_OPT}}} variable is not used everywhere so the CPU architecture must be in {{{CXX}}}.
     60
     61**OpenSSL** is easier and there are some docs about it in the Web. This works:
     62{{{
     63PLATFORM=iphoneos
     64ARCH=<the ARM version, e.g., armv7>
     65ROOTDIR=<the directory where you want to install things>
     66PPATH=`xcrun --show-sdk-platform-path --sdk $PLATFORM`
     67SDK=$PPATH/Developer/SDKs/iPhoneOS`xcrun --show-sdk-version --sdk $PLATFORM`.sdk
     68
     69export CC="xcrun -sdk $PLATFORM gcc -arch $ARCH"
     70export CROSS_TOP=$PPATH/Developer
     71export CROSS_SDK=iPhoneOS`xcrun --show-sdk-version --sdk $PLATFORM`.sdk
     72}}}
     73
     74for environment variables and for the config itself:
     75{{{
     76--prefix=$ROOTDIR shared iphoneos-cross
     77}}}
     78Notes:
     79 - {{{--prefix}}} is a bit better than {{{--openssldir}}}
     80 - {{{shared}}} is not the default so you have to add it
     81 - {{{sysroot}}} stuff is handled by the cross entry
     82
     83**3. final build.**
     84
     85Kea is built using {{{./configure}}} but:
     86 - the pkgconfig path is applied before (not instead) the system path so you must check you use the cross compiled version.
     87 - a message compiler must be built for the building system and copied to {{{<kea>/src/lib/log/compiler/message}}} ({{{./configure}}} raises a warning when it can't find it).
     88 - if you want a particular version of Boost you must give its path (kea uses only the Boost headers, not any Boost library, so it should work as soon as it can find them).
     89The result is not supposed to work on an iPhone or an iPad: this is a **cross compiling test only**.