Mercurial > sdl-ios-xcode
comparison build-scripts/fatbuild.sh @ 3248:cde30895105d
Added 64-bit architectures to the fat build script
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 05 Sep 2009 10:39:18 +0000 |
parents | d984d5bb17e9 |
children | 2befcf0c5ce0 |
comparison
equal
deleted
inserted
replaced
3247:2dcfb4e07a57 | 3248:cde30895105d |
---|---|
7 NJOB=$NCPU | 7 NJOB=$NCPU |
8 | 8 |
9 # Generic, cross-platform CFLAGS you always want go here. | 9 # Generic, cross-platform CFLAGS you always want go here. |
10 CFLAGS="-O3 -g -pipe" | 10 CFLAGS="-O3 -g -pipe" |
11 | 11 |
12 # PowerPC configure flags (10.4 runtime compatibility) | 12 # PowerPC 32-bit configure flags (10.4 runtime compatibility) |
13 # We dynamically load X11, so using the system X11 headers is fine. | 13 # We dynamically load X11, so using the system X11 headers is fine. |
14 CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ | 14 CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ |
15 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | 15 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
16 | 16 |
17 # PowerPC compiler flags | 17 # PowerPC 32-bit compiler flags |
18 CC_PPC="gcc-4.0 -arch ppc" | 18 CC_PPC="gcc-4.0 -arch ppc" |
19 CXX_PPC="g++-4.0 -arch ppc" | 19 CXX_PPC="g++-4.0 -arch ppc" |
20 CFLAGS_PPC="" | 20 CFLAGS_PPC="" |
21 CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ | 21 CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ |
22 -nostdinc \ | 22 -nostdinc \ |
23 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 23 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ |
24 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ | 24 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ |
25 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" | 25 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" |
26 | 26 |
27 # PowerPC linker flags | 27 # PowerPC 32-bit linker flags |
28 LFLAGS_PPC="-arch ppc -mmacosx-version-min=10.3 \ | 28 LFLAGS_PPC="-arch ppc -mmacosx-version-min=10.4 \ |
29 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 29 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ |
30 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1 \ | 30 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1 \ |
31 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" | 31 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" |
32 | 32 |
33 # Intel configure flags (10.4 runtime compatibility) | 33 # PowerPC 64-bit configure flags (10.5 runtime compatibility) |
34 # We dynamically load X11, so using the system X11 headers is fine. | |
35 CONFIG_PPC64="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ | |
36 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | |
37 | |
38 # PowerPC 64-bit compiler flags | |
39 CC_PPC64="gcc-4.0 -arch ppc64" | |
40 CXX_PPC64="g++-4.0 -arch ppc64" | |
41 CFLAGS_PPC64="" | |
42 CPPFLAGS_PPC64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ | |
43 -nostdinc \ | |
44 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | |
45 -I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ | |
46 -isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include" | |
47 | |
48 # PowerPC 64-bit linker flags | |
49 LFLAGS_PPC64="-arch ppc64 -mmacosx-version-min=10.5 \ | |
50 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | |
51 -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/ppc64 \ | |
52 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk" | |
53 | |
54 # Intel 32-bit configure flags (10.4 runtime compatibility) | |
34 # We dynamically load X11, so using the system X11 headers is fine. | 55 # We dynamically load X11, so using the system X11 headers is fine. |
35 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ | 56 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ |
36 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | 57 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
37 | 58 |
38 # Intel compiler flags | 59 # Intel 32-bit configure flags (10.4 runtime compatibility) |
60 # We dynamically load X11, so using the system X11 headers is fine. | |
61 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ | |
62 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | |
63 | |
64 # Intel 32-bit compiler flags | |
39 CC_X86="gcc-4.0 -arch i386" | 65 CC_X86="gcc-4.0 -arch i386" |
40 CXX_X86="g++-4.0 -arch i386" | 66 CXX_X86="g++-4.0 -arch i386" |
41 CFLAGS_X86="-mmacosx-version-min=10.4" | 67 CFLAGS_X86="-mmacosx-version-min=10.4" |
42 CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ | 68 CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ |
43 -nostdinc \ | 69 -nostdinc \ |
44 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 70 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ |
45 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \ | 71 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \ |
46 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" | 72 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" |
47 | 73 |
48 # Intel linker flags | 74 # Intel 32-bit linker flags |
49 LFLAGS_X86="-arch i386 -mmacosx-version-min=10.4 \ | 75 LFLAGS_X86="-arch i386 -mmacosx-version-min=10.4 \ |
50 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ | 76 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ |
51 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1 \ | 77 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1 \ |
52 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" | 78 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" |
53 | 79 |
80 # Intel 64-bit configure flags (10.5 runtime compatibility) | |
81 # We dynamically load X11, so using the system X11 headers is fine. | |
82 CONFIG_X64="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ | |
83 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" | |
84 | |
85 # Intel 64-bit compiler flags | |
86 CC_X64="gcc-4.0 -arch x86_64" | |
87 CXX_X64="g++-4.0 -arch x86_64" | |
88 CFLAGS_X64="-mmacosx-version-min=10.5" | |
89 CPPFLAGS_X64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ | |
90 -nostdinc \ | |
91 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | |
92 -I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \ | |
93 -isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include" | |
94 | |
95 # Intel 64-bit linker flags | |
96 LFLAGS_X64="-arch x86_64 -mmacosx-version-min=10.5 \ | |
97 -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ | |
98 -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/x86_64 \ | |
99 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk" | |
100 | |
54 # | 101 # |
55 # Find the configure script | 102 # Find the configure script |
56 # | 103 # |
57 srcdir=`dirname $0`/.. | 104 srcdir=`dirname $0`/.. |
58 auxdir=$srcdir/build-scripts | 105 auxdir=$srcdir/build-scripts |
59 cd $srcdir | 106 cd $srcdir |
60 | 107 |
61 # | 108 # |
62 # Figure out which phase to build: | 109 # Figure out which phase to build: |
63 # all, | 110 # all, |
64 # configure, configure-ppc, configure-x86, | 111 # configure, configure-ppc, configure-ppc64, configure-x86, configure-x64 |
65 # make, make-ppc, make-x86, merge | 112 # make, make-ppc, make-ppc64, make-x86, make-x64, merge |
66 # install | 113 # install |
67 # clean | 114 # clean |
68 if test x"$1" = x; then | 115 if test x"$1" = x; then |
69 phase=all | 116 phase=all |
70 else | 117 else |
71 phase="$1" | 118 phase="$1" |
72 fi | 119 fi |
73 case $phase in | 120 case $phase in |
74 all) | 121 all) |
75 configure_ppc="yes" | 122 configure_ppc="yes" |
123 configure_ppc64="yes" | |
76 configure_x86="yes" | 124 configure_x86="yes" |
125 configure_x64="yes" | |
77 make_ppc="yes" | 126 make_ppc="yes" |
127 make_ppc64="yes" | |
78 make_x86="yes" | 128 make_x86="yes" |
129 make_x64="yes" | |
79 merge="yes" | 130 merge="yes" |
80 ;; | 131 ;; |
81 configure) | 132 configure) |
82 configure_ppc="yes" | 133 configure_ppc="yes" |
134 configure_ppc64="yes" | |
83 configure_x86="yes" | 135 configure_x86="yes" |
136 configure_x64="yes" | |
84 ;; | 137 ;; |
85 configure-ppc) | 138 configure-ppc) |
86 configure_ppc="yes" | 139 configure_ppc="yes" |
87 ;; | 140 ;; |
141 configure-ppc64) | |
142 configure_ppc64="yes" | |
143 ;; | |
88 configure-x86) | 144 configure-x86) |
89 configure_x86="yes" | 145 configure_x86="yes" |
90 ;; | 146 ;; |
147 configure-x64) | |
148 configure_x64="yes" | |
149 ;; | |
91 make) | 150 make) |
92 make_ppc="yes" | 151 make_ppc="yes" |
152 make_ppc64="yes" | |
93 make_x86="yes" | 153 make_x86="yes" |
154 make_x64="yes" | |
94 merge="yes" | 155 merge="yes" |
95 ;; | 156 ;; |
96 make-ppc) | 157 make-ppc) |
97 make_ppc="yes" | 158 make_ppc="yes" |
98 ;; | 159 ;; |
160 make-ppc64) | |
161 make_ppc64="yes" | |
162 ;; | |
99 make-x86) | 163 make-x86) |
100 make_x86="yes" | 164 make_x86="yes" |
165 ;; | |
166 make-x64) | |
167 make_x64="yes" | |
101 ;; | 168 ;; |
102 merge) | 169 merge) |
103 merge="yes" | 170 merge="yes" |
104 ;; | 171 ;; |
105 install) | 172 install) |
124 install-man) | 191 install-man) |
125 install_man="yes" | 192 install_man="yes" |
126 ;; | 193 ;; |
127 clean) | 194 clean) |
128 clean_ppc="yes" | 195 clean_ppc="yes" |
196 clean_ppc64="yes" | |
129 clean_x86="yes" | 197 clean_x86="yes" |
198 clean_x64="yes" | |
130 ;; | 199 ;; |
131 clean-ppc) | 200 clean-ppc) |
132 clean_ppc="yes" | 201 clean_ppc="yes" |
133 ;; | 202 ;; |
203 clean-ppc64) | |
204 clean_ppc64="yes" | |
205 ;; | |
134 clean-x86) | 206 clean-x86) |
135 clean_x86="yes" | 207 clean_x86="yes" |
136 ;; | 208 ;; |
209 clean-x64) | |
210 clean_x64="yes" | |
211 ;; | |
137 *) | 212 *) |
138 echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge|install|clean]" | 213 echo "Usage: $0 [all|configure[-ppc|-ppc64|-x86|-x64]|make[-ppc|-ppc64|-x86|-x64]|merge|install|clean[-ppc|-ppc64|-x86|-x64]]" |
139 exit 1 | 214 exit 1 |
140 ;; | 215 ;; |
141 esac | 216 esac |
142 case `uname -p` in | 217 case `uname -p` in |
143 powerpc) | 218 powerpc) |
153 esac | 228 esac |
154 | 229 |
155 # | 230 # |
156 # Create the build directories | 231 # Create the build directories |
157 # | 232 # |
158 for dir in build build/ppc build/x86; do | 233 for dir in build build/ppc build/ppc64 build/x86 build/x64; do |
159 if test -d $dir; then | 234 if test -d $dir; then |
160 : | 235 : |
161 else | 236 else |
162 mkdir $dir || exit 1 | 237 mkdir $dir || exit 1 |
163 fi | 238 fi |
164 done | 239 done |
165 | 240 |
166 # | 241 # |
167 # Build the PowerPC binary | 242 # Build the PowerPC 32-bit binary |
168 # | 243 # |
169 if test x$configure_ppc = xyes; then | 244 if test x$configure_ppc = xyes; then |
170 (cd build/ppc && \ | 245 (cd build/ppc && \ |
171 sh ../../configure $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2 | 246 sh ../../configure $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2 |
172 fi | 247 fi |
173 if test x$make_ppc = xyes; then | 248 if test x$make_ppc = xyes; then |
174 (cd build/ppc && ls include && make -j$NJOB) || exit 3 | 249 (cd build/ppc && ls include && make -j$NJOB) || exit 3 |
175 fi | 250 fi |
176 | 251 |
177 # | 252 # |
178 # Build the Intel binary | 253 # Build the PowerPC 64-bit binary |
254 # | |
255 if test x$configure_ppc64 = xyes; then | |
256 (cd build/ppc64 && \ | |
257 sh ../../configure $CONFIG_PPC64 CC="$CC_PPC64" CXX="$CXX_PPC64" CFLAGS="$CFLAGS $CFLAGS_PPC64" CPPFLAGS="$CPPFLAGS_PPC64" LDFLAGS="$LFLAGS_PPC64") || exit 2 | |
258 fi | |
259 if test x$make_ppc64 = xyes; then | |
260 (cd build/ppc64 && ls include && make -j$NJOB) || exit 3 | |
261 fi | |
262 | |
263 # | |
264 # Build the Intel 32-bit binary | |
179 # | 265 # |
180 if test x$configure_x86 = xyes; then | 266 if test x$configure_x86 = xyes; then |
181 (cd build/x86 && \ | 267 (cd build/x86 && \ |
182 sh ../../configure $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2 | 268 sh ../../configure $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2 |
183 fi | 269 fi |
184 if test x$make_x86 = xyes; then | 270 if test x$make_x86 = xyes; then |
185 (cd build/x86 && make -j$NJOB) || exit 3 | 271 (cd build/x86 && make -j$NJOB) || exit 3 |
272 fi | |
273 | |
274 # | |
275 # Build the Intel 32-bit binary | |
276 # | |
277 if test x$configure_x64 = xyes; then | |
278 (cd build/x64 && \ | |
279 sh ../../configure $CONFIG_X64 CC="$CC_X64" CXX="$CXX_X64" CFLAGS="$CFLAGS $CFLAGS_X64" CPPFLAGS="$CPPFLAGS_X64" LDFLAGS="$LFLAGS_X64") || exit 2 | |
280 fi | |
281 if test x$make_x64 = xyes; then | |
282 (cd build/x64 && make -j$NJOB) || exit 3 | |
186 fi | 283 fi |
187 | 284 |
188 # | 285 # |
189 # Combine into fat binary | 286 # Combine into fat binary |
190 # | 287 # |