Mercurial > sdl-ios-xcode
annotate build-scripts/fatbuild.sh @ 3227:458e53d8662c
Clarified API documentation
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 02 Aug 2009 18:39:57 +0000 |
parents | ff3b47d22a6d |
children | d984d5bb17e9 |
rev | line source |
---|---|
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 #!/bin/sh |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
3 # Build a fat binary on Mac OS X, thanks Ryan! |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
1741 | 5 # Number of CPUs (for make -j) |
6 NCPU=`sysctl -n hw.ncpu` | |
1744 | 7 NJOB=$NCPU |
8 #NJOB=`expr $NCPU + 1` | |
1741 | 9 |
10 # Generic, cross-platform CFLAGS you always want go here. | |
11 CFLAGS="-O3 -g -pipe" | |
12 | |
2282
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
13 # PowerPC configure flags (10.3 runtime compatibility) |
1799
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
14 # We dynamically load X11, so using the system X11 headers is fine. |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
15 CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \ |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
16 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
17 |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
18 # PowerPC compiler flags |
2282
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
19 CC_PPC="gcc-4.0 -arch ppc" |
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
20 CXX_PPC="g++-4.0 -arch ppc" |
1739
3a3e847aadb9
Trying to fix fatbuild.sh on intel
Sam Lantinga <slouken@libsdl.org>
parents:
1648
diff
changeset
|
21 CFLAGS_PPC="" |
2047 | 22 CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \ |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
23 -nostdinc \ |
2047 | 24 -F/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks \ |
2282
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
25 -I/Developer/SDKs/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include \ |
2047 | 26 -isystem /Developer/SDKs/MacOSX10.3.9.sdk/usr/include" |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 |
2282
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
28 # PowerPC linker flags |
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
29 LFLAGS_PPC="-arch ppc -mmacosx-version-min=10.3 \ |
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
30 -L/Developer/SDKs/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 \ |
2047 | 31 -F/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks \ |
32 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk" | |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
33 |
1799
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
34 # Intel configure flags (10.4 runtime compatibility) |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
35 # We dynamically load X11, so using the system X11 headers is fine. |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
36 CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \ |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
37 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
38 |
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
39 # Intel compiler flags |
1739
3a3e847aadb9
Trying to fix fatbuild.sh on intel
Sam Lantinga <slouken@libsdl.org>
parents:
1648
diff
changeset
|
40 CC_X86="gcc-4.0 -arch i386" |
1743 | 41 CXX_X86="g++-4.0 -arch i386" |
1739
3a3e847aadb9
Trying to fix fatbuild.sh on intel
Sam Lantinga <slouken@libsdl.org>
parents:
1648
diff
changeset
|
42 CFLAGS_X86="-mmacosx-version-min=10.4" |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
43 CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ |
1742
af4352da64d8
Fixed bug #206, fatbuild.sh works flawlessly on Intel Macs
Sam Lantinga <slouken@libsdl.org>
parents:
1741
diff
changeset
|
44 -nostdinc \ |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
45 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ |
2282
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
46 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \ |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
47 -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
48 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
49 # Intel linker flags |
1639
0f466fb614a9
Whoops, need the actual flags here
Sam Lantinga <slouken@libsdl.org>
parents:
1636
diff
changeset
|
50 LFLAGS_X86="-arch i386 -mmacosx-version-min=10.4 \ |
2282
ff3b47d22a6d
Fixed fatbuild.sh script for building on Mac OS X 10.5
Sam Lantinga <slouken@libsdl.org>
parents:
2089
diff
changeset
|
51 -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1 \ |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
52 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
53 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
54 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
55 # Find the configure script |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
56 # |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
57 srcdir=`dirname $0`/.. |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
58 auxdir=$srcdir/build-scripts |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
59 cd $srcdir |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
60 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
61 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
62 # Figure out which phase to build: |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
63 # all, |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
64 # configure, configure-ppc, configure-x86, |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
65 # make, make-ppc, make-x86, merge |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
66 # install |
1741 | 67 # clean |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
68 if test x"$1" = x; then |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
69 phase=all |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
70 else |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
71 phase="$1" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
72 fi |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
73 case $phase in |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
74 all) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
75 configure_ppc="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
76 configure_x86="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
77 make_ppc="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
78 make_x86="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
79 merge="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
80 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
81 configure) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
82 configure_ppc="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
83 configure_x86="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
84 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
85 configure-ppc) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
86 configure_ppc="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
87 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
88 configure-x86) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
89 configure_x86="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
90 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
91 make) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
92 make_ppc="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
93 make_x86="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
94 merge="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
95 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
96 make-ppc) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
97 make_ppc="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
98 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
99 make-x86) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
100 make_x86="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
101 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
102 merge) |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
103 merge="yes" |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
104 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
105 install) |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
106 install_bin="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
107 install_hdrs="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
108 install_lib="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
109 install_data="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
110 install_man="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
111 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
112 install-bin) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
113 install_bin="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
114 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
115 install-hdrs) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
116 install_hdrs="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
117 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
118 install-lib) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
119 install_lib="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
120 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
121 install-data) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
122 install_data="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
123 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
124 install-man) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
125 install_man="yes" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
126 ;; |
1741 | 127 clean) |
128 clean_ppc="yes" | |
129 clean_x86="yes" | |
130 ;; | |
131 clean-ppc) | |
132 clean_ppc="yes" | |
133 ;; | |
134 clean-x86) | |
135 clean_x86="yes" | |
136 ;; | |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
137 *) |
1741 | 138 echo "Usage: $0 [all|configure[-ppc|-x86]|make[-ppc|-x86]|merge|install|clean]" |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
139 exit 1 |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
140 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
141 esac |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
142 case `uname -p` in |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
143 powerpc) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
144 native_path=ppc |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
145 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
146 *86) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
147 native_path=x86 |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
148 ;; |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
149 *) |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
150 echo "Couldn't figure out native architecture path" |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
151 exit 1 |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
152 ;; |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
153 esac |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
154 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
155 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
156 # Create the build directories |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
157 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
158 for dir in build build/ppc build/x86; do |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
159 if test -d $dir; then |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
160 : |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
161 else |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
162 mkdir $dir || exit 1 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
163 fi |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
164 done |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
165 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
166 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
167 # Build the PowerPC binary |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
168 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
169 if test x$configure_ppc = xyes; then |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
170 (cd build/ppc && \ |
1799
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
171 sh ../../configure $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2 |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
172 fi |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
173 if test x$make_ppc = xyes; then |
1742
af4352da64d8
Fixed bug #206, fatbuild.sh works flawlessly on Intel Macs
Sam Lantinga <slouken@libsdl.org>
parents:
1741
diff
changeset
|
174 (cd build/ppc && ls include && make -j$NJOB) || exit 3 |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
175 fi |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
176 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
177 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
178 # Build the Intel binary |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
179 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
180 if test x$configure_x86 = xyes; then |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
181 (cd build/x86 && \ |
1799
50e9cca3fe7b
Fixed X11 support on Mac OS X Universal build
Sam Lantinga <slouken@libsdl.org>
parents:
1744
diff
changeset
|
182 sh ../../configure $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2 |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
183 fi |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
184 if test x$make_x86 = xyes; then |
1742
af4352da64d8
Fixed bug #206, fatbuild.sh works flawlessly on Intel Macs
Sam Lantinga <slouken@libsdl.org>
parents:
1741
diff
changeset
|
185 (cd build/x86 && make -j$NJOB) || exit 3 |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
186 fi |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
187 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
188 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
189 # Combine into fat binary |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
190 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
191 if test x$merge = xyes; then |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
192 output=.libs |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
193 sh $auxdir/mkinstalldirs build/$output |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
194 cd build |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
195 target=`find . -mindepth 3 -type f -name '*.dylib' | head -1 | sed 's|.*/||'` |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
196 (lipo -create -o $output/$target `find . -mindepth 3 -type f -name "*.dylib"` && |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
197 ln -sf $target $output/libSDL-1.2.0.dylib && |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
198 ln -sf $target $output/libSDL.dylib && |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
199 lipo -create -o $output/libSDL.a */build/.libs/libSDL.a && |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
200 cp $native_path/build/.libs/libSDL.la $output && |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
201 cp $native_path/build/.libs/libSDL.lai $output && |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
202 cp $native_path/build/libSDL.la . && |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
203 lipo -create -o libSDLmain.a */build/libSDLmain.a && |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
204 echo "Build complete!" && |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
205 echo "Files can be found in the build directory.") || exit 4 |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
206 cd .. |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
207 fi |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
208 |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
209 # |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
210 # Install |
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
211 # |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
212 do_install() |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
213 { |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
214 echo $* |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
215 $* || exit 5 |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
216 } |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
217 if test x$prefix = x; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
218 prefix=/usr/local |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
219 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
220 if test x$exec_prefix = x; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
221 exec_prefix=$prefix |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
222 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
223 if test x$bindir = x; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
224 bindir=$exec_prefix/bin |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
225 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
226 if test x$libdir = x; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
227 libdir=$exec_prefix/lib |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
228 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
229 if test x$includedir = x; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
230 includedir=$prefix/include |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
231 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
232 if test x$datadir = x; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
233 datadir=$prefix/share |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
234 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
235 if test x$mandir = x; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
236 mandir=$prefix/man |
1636
3d0dec74ad01
A script to build a fat version of the SDL library... completely untested!
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
237 fi |
1648
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
238 if test x$install_bin = xyes; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
239 do_install sh $auxdir/mkinstalldirs $bindir |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
240 do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
241 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
242 if test x$install_hdrs = xyes; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
243 do_install sh $auxdir/mkinstalldirs $includedir/SDL |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
244 for src in $srcdir/include/*.h; do \ |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
245 file=`echo $src | sed -e 's|^.*/||'`; \ |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
246 do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \ |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
247 done |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
248 do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
249 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
250 if test x$install_lib = xyes; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
251 do_install sh $auxdir/mkinstalldirs $libdir |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
252 do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
253 do_install /usr/bin/install -c -m 644 build/libSDLmain.a $libdir/libSDLmain.a |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
254 do_install ranlib $libdir/libSDLmain.a |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
255 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
256 if test x$install_data = xyes; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
257 do_install sh $auxdir/mkinstalldirs $datadir/aclocal |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
258 do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4 |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
259 fi |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
260 if test x$install_man = xyes; then |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
261 do_install sh $auxdir/mkinstalldirs $mandir/man3 |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
262 for src in $srcdir/docs/man3/*.3; do \ |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
263 file=`echo $src | sed -e 's|^.*/||'`; \ |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
264 do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \ |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
265 done |
9f59d4c5aaea
Mac OS X fat build works! :)
Sam Lantinga <slouken@libsdl.org>
parents:
1646
diff
changeset
|
266 fi |
1741 | 267 |
268 # | |
269 # Clean up | |
270 # | |
271 do_clean() | |
272 { | |
273 echo $* | |
274 $* || exit 6 | |
275 } | |
276 if test x$clean_x86 = xyes; then | |
277 do_clean rm -r build/x86 | |
278 fi | |
279 if test x$clean_ppc = xyes; then | |
280 do_clean rm -r build/ppc | |
281 fi | |
282 |