Copy
[mono/afaerber.git] / build-iphone.sh
blobccb2b97adc24fc673a0a317629df2cc9bb893a85
1 #!/bin/sh
2 ASPEN_ROOT=/Developer/Platforms/iPhoneOS.platform/Developer
3 ASPEN_SDK=$ASPEN_ROOT/SDKs/iPhoneOS2.0.sdk/
5 ORIG_PATH=$PATH
6 GLIB_FLAGS=`pkg-config --cflags --libs glib-2.0`
8 if [ -z "$GLIB_FLAGS" ]; then
9 echo "pkg-config could not locate glib-2.0 needed for the monoburg step"
10 exit;
13 setenv () {
14 export PATH=$ASPEN_ROOT/usr/bin:$PATH
16 export C_INCLUDE_PATH="$ASPEN_SDK/usr/lib/gcc/arm-apple-darwin9/4.0.1/include:$ASPEN_SDK/usr/include"
17 export CPLUS_INCLUDE_PATH="$ASPEN_SDK/usr/lib/gcc/arm-apple-darwin9/4.0.1/include:$ASPEN_SDK/usr/include"
18 export CC=arm-apple-darwin9-gcc-4.0.1
19 export CXX=arm-apple-darwin9-g++-4.0.1
20 export CPP="cpp-4.0 -nostdinc -U__powerpc__ -U__i386__ -D__arm__"
21 export CXXPP="cpp-4.0 -nostdinc -U__powerpc__ -U__i386__ -D__arm__"
22 export LD=$CC
23 export LDFLAGS="-liconv -Wl,-syslibroot,$ASPEN_SDK"
26 unsetenv () {
27 export PATH=$ORIG_PATH
29 unset C_INCLUDE_PATH
30 unset CPLUS_INCLUDE_PATH
31 unset CC
32 unset CXX
33 unset CPP
34 unset CXXPP
35 unset LD
36 unset LDFLAGS
39 export mono_cv_uscore=yes
40 export cv_mono_sizeof_sunpath=104
41 export ac_cv_func_posix_getpwuid_r=yes
42 export ac_cv_func_backtrace_symbols=no
45 setenv
47 pushd eglib
48 ./autogen.sh --host=arm-apple-darwin9
49 popd
51 ./autogen.sh --disable-mcs-build --host=arm-apple-darwin9 --disable-shared-handles --with-tls=pthread --with-sigaltstack=no --with-glib=embedded $@
52 perl -pi -e 's/MONO_SIZEOF_SUNPATH 0/MONO_SIZEOF_SUNPATH 104/' config.h
53 perl -pi -e 's/#define HAVE_FINITE 1//' config.h
54 perl -pi -e 's/#define HAVE_MMAP 1//' config.h
55 make
57 unsetenv
58 pushd mono/monoburg
59 /usr/bin/gcc -o monoburg ./monoburg.c parser.c -I../.. -pthread -lm $GLIB_FLAGS
60 make
61 popd
63 setenv
64 make