]> git.saurik.com Git - wxWidgets.git/blame - distrib/scripts/mac/macbuild-lipo
cleanup and minor tweak for wxPython build
[wxWidgets.git] / distrib / scripts / mac / macbuild-lipo
CommitLineData
3d23c9b7
KO
1#!/bin/sh
2
3# you need to change this if you run from outside this dir.
4if [ "$WXROOT" = "" ]; then
5 WXROOT=../../..
6fi
7
8. $WXROOT/distrib/scripts/includes/configure_build.inc
9
10. $WXROOT/distrib/scripts/mac/mac_options.inc
11
12DIR="bld-ppc"
13
14export CXX="g++-3.3 -arch ppc"
15export CC="gcc-3.3 -arch ppc"
16mkdir -p $DIR
17cd $DIR
18do_build
19cd ..
20
21# Do another build, but with i386 this time
22DIR="bld-i386"
23
24export CXX="g++-4.0 -arch i386"
25export CC="gcc-4.0 -arch i386"
26mkdir -p $DIR
27cd $DIR
28do_build
29cd ..
30
31# Copy over everything, then remove files we need to replace with lipo'd versions
32mkdir -p bld
33cp -R bld-i386/* bld
34cp -R bld-i386/.pch bld/.pch
35rm bld/lib/*.dylib
36
37# lipo the files, but make sure not to run it on symbolic links
38for item in `cd bld-i386/lib; ls *.dylib`
39do
40 if [ -f bld-i386/lib/$item -a ! -L bld-i386/lib/$item ]; then
41 lipo -create bld-i386/lib/$item bld-ppc/lib/$item -output bld/lib/$item
42 else
43 cp -R bld-i386/lib/$item bld/lib
44 fi
45done
46
47# make install hacks - the copy operations mess up the timestamps and thus
48# cause make to erroneously think that the libraries need rebuilt
49touch bld/.pch/wxprec_monodll/wx/*.gch
50touch bld/.pch/wxprec_gldll/wx/*.gch
51touch bld/*.o
52touch bld/lib/*
53
54# one more hack - inplace wx-config has a hardcoded path in it - we need to
55# change that path from bld-i386 to just bld in case someone wants to build things
56# in tree. (wxPython does this, for example)
57python -c "import os; fname = os.path.abspath('bld/wx-config'); data = open(fname).read(); data = data.replace('bld-i386', 'bld'); open(fname, 'w').write(data)"
58
59cd bld
60make prefix=$INSTALLDIR install
61
62if [ "$WXPYTHON" == "1" ]; then
63 make -C contrib/src/animate prefix=$INSTALLDIR install
64 make -C contrib/src/gizmos prefix=$INSTALLDIR install
65 make -C contrib/src/stc prefix=$INSTALLDIR install
66fi