]> git.saurik.com Git - wxWidgets.git/blob - distrib/scripts/mac/macbuild-lipo
Make sure all Bakefile formats that use CRLF line feeds are set to use CRLF in SVN.
[wxWidgets.git] / distrib / scripts / mac / macbuild-lipo
1 #!/bin/sh
2
3 # you need to change this if you run from outside this dir.
4 if [ "$WXROOT" = "" ]; then
5 scriptDir="$(cd $(dirname $0);pwd)"
6 WXROOT=$scriptDir/../../..
7 fi
8
9 . $WXROOT/distrib/scripts/includes/configure_build.inc
10
11 . $WXROOT/distrib/scripts/mac/mac_options.inc
12
13 OTHER_OPTS="$OTHER_OPTS --disable-precomp-headers"
14
15 do_lipo_build(){
16 DIR="bld-$1"
17
18 if [ "$1" = "ppc" ]; then
19 export CXX="g++-3.3 -arch ppc -DMAC_OS_X_VERSION_MAX_ALLOWED=1040"
20 export CC="gcc-3.3 -arch ppc -DMAC_OS_X_VERSION_MAX_ALLOWED=1040"
21 export MACOSX_DEPLOYMENT_TARGET=10.3
22 else
23 export CXX="g++-4.0 -arch i386"
24 export CC="gcc-4.0 -arch i386"
25 export MACOSX_DEPLOYMENT_TARGET=10.4
26 fi
27
28 mkdir -p $DIR
29 cd $DIR
30 do_build
31
32 mkdir -p $INSTALLDIR/$1
33
34 make prefix=$INSTALLDIR/$1 install
35
36 if [ "$WXPYTHON" == "1" ]; then
37 make -C contrib/src/gizmos prefix=$INSTALLDIR/$1 install
38 make -C contrib/src/stc prefix=$INSTALLDIR/$1 install
39 fi
40
41 cd ..
42 }
43
44 do_lipo_build "ppc"
45 do_lipo_build "i386"
46
47 python $WXROOT/distrib/scripts/mac/lipo-dir.py $INSTALLDIR/ppc $INSTALLDIR/i386 $INSTALLDIR
48
49 rm -rf $INSTALLDIR/ppc $INSTALLDIR/i386
50 python -c "import os; fname = os.path.abspath('$INSTALLDIR/bin/wx-config'); data = open(fname).read(); data = data.replace('ppc/', ''); open(fname, 'w').write(data)"
51
52 if [ $? != 0 ]; then
53 exit $?
54 fi