Mercurial > sdl-ios-xcode
comparison build-scripts/fatbuild.sh @ 4924:455c0dad84df
Allow the SDK path to be rebased
Fixed bug compiling on Mac OS X 10.5
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 01 Dec 2010 12:22:29 -0800 |
parents | 102be1cdd2bb |
children | ab02a7242f08 |
comparison
equal
deleted
inserted
replaced
4923:1002d074d459 | 4924:455c0dad84df |
---|---|
4 | 4 |
5 # Number of CPUs (for make -j) | 5 # Number of CPUs (for make -j) |
6 NCPU=`sysctl -n hw.ncpu` | 6 NCPU=`sysctl -n hw.ncpu` |
7 if test x$NJOB = x; then | 7 if test x$NJOB = x; then |
8 NJOB=$NCPU | 8 NJOB=$NCPU |
9 fi | |
10 | |
11 # SDK path | |
12 if test x$SDK_PATH = x; then | |
13 SDK_PATH=/Developer/SDKs | |
9 fi | 14 fi |
10 | 15 |
11 # Generic, cross-platform CFLAGS you always want go here. | 16 # Generic, cross-platform CFLAGS you always want go here. |
12 CFLAGS="-O3 -g -pipe" | 17 CFLAGS="-O3 -g -pipe" |
13 | 18 |
20 CC_PPC="gcc-4.0 -arch ppc" | 25 CC_PPC="gcc-4.0 -arch ppc" |
21 CXX_PPC="g++-4.0 -arch ppc" | 26 CXX_PPC="g++-4.0 -arch ppc" |
22 CFLAGS_PPC="-mmacosx-version-min=10.4" | 27 CFLAGS_PPC="-mmacosx-version-min=10.4" |
23 CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ | 28 CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ |
24 -nostdinc \ | 29 -nostdinc \ |
25 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 30 -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \ |
26 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ | 31 -I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ |
27 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" | 32 -isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include" |
28 | 33 |
29 # PowerPC 32-bit linker flags | 34 # PowerPC 32-bit linker flags |
30 LFLAGS_PPC="-arch ppc -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \ | 35 LFLAGS_PPC="-arch ppc -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \ |
31 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 36 -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \ |
32 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1 \ | 37 -L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1 \ |
33 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" | 38 -Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk" |
34 | 39 |
35 # PowerPC 64-bit configure flags (10.5 runtime compatibility) | 40 # PowerPC 64-bit configure flags (10.5 runtime compatibility) |
36 # We dynamically load X11, so using the system X11 headers is fine. | 41 # We dynamically load X11, so using the system X11 headers is fine. |
37 CONFIG_PPC64="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ | 42 CONFIG_PPC64="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ |
38 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | 43 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
41 CC_PPC64="gcc-4.0 -arch ppc64" | 46 CC_PPC64="gcc-4.0 -arch ppc64" |
42 CXX_PPC64="g++-4.0 -arch ppc64" | 47 CXX_PPC64="g++-4.0 -arch ppc64" |
43 CFLAGS_PPC64="-mmacosx-version-min=10.5" | 48 CFLAGS_PPC64="-mmacosx-version-min=10.5" |
44 CPPFLAGS_PPC64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ | 49 CPPFLAGS_PPC64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ |
45 -nostdinc \ | 50 -nostdinc \ |
46 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | 51 -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \ |
47 -I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ | 52 -I$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ |
48 -isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include" | 53 -isystem $SDK_PATH/MacOSX10.5.sdk/usr/include" |
49 | 54 |
50 # PowerPC 64-bit linker flags | 55 # PowerPC 64-bit linker flags |
51 LFLAGS_PPC64="-arch ppc64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \ | 56 LFLAGS_PPC64="-arch ppc64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \ |
52 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | 57 -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \ |
53 -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/ppc64 \ | 58 -L$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/ppc64 \ |
54 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk" | 59 -Wl,-syslibroot,$SDK_PATH/MacOSX10.5.sdk" |
55 | 60 |
56 # Intel 32-bit configure flags (10.4 runtime compatibility) | 61 # Intel 32-bit configure flags (10.4 runtime compatibility) |
57 # We dynamically load X11, so using the system X11 headers is fine. | 62 # We dynamically load X11, so using the system X11 headers is fine. |
58 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ | 63 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ |
59 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | 64 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
63 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ | 68 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ |
64 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | 69 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
65 | 70 |
66 # They changed this to "darwin10" in Xcode 3.2 (Snow Leopard). | 71 # They changed this to "darwin10" in Xcode 3.2 (Snow Leopard). |
67 GCCUSRPATH_X86="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1" | 72 GCCUSRPATH_X86="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1" |
68 if [ ! -d "$GCCUSRPATH" ]; then | 73 if [ ! -d "$GCCUSRPATH_X86" ]; then |
69 GCCUSRPATH_X86="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1" | 74 GCCUSRPATH_X86="$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1" |
70 fi | 75 fi |
71 if [ ! -d "$GCCUSRPATH_X86" ]; then | 76 if [ ! -d "$GCCUSRPATH_X86" ]; then |
72 echo "Couldn't find any GCC usr path for x86" | 77 echo "Couldn't find any GCC usr path for x86" |
73 exit 1 | 78 exit 1 |
77 CC_X86="gcc-4.0 -arch i386" | 82 CC_X86="gcc-4.0 -arch i386" |
78 CXX_X86="g++-4.0 -arch i386" | 83 CXX_X86="g++-4.0 -arch i386" |
79 CFLAGS_X86="-mmacosx-version-min=10.4" | 84 CFLAGS_X86="-mmacosx-version-min=10.4" |
80 CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ | 85 CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ |
81 -nostdinc \ | 86 -nostdinc \ |
82 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 87 -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \ |
83 -I$GCCUSRPATH_X86/include \ | 88 -I$GCCUSRPATH_X86/include \ |
84 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" | 89 -isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include" |
85 | 90 |
86 # Intel 32-bit linker flags | 91 # Intel 32-bit linker flags |
87 LFLAGS_X86="-arch i386 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \ | 92 LFLAGS_X86="-arch i386 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \ |
88 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 93 -F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \ |
89 -L$GCCUSRPATH_X86 \ | 94 -L$GCCUSRPATH_X86 \ |
90 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" | 95 -Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk" |
91 | 96 |
92 # Intel 64-bit configure flags (10.5 runtime compatibility) | 97 # Intel 64-bit configure flags (10.5 runtime compatibility) |
93 # We dynamically load X11, so using the system X11 headers is fine. | 98 # We dynamically load X11, so using the system X11 headers is fine. |
94 CONFIG_X64="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ | 99 CONFIG_X64="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ |
95 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | 100 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
98 CC_X64="gcc-4.0 -arch x86_64" | 103 CC_X64="gcc-4.0 -arch x86_64" |
99 CXX_X64="g++-4.0 -arch x86_64" | 104 CXX_X64="g++-4.0 -arch x86_64" |
100 CFLAGS_X64="-mmacosx-version-min=10.5" | 105 CFLAGS_X64="-mmacosx-version-min=10.5" |
101 CPPFLAGS_X64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ | 106 CPPFLAGS_X64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ |
102 -nostdinc \ | 107 -nostdinc \ |
103 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | 108 -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \ |
104 -I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \ | 109 -I$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \ |
105 -isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include" | 110 -isystem $SDK_PATH/MacOSX10.5.sdk/usr/include" |
106 | 111 |
107 # Intel 64-bit linker flags | 112 # Intel 64-bit linker flags |
108 LFLAGS_X64="-arch x86_64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \ | 113 LFLAGS_X64="-arch x86_64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \ |
109 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | 114 -F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \ |
110 -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/x86_64 \ | 115 -L$SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/x86_64 \ |
111 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk" | 116 -Wl,-syslibroot,$SDK_PATH/MacOSX10.5.sdk" |
112 | 117 |
113 # | 118 # |
114 # Find the configure script | 119 # Find the configure script |
115 # | 120 # |
116 srcdir=`dirname $0`/.. | 121 srcdir=`dirname $0`/.. |