slouken@1636
|
1 |
#!/bin/sh
|
slouken@1636
|
2 |
#
|
slouken@1636
|
3 |
# Build a fat binary on Mac OS X, thanks Ryan!
|
slouken@1636
|
4 |
|
icculus@1741
|
5 |
# Number of CPUs (for make -j)
|
icculus@1741
|
6 |
NCPU=`sysctl -n hw.ncpu`
|
slouken@3524
|
7 |
if test x$NJOB = x; then
|
slouken@3524
|
8 |
NJOB=$NCPU
|
slouken@3524
|
9 |
fi
|
icculus@1741
|
10 |
|
slouken@4924
|
11 |
# SDK path
|
slouken@4924
|
12 |
if test x$SDK_PATH = x; then
|
slouken@4924
|
13 |
SDK_PATH=/Developer/SDKs
|
slouken@4924
|
14 |
fi
|
slouken@4924
|
15 |
|
icculus@1741
|
16 |
# Generic, cross-platform CFLAGS you always want go here.
|
icculus@1741
|
17 |
CFLAGS="-O3 -g -pipe"
|
icculus@1741
|
18 |
|
slouken@4926
|
19 |
# They changed this from "darwin9" to "darwin10" in Xcode 3.2 (Snow Leopard).
|
slouken@4926
|
20 |
GCCUSRPATH_PPC=`ls -d $SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin*/4.0.1`
|
slouken@4926
|
21 |
if [ ! -d "$GCCUSRPATH_PPC" ]; then
|
slouken@4926
|
22 |
echo "Couldn't find any GCC usr path for 32-bit ppc"
|
slouken@4926
|
23 |
exit 1
|
slouken@4926
|
24 |
fi
|
slouken@4926
|
25 |
GCCUSRPATH_PPC64=`ls -d $SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin*/4.0.1`
|
slouken@4926
|
26 |
if [ ! -d "$GCCUSRPATH_PPC64" ]; then
|
slouken@4926
|
27 |
echo "Couldn't find any GCC usr path for 64-bit ppc"
|
slouken@4926
|
28 |
exit 1
|
slouken@4926
|
29 |
fi
|
slouken@4926
|
30 |
|
slouken@3248
|
31 |
# PowerPC 32-bit configure flags (10.4 runtime compatibility)
|
slouken@1799
|
32 |
# We dynamically load X11, so using the system X11 headers is fine.
|
slouken@1799
|
33 |
CONFIG_PPC="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \
|
slouken@1799
|
34 |
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
|
slouken@1799
|
35 |
|
slouken@3248
|
36 |
# PowerPC 32-bit compiler flags
|
slouken@2282
|
37 |
CC_PPC="gcc-4.0 -arch ppc"
|
slouken@2282
|
38 |
CXX_PPC="g++-4.0 -arch ppc"
|
slouken@3282
|
39 |
CFLAGS_PPC="-mmacosx-version-min=10.4"
|
slouken@3245
|
40 |
CPPFLAGS_PPC="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
|
slouken@1648
|
41 |
-nostdinc \
|
slouken@4924
|
42 |
-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
|
slouken@4926
|
43 |
-I$GCCUSRPATH_PPC/include \
|
slouken@4924
|
44 |
-isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
|
slouken@1636
|
45 |
|
slouken@3248
|
46 |
# PowerPC 32-bit linker flags
|
icculus@3609
|
47 |
LFLAGS_PPC="-arch ppc -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \
|
slouken@4924
|
48 |
-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
|
slouken@4926
|
49 |
-L$GCCUSRPATH_PPC \
|
slouken@4924
|
50 |
-Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
|
slouken@1636
|
51 |
|
slouken@3248
|
52 |
# PowerPC 64-bit configure flags (10.5 runtime compatibility)
|
slouken@3248
|
53 |
# We dynamically load X11, so using the system X11 headers is fine.
|
slouken@3248
|
54 |
CONFIG_PPC64="--build=`uname -p`-apple-darwin --host=powerpc-apple-darwin \
|
slouken@3248
|
55 |
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
|
slouken@3248
|
56 |
|
slouken@3248
|
57 |
# PowerPC 64-bit compiler flags
|
slouken@3248
|
58 |
CC_PPC64="gcc-4.0 -arch ppc64"
|
slouken@3248
|
59 |
CXX_PPC64="g++-4.0 -arch ppc64"
|
slouken@3282
|
60 |
CFLAGS_PPC64="-mmacosx-version-min=10.5"
|
slouken@3248
|
61 |
CPPFLAGS_PPC64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
|
slouken@3248
|
62 |
-nostdinc \
|
slouken@4924
|
63 |
-F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
|
slouken@4926
|
64 |
-I$GCCUSRPATH_PPC64/include \
|
slouken@4924
|
65 |
-isystem $SDK_PATH/MacOSX10.5.sdk/usr/include"
|
slouken@3248
|
66 |
|
slouken@3248
|
67 |
# PowerPC 64-bit linker flags
|
icculus@3609
|
68 |
LFLAGS_PPC64="-arch ppc64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \
|
slouken@4924
|
69 |
-F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
|
slouken@4926
|
70 |
-L$GCCUSRPATH_PPC64/ppc64 \
|
slouken@4924
|
71 |
-Wl,-syslibroot,$SDK_PATH/MacOSX10.5.sdk"
|
slouken@3248
|
72 |
|
slouken@3248
|
73 |
# Intel 32-bit configure flags (10.4 runtime compatibility)
|
slouken@1799
|
74 |
# We dynamically load X11, so using the system X11 headers is fine.
|
slouken@1799
|
75 |
CONFIG_X86="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
|
slouken@1799
|
76 |
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
|
slouken@1799
|
77 |
|
slouken@4926
|
78 |
# They changed this from "darwin9" to "darwin10" in Xcode 3.2 (Snow Leopard).
|
slouken@4926
|
79 |
GCCUSRPATH_X86=`ls -d $SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin*/4.0.1`
|
slouken@4924
|
80 |
if [ ! -d "$GCCUSRPATH_X86" ]; then
|
slouken@4926
|
81 |
echo "Couldn't find any GCC usr path for 32-bit x86"
|
slouken@4926
|
82 |
exit 1
|
icculus@3629
|
83 |
fi
|
slouken@4926
|
84 |
GCCUSRPATH_X64=`ls -d $SDK_PATH/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin*/4.0.1`
|
slouken@4926
|
85 |
if [ ! -d "$GCCUSRPATH_X64" ]; then
|
slouken@4926
|
86 |
echo "Couldn't find any GCC usr path for 64-bit x86"
|
icculus@3629
|
87 |
exit 1
|
icculus@3629
|
88 |
fi
|
icculus@3629
|
89 |
|
slouken@3248
|
90 |
# Intel 32-bit compiler flags
|
slouken@1739
|
91 |
CC_X86="gcc-4.0 -arch i386"
|
slouken@1743
|
92 |
CXX_X86="g++-4.0 -arch i386"
|
slouken@1739
|
93 |
CFLAGS_X86="-mmacosx-version-min=10.4"
|
slouken@1648
|
94 |
CPPFLAGS_X86="-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
|
slouken@1742
|
95 |
-nostdinc \
|
slouken@4924
|
96 |
-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
|
icculus@3629
|
97 |
-I$GCCUSRPATH_X86/include \
|
slouken@4924
|
98 |
-isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
|
slouken@1636
|
99 |
|
slouken@3248
|
100 |
# Intel 32-bit linker flags
|
icculus@3609
|
101 |
LFLAGS_X86="-arch i386 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.4 \
|
slouken@4924
|
102 |
-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
|
icculus@3629
|
103 |
-L$GCCUSRPATH_X86 \
|
slouken@4924
|
104 |
-Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
|
slouken@1636
|
105 |
|
slouken@3248
|
106 |
# Intel 64-bit configure flags (10.5 runtime compatibility)
|
slouken@3248
|
107 |
# We dynamically load X11, so using the system X11 headers is fine.
|
slouken@3248
|
108 |
CONFIG_X64="--build=`uname -p`-apple-darwin --host=i386-apple-darwin \
|
slouken@3248
|
109 |
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
|
slouken@3248
|
110 |
|
slouken@3248
|
111 |
# Intel 64-bit compiler flags
|
slouken@3248
|
112 |
CC_X64="gcc-4.0 -arch x86_64"
|
slouken@3248
|
113 |
CXX_X64="g++-4.0 -arch x86_64"
|
slouken@3248
|
114 |
CFLAGS_X64="-mmacosx-version-min=10.5"
|
slouken@3248
|
115 |
CPPFLAGS_X64="-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \
|
slouken@3248
|
116 |
-nostdinc \
|
slouken@4924
|
117 |
-F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
|
slouken@4926
|
118 |
-I$GCCUSRPATH_X64/include \
|
slouken@4924
|
119 |
-isystem $SDK_PATH/MacOSX10.5.sdk/usr/include"
|
slouken@3248
|
120 |
|
slouken@3248
|
121 |
# Intel 64-bit linker flags
|
icculus@3609
|
122 |
LFLAGS_X64="-arch x86_64 -Wl,-headerpad_max_install_names -mmacosx-version-min=10.5 \
|
slouken@4924
|
123 |
-F$SDK_PATH/MacOSX10.5.sdk/System/Library/Frameworks \
|
slouken@4926
|
124 |
-L$GCCUSRPATH_X64/x86_64 \
|
slouken@4924
|
125 |
-Wl,-syslibroot,$SDK_PATH/MacOSX10.5.sdk"
|
slouken@3248
|
126 |
|
slouken@1636
|
127 |
#
|
slouken@1636
|
128 |
# Find the configure script
|
slouken@1636
|
129 |
#
|
slouken@1648
|
130 |
srcdir=`dirname $0`/..
|
slouken@1648
|
131 |
auxdir=$srcdir/build-scripts
|
slouken@1648
|
132 |
cd $srcdir
|
slouken@1636
|
133 |
|
slouken@1636
|
134 |
#
|
slouken@1636
|
135 |
# Figure out which phase to build:
|
slouken@1636
|
136 |
# all,
|
slouken@3248
|
137 |
# configure, configure-ppc, configure-ppc64, configure-x86, configure-x64
|
slouken@3248
|
138 |
# make, make-ppc, make-ppc64, make-x86, make-x64, merge
|
slouken@1636
|
139 |
# install
|
icculus@1741
|
140 |
# clean
|
slouken@1636
|
141 |
if test x"$1" = x; then
|
slouken@1636
|
142 |
phase=all
|
slouken@1636
|
143 |
else
|
slouken@1636
|
144 |
phase="$1"
|
slouken@1636
|
145 |
fi
|
slouken@1636
|
146 |
case $phase in
|
slouken@1636
|
147 |
all)
|
slouken@1636
|
148 |
configure_ppc="yes"
|
slouken@3248
|
149 |
configure_ppc64="yes"
|
slouken@1636
|
150 |
configure_x86="yes"
|
slouken@3248
|
151 |
configure_x64="yes"
|
slouken@1636
|
152 |
make_ppc="yes"
|
slouken@3248
|
153 |
make_ppc64="yes"
|
slouken@1636
|
154 |
make_x86="yes"
|
slouken@3248
|
155 |
make_x64="yes"
|
slouken@1636
|
156 |
merge="yes"
|
slouken@1636
|
157 |
;;
|
slouken@1636
|
158 |
configure)
|
slouken@1636
|
159 |
configure_ppc="yes"
|
slouken@3248
|
160 |
configure_ppc64="yes"
|
slouken@1636
|
161 |
configure_x86="yes"
|
slouken@3248
|
162 |
configure_x64="yes"
|
slouken@1636
|
163 |
;;
|
slouken@1636
|
164 |
configure-ppc)
|
slouken@1636
|
165 |
configure_ppc="yes"
|
slouken@1636
|
166 |
;;
|
slouken@3248
|
167 |
configure-ppc64)
|
slouken@3248
|
168 |
configure_ppc64="yes"
|
slouken@3248
|
169 |
;;
|
slouken@1636
|
170 |
configure-x86)
|
slouken@1636
|
171 |
configure_x86="yes"
|
slouken@1636
|
172 |
;;
|
slouken@3248
|
173 |
configure-x64)
|
slouken@3248
|
174 |
configure_x64="yes"
|
slouken@3248
|
175 |
;;
|
slouken@1636
|
176 |
make)
|
slouken@1636
|
177 |
make_ppc="yes"
|
slouken@3248
|
178 |
make_ppc64="yes"
|
slouken@1636
|
179 |
make_x86="yes"
|
slouken@3248
|
180 |
make_x64="yes"
|
slouken@1636
|
181 |
merge="yes"
|
slouken@1636
|
182 |
;;
|
slouken@1636
|
183 |
make-ppc)
|
slouken@1636
|
184 |
make_ppc="yes"
|
slouken@1636
|
185 |
;;
|
slouken@3248
|
186 |
make-ppc64)
|
slouken@3248
|
187 |
make_ppc64="yes"
|
slouken@3248
|
188 |
;;
|
slouken@1636
|
189 |
make-x86)
|
slouken@1636
|
190 |
make_x86="yes"
|
slouken@1636
|
191 |
;;
|
slouken@3248
|
192 |
make-x64)
|
slouken@3248
|
193 |
make_x64="yes"
|
slouken@3248
|
194 |
;;
|
slouken@1636
|
195 |
merge)
|
slouken@1636
|
196 |
merge="yes"
|
slouken@1636
|
197 |
;;
|
slouken@1636
|
198 |
install)
|
slouken@1648
|
199 |
install_bin="yes"
|
slouken@1648
|
200 |
install_hdrs="yes"
|
slouken@1648
|
201 |
install_lib="yes"
|
slouken@1648
|
202 |
install_data="yes"
|
slouken@1648
|
203 |
install_man="yes"
|
slouken@1648
|
204 |
;;
|
slouken@1648
|
205 |
install-bin)
|
slouken@1648
|
206 |
install_bin="yes"
|
slouken@1648
|
207 |
;;
|
slouken@1648
|
208 |
install-hdrs)
|
slouken@1648
|
209 |
install_hdrs="yes"
|
slouken@1648
|
210 |
;;
|
slouken@1648
|
211 |
install-lib)
|
slouken@1648
|
212 |
install_lib="yes"
|
slouken@1648
|
213 |
;;
|
slouken@1648
|
214 |
install-data)
|
slouken@1648
|
215 |
install_data="yes"
|
slouken@1648
|
216 |
;;
|
slouken@1648
|
217 |
install-man)
|
slouken@1648
|
218 |
install_man="yes"
|
slouken@1648
|
219 |
;;
|
icculus@1741
|
220 |
clean)
|
icculus@1741
|
221 |
clean_ppc="yes"
|
slouken@3248
|
222 |
clean_ppc64="yes"
|
icculus@1741
|
223 |
clean_x86="yes"
|
slouken@3248
|
224 |
clean_x64="yes"
|
icculus@1741
|
225 |
;;
|
icculus@1741
|
226 |
clean-ppc)
|
icculus@1741
|
227 |
clean_ppc="yes"
|
icculus@1741
|
228 |
;;
|
slouken@3248
|
229 |
clean-ppc64)
|
slouken@3248
|
230 |
clean_ppc64="yes"
|
slouken@3248
|
231 |
;;
|
icculus@1741
|
232 |
clean-x86)
|
icculus@1741
|
233 |
clean_x86="yes"
|
icculus@1741
|
234 |
;;
|
slouken@3248
|
235 |
clean-x64)
|
slouken@3248
|
236 |
clean_x64="yes"
|
slouken@3248
|
237 |
;;
|
slouken@1648
|
238 |
*)
|
slouken@3248
|
239 |
echo "Usage: $0 [all|configure[-ppc|-ppc64|-x86|-x64]|make[-ppc|-ppc64|-x86|-x64]|merge|install|clean[-ppc|-ppc64|-x86|-x64]]"
|
slouken@1648
|
240 |
exit 1
|
slouken@1648
|
241 |
;;
|
slouken@1648
|
242 |
esac
|
slouken@1648
|
243 |
case `uname -p` in
|
slouken@1648
|
244 |
powerpc)
|
slouken@1648
|
245 |
native_path=ppc
|
slouken@1648
|
246 |
;;
|
slouken@3249
|
247 |
powerpc64)
|
slouken@3249
|
248 |
native_path=ppc64
|
slouken@3249
|
249 |
;;
|
slouken@1648
|
250 |
*86)
|
slouken@1648
|
251 |
native_path=x86
|
slouken@1648
|
252 |
;;
|
slouken@3249
|
253 |
x86_64)
|
slouken@3249
|
254 |
native_path=x64
|
slouken@3249
|
255 |
;;
|
slouken@1648
|
256 |
*)
|
slouken@1648
|
257 |
echo "Couldn't figure out native architecture path"
|
slouken@1648
|
258 |
exit 1
|
slouken@1636
|
259 |
;;
|
slouken@1636
|
260 |
esac
|
slouken@1636
|
261 |
|
slouken@1636
|
262 |
#
|
slouken@1636
|
263 |
# Create the build directories
|
slouken@1636
|
264 |
#
|
slouken@3248
|
265 |
for dir in build build/ppc build/ppc64 build/x86 build/x64; do
|
slouken@1636
|
266 |
if test -d $dir; then
|
slouken@1636
|
267 |
:
|
slouken@1636
|
268 |
else
|
slouken@1636
|
269 |
mkdir $dir || exit 1
|
slouken@1636
|
270 |
fi
|
slouken@1636
|
271 |
done
|
slouken@1636
|
272 |
|
slouken@1636
|
273 |
#
|
slouken@3248
|
274 |
# Build the PowerPC 32-bit binary
|
slouken@1636
|
275 |
#
|
slouken@1636
|
276 |
if test x$configure_ppc = xyes; then
|
slouken@1636
|
277 |
(cd build/ppc && \
|
slouken@1799
|
278 |
sh ../../configure $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $CFLAGS_PPC" CPPFLAGS="$CPPFLAGS_PPC" LDFLAGS="$LFLAGS_PPC") || exit 2
|
slouken@1636
|
279 |
fi
|
slouken@1636
|
280 |
if test x$make_ppc = xyes; then
|
slouken@1742
|
281 |
(cd build/ppc && ls include && make -j$NJOB) || exit 3
|
slouken@1636
|
282 |
fi
|
slouken@1636
|
283 |
|
slouken@1636
|
284 |
#
|
slouken@3248
|
285 |
# Build the PowerPC 64-bit binary
|
slouken@3248
|
286 |
#
|
slouken@3248
|
287 |
if test x$configure_ppc64 = xyes; then
|
slouken@3248
|
288 |
(cd build/ppc64 && \
|
slouken@3248
|
289 |
sh ../../configure $CONFIG_PPC64 CC="$CC_PPC64" CXX="$CXX_PPC64" CFLAGS="$CFLAGS $CFLAGS_PPC64" CPPFLAGS="$CPPFLAGS_PPC64" LDFLAGS="$LFLAGS_PPC64") || exit 2
|
slouken@3248
|
290 |
fi
|
slouken@3248
|
291 |
if test x$make_ppc64 = xyes; then
|
slouken@3248
|
292 |
(cd build/ppc64 && ls include && make -j$NJOB) || exit 3
|
slouken@3248
|
293 |
fi
|
slouken@3248
|
294 |
|
slouken@3248
|
295 |
#
|
slouken@3248
|
296 |
# Build the Intel 32-bit binary
|
slouken@1636
|
297 |
#
|
slouken@1636
|
298 |
if test x$configure_x86 = xyes; then
|
slouken@1636
|
299 |
(cd build/x86 && \
|
slouken@1799
|
300 |
sh ../../configure $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $CFLAGS_X86" CPPFLAGS="$CPPFLAGS_X86" LDFLAGS="$LFLAGS_X86") || exit 2
|
slouken@1636
|
301 |
fi
|
slouken@1636
|
302 |
if test x$make_x86 = xyes; then
|
slouken@1742
|
303 |
(cd build/x86 && make -j$NJOB) || exit 3
|
slouken@1636
|
304 |
fi
|
slouken@1636
|
305 |
|
slouken@1636
|
306 |
#
|
slouken@3248
|
307 |
# Build the Intel 32-bit binary
|
slouken@3248
|
308 |
#
|
slouken@3248
|
309 |
if test x$configure_x64 = xyes; then
|
slouken@3248
|
310 |
(cd build/x64 && \
|
slouken@3248
|
311 |
sh ../../configure $CONFIG_X64 CC="$CC_X64" CXX="$CXX_X64" CFLAGS="$CFLAGS $CFLAGS_X64" CPPFLAGS="$CPPFLAGS_X64" LDFLAGS="$LFLAGS_X64") || exit 2
|
slouken@3248
|
312 |
fi
|
slouken@3248
|
313 |
if test x$make_x64 = xyes; then
|
slouken@3248
|
314 |
(cd build/x64 && make -j$NJOB) || exit 3
|
slouken@3248
|
315 |
fi
|
slouken@3248
|
316 |
|
slouken@3248
|
317 |
#
|
slouken@1636
|
318 |
# Combine into fat binary
|
slouken@1636
|
319 |
#
|
slouken@1636
|
320 |
if test x$merge = xyes; then
|
slouken@1648
|
321 |
output=.libs
|
slouken@1648
|
322 |
sh $auxdir/mkinstalldirs build/$output
|
slouken@1648
|
323 |
cd build
|
slouken@3245
|
324 |
target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
|
slouken@3245
|
325 |
(lipo -create -o $output/$target `find . -mindepth 4 -maxdepth 4 -type f -name "*.dylib"` &&
|
slouken@1648
|
326 |
ln -sf $target $output/libSDL.dylib &&
|
slouken@1648
|
327 |
lipo -create -o $output/libSDL.a */build/.libs/libSDL.a &&
|
slouken@1648
|
328 |
cp $native_path/build/.libs/libSDL.la $output &&
|
slouken@1648
|
329 |
cp $native_path/build/.libs/libSDL.lai $output &&
|
slouken@1648
|
330 |
cp $native_path/build/libSDL.la . &&
|
slouken@1648
|
331 |
lipo -create -o libSDLmain.a */build/libSDLmain.a &&
|
slouken@1636
|
332 |
echo "Build complete!" &&
|
slouken@1636
|
333 |
echo "Files can be found in the build directory.") || exit 4
|
slouken@1648
|
334 |
cd ..
|
slouken@1636
|
335 |
fi
|
slouken@1636
|
336 |
|
slouken@1636
|
337 |
#
|
slouken@1636
|
338 |
# Install
|
slouken@1636
|
339 |
#
|
slouken@1648
|
340 |
do_install()
|
slouken@1648
|
341 |
{
|
slouken@1648
|
342 |
echo $*
|
slouken@1648
|
343 |
$* || exit 5
|
slouken@1648
|
344 |
}
|
slouken@1648
|
345 |
if test x$prefix = x; then
|
slouken@1648
|
346 |
prefix=/usr/local
|
slouken@1648
|
347 |
fi
|
slouken@1648
|
348 |
if test x$exec_prefix = x; then
|
slouken@1648
|
349 |
exec_prefix=$prefix
|
slouken@1648
|
350 |
fi
|
slouken@1648
|
351 |
if test x$bindir = x; then
|
slouken@1648
|
352 |
bindir=$exec_prefix/bin
|
slouken@1648
|
353 |
fi
|
slouken@1648
|
354 |
if test x$libdir = x; then
|
slouken@1648
|
355 |
libdir=$exec_prefix/lib
|
slouken@1648
|
356 |
fi
|
slouken@1648
|
357 |
if test x$includedir = x; then
|
slouken@1648
|
358 |
includedir=$prefix/include
|
slouken@1648
|
359 |
fi
|
slouken@1648
|
360 |
if test x$datadir = x; then
|
slouken@1648
|
361 |
datadir=$prefix/share
|
slouken@1648
|
362 |
fi
|
slouken@1648
|
363 |
if test x$mandir = x; then
|
slouken@1648
|
364 |
mandir=$prefix/man
|
slouken@1636
|
365 |
fi
|
slouken@1648
|
366 |
if test x$install_bin = xyes; then
|
slouken@1648
|
367 |
do_install sh $auxdir/mkinstalldirs $bindir
|
slouken@1648
|
368 |
do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config
|
slouken@1648
|
369 |
fi
|
slouken@1648
|
370 |
if test x$install_hdrs = xyes; then
|
slouken@1648
|
371 |
do_install sh $auxdir/mkinstalldirs $includedir/SDL
|
slouken@1648
|
372 |
for src in $srcdir/include/*.h; do \
|
slouken@1648
|
373 |
file=`echo $src | sed -e 's|^.*/||'`; \
|
slouken@1648
|
374 |
do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \
|
slouken@1648
|
375 |
done
|
slouken@1648
|
376 |
do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h
|
slouken@1648
|
377 |
fi
|
slouken@1648
|
378 |
if test x$install_lib = xyes; then
|
slouken@1648
|
379 |
do_install sh $auxdir/mkinstalldirs $libdir
|
slouken@1648
|
380 |
do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la
|
slouken@1648
|
381 |
do_install /usr/bin/install -c -m 644 build/libSDLmain.a $libdir/libSDLmain.a
|
slouken@1648
|
382 |
do_install ranlib $libdir/libSDLmain.a
|
slouken@1648
|
383 |
fi
|
slouken@1648
|
384 |
if test x$install_data = xyes; then
|
slouken@1648
|
385 |
do_install sh $auxdir/mkinstalldirs $datadir/aclocal
|
slouken@1648
|
386 |
do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4
|
slouken@1648
|
387 |
fi
|
slouken@1648
|
388 |
if test x$install_man = xyes; then
|
slouken@1648
|
389 |
do_install sh $auxdir/mkinstalldirs $mandir/man3
|
slouken@1648
|
390 |
for src in $srcdir/docs/man3/*.3; do \
|
slouken@1648
|
391 |
file=`echo $src | sed -e 's|^.*/||'`; \
|
slouken@1648
|
392 |
do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \
|
slouken@1648
|
393 |
done
|
slouken@1648
|
394 |
fi
|
icculus@1741
|
395 |
|
icculus@1741
|
396 |
#
|
icculus@1741
|
397 |
# Clean up
|
icculus@1741
|
398 |
#
|
icculus@1741
|
399 |
do_clean()
|
icculus@1741
|
400 |
{
|
icculus@1741
|
401 |
echo $*
|
icculus@1741
|
402 |
$* || exit 6
|
icculus@1741
|
403 |
}
|
icculus@1741
|
404 |
if test x$clean_x86 = xyes; then
|
icculus@1741
|
405 |
do_clean rm -r build/x86
|
icculus@1741
|
406 |
fi
|
icculus@1741
|
407 |
if test x$clean_ppc = xyes; then
|
icculus@1741
|
408 |
do_clean rm -r build/ppc
|
icculus@1741
|
409 |
fi
|
icculus@1741
|
410 |
|