Commit | Line | Data |
---|---|---|
de6d9b64 | 1 | #!/bin/sh |
0f3cb305 | 2 | # |
5cbcf02c | 3 | # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard |
0f3cb305 | 4 | # |
cf9d24ad DC |
5 | |
6 | if test x"$1" = x"-h" -o x"$1" = x"--help" ; then | |
7 | cat << EOF | |
8 | ||
9 | Usage: configure [options] | |
10 | Options: [defaults in brackets after descriptions] | |
11 | ||
12 | EOF | |
13 | echo "Standard options:" | |
14 | echo " --help print this message" | |
15 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | |
16 | echo " --mandir=DIR man documentation in DIR [PREFIX/man]" | |
17 | echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]" | |
18 | echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]" | |
19 | echo " --enable-faad enable faad support via libfaad [default=no]" | |
20 | echo " --enable-faadbin build faad support with runtime linking [default=no]" | |
21 | echo " --enable-faac enable faac support via libfaac [default=no]" | |
22 | echo " --enable-mingw32 enable mingw32 native/cross windows compile" | |
23 | echo " --enable-a52 enable GPL'ed A52 support [default=no]" | |
24 | echo " --enable-a52bin open liba52.so.0 at runtime [default=no]" | |
25 | echo " --enable-pp enable GPL'ed post processing support [default=no]" | |
26 | echo " --enable-shared-pp use libpostproc.so [default=no]" | |
27 | echo " --enable-shared build shared libraries [default=no]" | |
28 | echo " --enable-amr_nb enable amr_nb float audio codec" | |
29 | echo " --enable-amr_nb-fixed use fixed point for amr-nb codec" | |
64cba748 | 30 | echo " --enable-amr_wb enable amr_wb float audio codec" |
cf9d24ad | 31 | echo " --enable-sunmlib use Sun medialib [default=no]" |
9c3d33d6 | 32 | echo " --enable-pthreads use pthreads [default=no]" |
cf9d24ad DC |
33 | echo "" |
34 | echo "Advanced options (experts only):" | |
35 | echo " --source-path=PATH path of source code [$source_path]" | |
36 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | |
37 | echo " --cc=CC use C compiler CC [$cc]" | |
38 | echo " --make=MAKE use specified make [$make]" | |
39 | echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]" | |
40 | echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]" | |
41 | echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" | |
42 | echo " --cpu=CPU force cpu to CPU [$cpu]" | |
43 | echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)" | |
44 | echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)" | |
45 | echo " --disable-mmx disable mmx usage" | |
46 | echo " --disable-altivec disable AltiVec usage" | |
47 | echo " --disable-audio-oss disable OSS audio support [default=no]" | |
48 | echo " --disable-audio-beos disable BeOS audio support [default=no]" | |
49 | echo " --disable-v4l disable video4linux grabbing [default=no]" | |
50 | echo " --disable-dv1394 disable DV1394 grabbing [default=no]" | |
51 | echo " --disable-network disable network support [default=no]" | |
52 | echo " --disable-zlib disable zlib [default=no]" | |
53 | echo " --disable-simple_idct disable simple IDCT routines [default=no]" | |
54 | echo " --disable-vhook disable video hooking support" | |
55 | echo " --enable-gprof enable profiling with gprof [$gprof]" | |
56 | echo " --disable-debug disable debugging symbols" | |
57 | echo " --disable-opts disable compiler optimizations" | |
58 | echo " --disable-mpegaudio-hp faster (but less accurate)" | |
59 | echo " mpegaudio decoding [default=no]" | |
60 | echo " --disable-ffserver disable ffserver build" | |
61 | echo " --disable-ffplay disable ffplay build" | |
62 | echo " --disable-risky disables patent encumbered codecs" | |
63 | echo " --enable-small optimize for size instead of speed" | |
64 | echo "" | |
65 | echo "NOTE: The object files are build at the place where configure is launched" | |
66 | exit 1 | |
67 | fi | |
68 | ||
0f3cb305 | 69 | # set temporary file name |
57514323 | 70 | if test ! -z "$TMPDIR" ; then |
0f3cb305 | 71 | TMPDIR1="${TMPDIR}" |
57514323 | 72 | elif test ! -z "$TEMPDIR" ; then |
0f3cb305 | 73 | TMPDIR1="${TEMPDIR}" |
3d204385 | 74 | else |
0f3cb305 | 75 | TMPDIR1="/tmp" |
3d204385 NK |
76 | fi |
77 | ||
0f3cb305 FB |
78 | TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c" |
79 | TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o" | |
f3ec2d46 | 80 | TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}" |
0f3cb305 FB |
81 | TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S" |
82 | TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h" | |
83 | ||
de6d9b64 FB |
84 | # default parameters |
85 | prefix="/usr/local" | |
23a65308 | 86 | mandir="" |
951bf3e6 | 87 | bindir="" |
0f3cb305 | 88 | cross_prefix="" |
de6d9b64 FB |
89 | cc="gcc" |
90 | ar="ar" | |
be7109c1 | 91 | ranlib="ranlib" |
4a908fbc | 92 | make="make" |
0f3cb305 | 93 | strip="strip" |
de6d9b64 | 94 | cpu=`uname -m` |
a4adb608 | 95 | tune="generic" |
e45a2872 | 96 | powerpc_perf="no" |
0f3cb305 | 97 | mmx="default" |
ab6c65f6 | 98 | altivec="default" |
d46aba26 | 99 | mmi="default" |
de6d9b64 | 100 | case "$cpu" in |
ef0bc4c9 | 101 | i386|i486|i586|i686|i86pc|BePC) |
de6d9b64 | 102 | cpu="x86" |
de6d9b64 | 103 | ;; |
93caefc7 AB |
104 | # armv4l is a subset of armv5tel |
105 | armv4l|armv5tel) | |
6ed7422a | 106 | cpu="armv4l" |
6ed7422a | 107 | ;; |
91d1f1a4 NK |
108 | alpha) |
109 | cpu="alpha" | |
91d1f1a4 | 110 | ;; |
a43bd1d7 | 111 | "Power Macintosh"|ppc) |
90cee0c3 MN |
112 | cpu="powerpc" |
113 | ;; | |
d46aba26 LS |
114 | mips) |
115 | cpu="mips" | |
116 | ;; | |
a7beab73 RS |
117 | sun4u) |
118 | cpu="sparc64" | |
119 | ;; | |
bdb2e37c AB |
120 | sh4) |
121 | cpu="sh4" | |
122 | ;; | |
de6d9b64 | 123 | *) |
0f3cb305 | 124 | cpu="unknown" |
de6d9b64 FB |
125 | ;; |
126 | esac | |
127 | gprof="no" | |
5cbcf02c FB |
128 | v4l="yes" |
129 | audio_oss="yes" | |
dfdfa47c | 130 | audio_beos="no" |
8aa3ee32 | 131 | dv1394="yes" |
5cbcf02c | 132 | network="yes" |
0147f198 | 133 | zlib="yes" |
a6741398 | 134 | mp3lame="no" |
81e0d0b4 | 135 | vorbis="no" |
0fc50e58 ZK |
136 | faad="no" |
137 | faadbin="no" | |
29d48296 | 138 | faac="no" |
ba9261e5 | 139 | a52="no" |
57514323 | 140 | a52bin="no" |
ba9261e5 | 141 | pp="no" |
bba9b16c | 142 | shared_pp="no" |
732d9245 | 143 | mingw32="no" |
3f027ca7 | 144 | cygwin="no" |
f3ec2d46 | 145 | os2="no" |
83286d2a | 146 | lshared="no" |
cddf3f45 GM |
147 | optimize="yes" |
148 | debug="yes" | |
ef0bc4c9 | 149 | extralibs="-lm" |
c02dbee1 | 150 | simpleidct="yes" |
0f3cb305 | 151 | bigendian="no" |
7f965c1c | 152 | inttypes="yes" |
b5c950c4 | 153 | emu_fast_int="no" |
a8721c09 | 154 | vhook="default" |
adbc0510 PG |
155 | dlfcn="no" |
156 | dlopen="no" | |
1eb2212e | 157 | mpegaudio_hp="yes" |
e1707f52 | 158 | SHFLAGS=-shared |
26b35efb | 159 | netserver="no" |
4baca069 | 160 | need_inet_aton="no" |
8154d2e0 | 161 | ffserver="yes" |
a86b921c | 162 | ffplay="yes" |
4baca069 PG |
163 | LDFLAGS=-Wl,--warn-common |
164 | FFSLDFLAGS=-Wl,-E | |
f3ec2d46 SG |
165 | LIBPREF="lib" |
166 | LIBSUF=".a" | |
167 | SLIBPREF="lib" | |
168 | SLIBSUF=".so" | |
951bf3e6 | 169 | EXESUF="" |
1d0d55da | 170 | risky="yes" |
891f64b3 | 171 | amr_nb="no" |
d663a1fd | 172 | amr_wb="no" |
bc634f6f | 173 | amr_nb_fixed="no" |
f80f7964 | 174 | sunmlib="no" |
9c3d33d6 | 175 | pthreads="no" |
ef0bc4c9 FR |
176 | |
177 | # OS specific | |
178 | targetos=`uname -s` | |
179 | case $targetos in | |
180 | BeOS) | |
181 | prefix="/boot/home/config" | |
182 | # helps building libavcodec | |
cddf3f45 | 183 | CFLAGS="-DPIC -fomit-frame-pointer" |
31ba0b4d | 184 | # 3 gcc releases known for BeOS, each with ugly bugs |
b2924696 | 185 | gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" |
31ba0b4d FR |
186 | case "$gcc_version" in |
187 | 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc" | |
188 | mmx="no" | |
189 | ;; | |
190 | *20010315*) echo "BeBits gcc" | |
191 | CFLAGS="$CFLAGS -fno-expensive-optimizations" | |
192 | ;; | |
193 | esac | |
e1707f52 MN |
194 | SHFLAGS=-nostart |
195 | # disable linux things | |
196 | audio_oss="no" | |
5cbcf02c | 197 | v4l="no" |
8aa3ee32 | 198 | dv1394="no" |
dfdfa47c FR |
199 | # enable beos things |
200 | audio_beos="yes" | |
ef0bc4c9 FR |
201 | # no need for libm, but the inet stuff |
202 | # Check for BONE | |
203 | if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then | |
204 | extralibs="-lbind -lsocket" | |
205 | else | |
26b35efb | 206 | netserver="yes" |
4baca069 | 207 | need_inet_aton="yes" |
26b35efb | 208 | extralibs="-lnet" |
ef0bc4c9 | 209 | fi ;; |
4baca069 PG |
210 | SunOS) |
211 | v4l="no" | |
212 | audio_oss="no" | |
8aa3ee32 | 213 | dv1394="no" |
4baca069 PG |
214 | make="gmake" |
215 | LDFLAGS="" | |
216 | FFSLDFLAGS="" | |
217 | need_inet_aton="yes" | |
218 | extralibs="$extralibs -lsocket -lnsl" | |
219 | ;; | |
9c938e77 PG |
220 | FreeBSD) |
221 | v4l="no" | |
222 | audio_oss="yes" | |
8aa3ee32 | 223 | dv1394="no" |
9c938e77 | 224 | make="gmake" |
4baca069 | 225 | LDFLAGS="$LDFLAGS -export-dynamic" |
9c938e77 | 226 | ;; |
4a908fbc | 227 | BSD/OS) |
5cbcf02c | 228 | v4l="no" |
6063bce7 | 229 | audio_oss="yes" |
8aa3ee32 | 230 | dv1394="no" |
4a908fbc AB |
231 | extralibs="-lpoll -lgnugetopt -lm" |
232 | make="gmake" | |
233 | ;; | |
90cee0c3 | 234 | Darwin) |
a43bd1d7 | 235 | cc="cc" |
90cee0c3 MN |
236 | v4l="no" |
237 | audio_oss="no" | |
8aa3ee32 | 238 | dv1394="no" |
d3b15036 | 239 | ffserver="no" |
a43bd1d7 | 240 | SHFLAGS="-dynamiclib" |
90cee0c3 | 241 | extralibs="" |
a43bd1d7 | 242 | darwin="yes" |
47930f09 | 243 | strip="strip -x" |
4850b2d2 | 244 | LDFLAGS="-Wl,-d" |
4baca069 | 245 | FFSLDFLAGS=-Wl,-bind_at_load |
90cee0c3 | 246 | ;; |
732d9245 | 247 | MINGW32*) |
951bf3e6 FB |
248 | # Note: the rest of the mingw32 config is done afterwards as mingw32 |
249 | # can be forced on command line for linux cross compilation | |
732d9245 BE |
250 | mingw32="yes" |
251 | ;; | |
3f027ca7 FB |
252 | CYGWIN*) |
253 | v4l="no" | |
254 | audio_oss="yes" | |
8aa3ee32 | 255 | dv1394="no" |
3f027ca7 FB |
256 | extralibs="" |
257 | cygwin="yes" | |
258 | test -f /usr/include/inttypes.h || \ | |
259 | test -f /usr/local/include/inttypes.h || \ | |
260 | echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \ | |
261 | "/usr/include/inttypes.h !!!" | |
262 | ;; | |
b55e4ef4 | 263 | Linux) |
4baca069 | 264 | LDFLAGS="$LDFLAGS -rdynamic" |
b55e4ef4 | 265 | ;; |
99614dd4 MB |
266 | IRIX*) |
267 | ranlib="echo ignoring ranlib" | |
268 | v4l="no" | |
269 | audio_oss="no" | |
270 | make="gmake" | |
271 | ;; | |
f3ec2d46 SG |
272 | OS/2) |
273 | TMPE=$TMPE".exe" | |
69db4e10 SG |
274 | ar="emxomfar -p64" |
275 | ranlib="echo ignoring ranlib" | |
276 | strip="echo ignoring strip" | |
cddf3f45 | 277 | CFLAGS="-Zomf" |
69db4e10 | 278 | LDFLAGS="-Zomf -Zstack 16384 -s" |
f3ec2d46 SG |
279 | SHFLAGS="" |
280 | FFSLDFLAGS="" | |
281 | LIBPREF="" | |
282 | LIBSUF=".lib" | |
283 | SLIBPREF="" | |
284 | SLIBSUF=".dll" | |
951bf3e6 | 285 | EXESUF=".exe" |
f3ec2d46 SG |
286 | extralibs="" |
287 | v4l="no" | |
288 | audio_oss="no" | |
8aa3ee32 | 289 | dv1394="no" |
f3ec2d46 SG |
290 | network="no" |
291 | ffserver="no" | |
292 | os2="yes" | |
293 | ;; | |
ef0bc4c9 FR |
294 | *) ;; |
295 | esac | |
de6d9b64 | 296 | |
6852ac95 RD |
297 | # From mplayer configure. We need TARGET_OS available |
298 | # to the Makefile, so it can distinguish between flavors | |
299 | # of AltiVec on PowerPC | |
300 | TARGET_OS=`( uname -s ) 2>&1` | |
301 | case "$TARGET_OS" in | |
302 | Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU) | |
303 | ;; | |
304 | IRIX*) | |
305 | TARGET_OS=IRIX | |
306 | ;; | |
307 | HP-UX*) | |
308 | TARGET_OS=HP-UX | |
309 | ;; | |
310 | [cC][yY][gG][wW][iI][nN]*) | |
311 | TARGET_OS=CYGWIN | |
312 | ;; | |
313 | *) | |
314 | TARGET_OS="$TARGET_OS-UNKNOWN" | |
315 | ;; | |
316 | esac | |
317 | ||
0f3cb305 FB |
318 | # find source path |
319 | # XXX: we assume an absolute path is given when launching configure, | |
320 | # except in './configure' case. | |
586bc755 | 321 | source_path="`echo $0 | sed -e 's#/configure##'`" |
0f3cb305 FB |
322 | source_path_used="yes" |
323 | if test -z "$source_path" -o "$source_path" = "." ; then | |
324 | source_path=`pwd` | |
325 | source_path_used="no" | |
de6d9b64 FB |
326 | fi |
327 | ||
328 | for opt do | |
329 | case "$opt" in | |
330 | --prefix=*) prefix=`echo $opt | cut -d '=' -f 2` | |
331 | ;; | |
23a65308 FB |
332 | --mandir=*) mandir=`echo $opt | cut -d '=' -f 2` |
333 | ;; | |
0f3cb305 FB |
334 | --source-path=*) source_path=`echo $opt | cut -d '=' -f 2` |
335 | ;; | |
336 | --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` | |
337 | ;; | |
de6d9b64 FB |
338 | --cc=*) cc=`echo $opt | cut -d '=' -f 2` |
339 | ;; | |
4a908fbc AB |
340 | --make=*) make=`echo $opt | cut -d '=' -f 2` |
341 | ;; | |
0f3cb305 FB |
342 | --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" |
343 | ;; | |
344 | --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=} | |
345 | ;; | |
346 | --extra-libs=*) extralibs=${opt#--extra-libs=} | |
347 | ;; | |
de6d9b64 FB |
348 | --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` |
349 | ;; | |
a4adb608 MN |
350 | --tune=*) tune=`echo $opt | cut -d '=' -f 2` |
351 | ;; | |
e45a2872 RD |
352 | --powerpc-perf-enable) powerpc_perf="yes" |
353 | ;; | |
de6d9b64 FB |
354 | --disable-mmx) mmx="no" |
355 | ;; | |
ab6c65f6 BF |
356 | --disable-altivec) altivec="no" |
357 | ;; | |
de6d9b64 FB |
358 | --enable-gprof) gprof="yes" |
359 | ;; | |
5cbcf02c FB |
360 | --disable-v4l) v4l="no" |
361 | ;; | |
362 | --disable-audio-oss) audio_oss="no" | |
363 | ;; | |
dfdfa47c FR |
364 | --disable-audio-beos) audio_beos="no" |
365 | ;; | |
8aa3ee32 MK |
366 | --disable-dv1394) dv1394="no" |
367 | ;; | |
5cbcf02c FB |
368 | --disable-network) network="no" |
369 | ;; | |
0147f198 FR |
370 | --disable-zlib) zlib="no" |
371 | ;; | |
ba9261e5 | 372 | --enable-a52) a52="yes" |
6ed7422a | 373 | ;; |
9c938e77 | 374 | --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs" |
57514323 | 375 | ;; |
ba9261e5 | 376 | --enable-pp) pp="yes" |
bba9b16c MN |
377 | ;; |
378 | --enable-shared-pp) shared_pp="yes" | |
379 | ;; | |
a6741398 J |
380 | --enable-mp3lame) mp3lame="yes" |
381 | ;; | |
81e0d0b4 MH |
382 | --enable-vorbis) vorbis="yes" |
383 | ;; | |
445ad18d ZK |
384 | --enable-faad) faad="yes" |
385 | ;; | |
386 | --enable-faadbin) faadbin="yes" | |
387 | ;; | |
29d48296 MN |
388 | --enable-faac) faac="yes" |
389 | ;; | |
68892110 PG |
390 | --disable-vhook) vhook="no" |
391 | ;; | |
c02dbee1 | 392 | --disable-simple_idct) simpleidct="no" |
045ed63f | 393 | ;; |
732d9245 BE |
394 | --enable-mingw32) mingw32="yes" |
395 | ;; | |
83286d2a | 396 | --enable-shared) lshared="yes" |
0319c531 | 397 | ;; |
cddf3f45 GM |
398 | --disable-debug) debug="no" |
399 | ;; | |
400 | --disable-opts) optimize="no" | |
401 | ;; | |
1eb2212e FB |
402 | --disable-mpegaudio-hp) mpegaudio_hp="no" |
403 | ;; | |
8154d2e0 FB |
404 | --disable-ffserver) ffserver="no" |
405 | ;; | |
a86b921c FB |
406 | --disable-ffplay) ffplay="no" |
407 | ;; | |
1d0d55da MN |
408 | --disable-risky) risky="no" |
409 | ;; | |
cddf3f45 | 410 | --enable-small) optimize="small" |
553a6284 | 411 | ;; |
891f64b3 | 412 | --enable-amr_nb) amr_nb="yes" |
413 | ;; | |
bc634f6f ZK |
414 | --enable-amr_nb-fixed) amr_nb_fixed="yes" |
415 | ;; | |
64cba748 MN |
416 | --enable-amr_wb) amr_wb="yes" |
417 | ;; | |
f80f7964 RS |
418 | --enable-sunmlib) sunmlib="yes" |
419 | ;; | |
9c3d33d6 MN |
420 | --enable-pthreads) pthreads="yes" |
421 | ;; | |
de6d9b64 FB |
422 | esac |
423 | done | |
424 | ||
0f3cb305 FB |
425 | # compute mmx state |
426 | if test $mmx = "default"; then | |
427 | if test $cpu = "x86"; then | |
428 | mmx="yes" | |
429 | else | |
430 | mmx="no" | |
431 | fi | |
432 | fi | |
433 | ||
cf9d24ad | 434 | #Darwin CC versions |
75388c74 | 435 | needmdynamicnopic="no" |
cf9d24ad | 436 | if test $targetos = Darwin; then |
b2924696 | 437 | if test -n "`$cc -v 2>&1 | grep xlc`"; then |
747a0554 | 438 | CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto" |
cf9d24ad | 439 | else |
b2924696 | 440 | gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" |
cf9d24ad DC |
441 | case "$gcc_version" in |
442 | *2.95*) | |
747a0554 | 443 | CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer" |
cf9d24ad | 444 | ;; |
75388c74 | 445 | *3.*) |
747a0554 | 446 | CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare" |
75388c74 MN |
447 | if test "$lshared" = no; then |
448 | needmdynamicnopic="yes" | |
449 | fi | |
cf9d24ad DC |
450 | ;; |
451 | *) | |
747a0554 | 452 | CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer" |
75388c74 MN |
453 | if test "$lshared" = no; then |
454 | needmdynamicnopic="yes" | |
455 | fi | |
cf9d24ad DC |
456 | ;; |
457 | esac | |
458 | fi | |
459 | fi | |
460 | ||
ab6c65f6 BF |
461 | # Can only do AltiVec on PowerPC |
462 | if test $altivec = "default"; then | |
463 | if test $cpu = "powerpc"; then | |
464 | altivec="yes" | |
465 | else | |
466 | altivec="no" | |
467 | fi | |
468 | fi | |
469 | ||
a4adb608 MN |
470 | # Add processor-specific flags |
471 | TUNECPU="generic" | |
472 | if test $tune != "generic"; then | |
473 | case $tune in | |
474 | 601|ppc601|PowerPC601) | |
475 | CFLAGS="$CFLAGS -mcpu=601" | |
476 | if test $altivec = "yes"; then | |
477 | echo "WARNING: tuning for PPC601 but altivec enabled !"; | |
478 | fi | |
479 | TUNECPU=ppc601 | |
480 | ;; | |
481 | 603*|ppc603*|PowerPC603*) | |
482 | CFLAGS="$CFLAGS -mcpu=603" | |
483 | if test $altivec = "yes"; then | |
484 | echo "WARNING: tuning for PPC603 but altivec enabled !"; | |
485 | fi | |
486 | TUNECPU=ppc603 | |
487 | ;; | |
488 | 604*|ppc604*|PowerPC604*) | |
489 | CFLAGS="$CFLAGS -mcpu=604" | |
490 | if test $altivec = "yes"; then | |
491 | echo "WARNING: tuning for PPC604 but altivec enabled !"; | |
492 | fi | |
493 | TUNECPU=ppc604 | |
494 | ;; | |
8d6625b6 | 495 | G3|g3|75*|ppc75*|PowerPC75*) |
fe0f2a97 | 496 | CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt" |
a4adb608 MN |
497 | if test $altivec = "yes"; then |
498 | echo "WARNING: tuning for PPC75x but altivec enabled !"; | |
499 | fi | |
500 | TUNECPU=ppc750 | |
501 | ;; | |
8d6625b6 | 502 | G4|g4|745*|ppc745*|PowerPC745*) |
fe0f2a97 | 503 | CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt" |
3efd4952 RD |
504 | if test $altivec = "no"; then |
505 | echo "WARNING: tuning for PPC745x but altivec disabled !"; | |
506 | fi | |
507 | TUNECPU=ppc7450 | |
508 | ;; | |
509 | 74*|ppc74*|PowerPC74*) | |
fe0f2a97 | 510 | CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt" |
a4adb608 MN |
511 | if test $altivec = "no"; then |
512 | echo "WARNING: tuning for PPC74xx but altivec disabled !"; | |
513 | fi | |
e45a2872 | 514 | TUNECPU=ppc7400 |
a4adb608 | 515 | ;; |
8d6625b6 | 516 | G5|g5|970|ppc970|PowerPC970|power4*|Power4*) |
a4adb608 MN |
517 | CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL " |
518 | if test $altivec = "no"; then | |
519 | echo "WARNING: tuning for PPC970 but altivec disabled !"; | |
520 | fi | |
521 | TUNECPU=ppc970 | |
522 | ;; | |
523 | *) | |
524 | echo "WARNING: unknown CPU "$tune", ignored" | |
525 | ;; | |
526 | esac | |
527 | fi | |
528 | ||
cf9d24ad | 529 | # AltiVec flags: The FSF version of GCC differs from the Apple version |
b6e52719 MD |
530 | if test $cpu = "powerpc"; then |
531 | if test $altivec = "yes"; then | |
b2924696 | 532 | if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then |
b6e52719 MD |
533 | CFLAGS="$CFLAGS -faltivec" |
534 | else | |
535 | CFLAGS="$CFLAGS -maltivec -mabi=altivec" | |
536 | fi | |
537 | fi | |
538 | fi | |
539 | ||
a9a07762 MN |
540 | # See if we have <altivec.h> |
541 | cat > $TMPC << EOF | |
542 | #include <altivec.h> | |
543 | int main( void ) { return 0; } | |
544 | EOF | |
545 | ||
546 | _altivec_h="no" | |
b6e52719 | 547 | if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
a9a07762 MN |
548 | _altivec_h="yes" |
549 | fi | |
550 | ||
ab6c65f6 BF |
551 | # See does our compiler support Motorola AltiVec C API |
552 | if test $altivec = "yes"; then | |
a9a07762 | 553 | if test $_altivec_h = "yes"; then |
ab6c65f6 | 554 | cat > $TMPC << EOF |
a9a07762 | 555 | #include <altivec.h> |
ab6c65f6 BF |
556 | int main(void) { |
557 | vector signed int v1, v2, v3; | |
558 | v1 = vec_add(v2,v3); | |
559 | return 0; | |
560 | } | |
561 | EOF | |
a9a07762 MN |
562 | else |
563 | cat > $TMPC << EOF | |
564 | int main(void) { | |
565 | vector signed int v1, v2, v3; | |
566 | v1 = vec_add(v2,v3); | |
567 | return 0; | |
568 | } | |
569 | EOF | |
570 | fi | |
b6e52719 | 571 | $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no" |
ab6c65f6 BF |
572 | fi |
573 | ||
d46aba26 LS |
574 | # Can only do mmi on mips |
575 | if test $mmi = "default"; then | |
576 | if test $cpu = "mips"; then | |
577 | mmi="yes" | |
578 | else | |
579 | mmi="no" | |
580 | fi | |
581 | fi | |
582 | ||
583 | # See does our compiler support mmi | |
584 | if test $mmi = "yes"; then | |
585 | cat > $TMPC << EOF | |
586 | int main(void) { | |
587 | __asm__ ("lq \$2, 0(\$2)"); | |
588 | return 0; | |
589 | } | |
590 | EOF | |
f3ec2d46 | 591 | $cc -o $TMPE $TMPC 2> /dev/null || mmi="no" |
d46aba26 LS |
592 | fi |
593 | ||
732d9245 | 594 | if test "$mingw32" = "yes" ; then |
732d9245 BE |
595 | v4l="no" |
596 | audio_oss="no" | |
8aa3ee32 | 597 | dv1394="no" |
951bf3e6 | 598 | ffserver="no" |
732d9245 | 599 | network="no" |
951bf3e6 FB |
600 | LIBPREF="" |
601 | LIBSUF=".lib" | |
602 | SLIBPREF="" | |
603 | SLIBSUF=".dll" | |
604 | EXESUF=".exe" | |
605 | prefix="/c/Program Files/FFmpeg" | |
606 | bindir="$prefix" | |
732d9245 BE |
607 | fi |
608 | ||
0f3cb305 FB |
609 | cc="${cross_prefix}${cc}" |
610 | ar="${cross_prefix}${ar}" | |
be7109c1 | 611 | ranlib="${cross_prefix}${ranlib}" |
0f3cb305 FB |
612 | strip="${cross_prefix}${strip}" |
613 | ||
487a54d7 FB |
614 | if test -z "$cross_prefix" ; then |
615 | ||
3d204385 | 616 | # --- |
a3999908 MN |
617 | # big/little endian test |
618 | cat > $TMPC << EOF | |
619 | #include <inttypes.h> | |
620 | int main(int argc, char ** argv){ | |
621 | volatile uint32_t i=0x01234567; | |
622 | return (*((uint8_t*)(&i))) == 0x67; | |
623 | } | |
624 | EOF | |
625 | ||
f3ec2d46 SG |
626 | if $cc -o $TMPE $TMPC 2>/dev/null ; then |
627 | $TMPE && bigendian="yes" | |
a3999908 MN |
628 | else |
629 | echo big/little test failed | |
630 | fi | |
631 | ||
487a54d7 FB |
632 | else |
633 | ||
634 | # if cross compiling, cannot launch a program, so make a static guess | |
635 | if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then | |
636 | bigendian="yes" | |
637 | fi | |
638 | ||
639 | fi | |
640 | ||
a3999908 | 641 | # --- |
7f965c1c CF |
642 | # *inttypes.h* test |
643 | cat > $TMPC << EOF | |
644 | #include <inttypes.h> | |
645 | int main(int argc, char ** argv){ | |
646 | return 0; | |
647 | } | |
648 | EOF | |
649 | ||
650 | $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no" | |
651 | ||
652 | # --- | |
b5c950c4 MN |
653 | # *int_fast* test |
654 | cat > $TMPC << EOF | |
655 | #include <inttypes.h> | |
656 | int main(int argc, char ** argv){ | |
657 | volatile uint_fast64_t i=0x01234567; | |
658 | return 0; | |
659 | } | |
660 | EOF | |
661 | ||
662 | $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes" | |
663 | ||
664 | # --- | |
3d204385 NK |
665 | # check availability of some header files |
666 | ||
667 | cat > $TMPC << EOF | |
668 | #include <malloc.h> | |
669 | int main( void ) { return 0; } | |
670 | EOF | |
671 | ||
672 | _memalign=no | |
673 | _malloc_h=no | |
f3ec2d46 | 674 | if $cc -o $TMPE $TMPC 2> /dev/null ; then |
3d204385 NK |
675 | _malloc_h=yes |
676 | _memalign=yes | |
677 | # check for memalign - atmos | |
678 | cat > $TMPC << EOF | |
679 | #include <malloc.h> | |
680 | int main ( void ) { | |
681 | char *string = NULL; | |
682 | string = memalign(64, sizeof(char)); | |
683 | return 0; | |
684 | } | |
685 | EOF | |
f3ec2d46 | 686 | $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no |
3d204385 NK |
687 | fi |
688 | ||
68892110 | 689 | cat > $TMPC << EOF |
5e4639e2 GM |
690 | #include <time.h> |
691 | int main( void ) { localtime_r(NULL, NULL); } | |
692 | EOF | |
693 | ||
694 | localtime_r=no | |
695 | if $cc -o $TMPE $TMPC 2> /dev/null ; then | |
696 | localtime_r=yes | |
697 | fi | |
698 | ||
0147f198 FR |
699 | if test "$zlib" = "yes"; then |
700 | # check for zlib - mmu_man | |
701 | cat > $TMPC << EOF | |
702 | #include <zlib.h> | |
703 | int main ( void ) { | |
704 | if (zlibVersion() != ZLIB_VERSION) | |
705 | puts("zlib version differs !!!"); | |
706 | return 1; | |
707 | return 0; | |
708 | } | |
709 | EOF | |
16806499 | 710 | $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no" |
f3ec2d46 | 711 | # $TMPE 2> /dev/null > /dev/null || zlib="no" |
0147f198 FR |
712 | # XXX: more tests needed - runtime test |
713 | fi | |
714 | if test "$zlib" = "yes"; then | |
715 | extralibs="$extralibs -lz" | |
716 | fi | |
717 | ||
95e2ce4a MN |
718 | # test for lrintf in math.h |
719 | cat > $TMPC << EOF | |
720 | #define _ISOC9X_SOURCE 1 | |
721 | #include <math.h> | |
722 | int main( void ) { return (lrintf(3.999f) > 0)?0:1; } | |
723 | EOF | |
724 | ||
725 | have_lrintf="no" | |
f3ec2d46 | 726 | if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then |
95e2ce4a | 727 | have_lrintf="yes" |
f3ec2d46 | 728 | $TMPE 2> /dev/null > /dev/null || have_lrintf="no" |
95e2ce4a MN |
729 | fi |
730 | ||
c13e1abd FH |
731 | _restrict= |
732 | for restrict_keyword in restrict __restrict__ __restrict; do | |
733 | echo "void foo(char * $restrict_keyword p);" > $TMPC | |
734 | if $cc -c -o $TMPO $TMPC 2> /dev/null; then | |
735 | _restrict=$restrict_keyword | |
736 | break; | |
737 | fi | |
738 | done | |
739 | ||
52b41d7f FB |
740 | # test gcc version to see if vector builtins can be used |
741 | # currently only used on i386 for MMX builtins | |
742 | cat > $TMPC << EOF | |
743 | int main(void) { | |
744 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) | |
745 | return 0; | |
746 | #else | |
747 | #error no vector builtins | |
748 | #endif | |
749 | } | |
750 | EOF | |
751 | ||
752 | builtin_vector=no | |
753 | if $cc -o $TMPO $TMPC 2> /dev/null ; then | |
754 | builtin_vector=yes | |
a8721c09 FB |
755 | fi |
756 | ||
757 | # dlopen/dlfcn.h probing | |
758 | ||
759 | cat > $TMPC << EOF | |
760 | #include <dlfcn.h> | |
761 | int main( void ) { return (int) dlopen("foo", 0); } | |
762 | EOF | |
763 | ||
764 | ldl=-ldl | |
765 | ||
cf9d24ad | 766 | if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then |
a8721c09 FB |
767 | dlfcn=yes |
768 | dlopen=yes | |
769 | fi | |
770 | ||
cf9d24ad | 771 | if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then |
a8721c09 FB |
772 | dlfcn=yes |
773 | dlopen=yes | |
774 | ldl="" | |
775 | fi | |
776 | ||
777 | cat > $TMPC << EOF | |
778 | int main( void ) { return (int) dlopen("foo", 0); } | |
779 | EOF | |
780 | ||
cf9d24ad | 781 | if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then |
a8721c09 FB |
782 | dlopen=yes |
783 | fi | |
784 | ||
cf9d24ad | 785 | if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then |
a8721c09 FB |
786 | dlopen=yes |
787 | ldl="" | |
788 | fi | |
789 | ||
790 | if test "$vhook" = "default" ; then | |
791 | vhook="$dlopen" | |
792 | fi | |
793 | ||
a86b921c FB |
794 | ########################################## |
795 | # imlib probe | |
796 | ||
a8721c09 FB |
797 | cat > $TMPC << EOF |
798 | #include <X11/Xlib.h> | |
799 | #include <Imlib2.h> | |
800 | int main( void ) { return (int) imlib_load_font("foo"); } | |
801 | EOF | |
802 | ||
803 | imlib2=no | |
cf9d24ad | 804 | if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then |
a8721c09 | 805 | imlib2=yes |
52b41d7f FB |
806 | fi |
807 | ||
a86b921c FB |
808 | ########################################## |
809 | # freetype probe | |
810 | ||
04511d53 PG |
811 | cat > $TMPC << EOF |
812 | #include <ft2build.h> | |
813 | int main( void ) { return (int) FT_Init_FreeType(0); } | |
814 | EOF | |
815 | ||
816 | freetype2=no | |
69db4e10 | 817 | if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then |
6e023978 | 818 | if test "`which freetype-config`" != ""; then |
cf9d24ad | 819 | if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then |
dee076fc | 820 | freetype2=yes |
04511d53 | 821 | fi |
dee076fc | 822 | fi |
04511d53 PG |
823 | fi |
824 | ||
a86b921c FB |
825 | ########################################## |
826 | # SDL probe | |
827 | ||
828 | cat > $TMPC << EOF | |
829 | #include <SDL.h> | |
31319a8c | 830 | #undef main /* We don't want SDL to override our main() */ |
a86b921c FB |
831 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
832 | EOF | |
833 | ||
834 | sdl_too_old=no | |
835 | sdl=no | |
cf9d24ad | 836 | if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then |
a86b921c FB |
837 | _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'` |
838 | if test "$_sdlversion" -lt 121 ; then | |
839 | sdl_too_old=yes | |
840 | else | |
841 | sdl=yes | |
842 | fi | |
843 | fi | |
844 | ||
b2924696 | 845 | case "`$cc -v 2>&1 | grep version`" in |
cf9d24ad DC |
846 | *gcc*) |
847 | CFLAGS="-Wall $CFLAGS" | |
848 | ;; | |
849 | *) | |
850 | ;; | |
851 | esac | |
852 | ||
94a3401e FB |
853 | if test "$sdl" = "no" ; then |
854 | ffplay=no | |
855 | fi | |
856 | ||
cddf3f45 | 857 | if test "$debug" = "yes"; then |
7906085f | 858 | CFLAGS="-g $CFLAGS" |
cddf3f45 GM |
859 | fi |
860 | ||
861 | if test "$optimize" = "small"; then | |
98ca7790 | 862 | # CFLAGS=${CFLAGS//-O3/-Os} |
553a6284 MN |
863 | CFLAGS="$CFLAGS -Os" |
864 | fi | |
865 | ||
cddf3f45 | 866 | if test "$optimize" = "yes"; then |
b2924696 | 867 | if test -n "`$cc -v 2>&1 | grep xlc`"; then |
cf9d24ad DC |
868 | CFLAGS="$CFLAGS -O5" |
869 | LDFLAGS="$LDFLAGS -O5" | |
870 | else | |
7906085f | 871 | CFLAGS="-O3 $CFLAGS" |
cf9d24ad | 872 | fi |
cddf3f45 GM |
873 | fi |
874 | ||
951bf3e6 FB |
875 | if test x"$bindir" = x""; then |
876 | bindir="${prefix}/bin" | |
877 | fi | |
878 | ||
23a65308 FB |
879 | if test x"$mandir" = x""; then |
880 | mandir="${prefix}/man" | |
881 | fi | |
882 | ||
de6d9b64 | 883 | echo "Install prefix $prefix" |
0f3cb305 | 884 | echo "Source path $source_path" |
de6d9b64 | 885 | echo "C compiler $cc" |
4a908fbc | 886 | echo "make $make" |
a4adb608 | 887 | echo "CPU $cpu ($tune)" |
0f3cb305 | 888 | echo "Big Endian $bigendian" |
7f965c1c | 889 | echo "inttypes.h $inttypes" |
b5c950c4 | 890 | echo "broken inttypes.h $emu_fast_int" |
e41e8342 | 891 | if test $cpu = "x86"; then |
de6d9b64 | 892 | echo "MMX enabled $mmx" |
52b41d7f | 893 | echo "Vector Builtins $builtin_vector" |
e41e8342 FB |
894 | fi |
895 | if test $cpu = "mips"; then | |
d46aba26 | 896 | echo "MMI enabled $mmi" |
e41e8342 FB |
897 | fi |
898 | if test $cpu = "powerpc"; then | |
ab6c65f6 | 899 | echo "AltiVec enabled $altivec" |
e41e8342 | 900 | fi |
de6d9b64 | 901 | echo "gprof enabled $gprof" |
0147f198 | 902 | echo "zlib enabled $zlib" |
a6741398 | 903 | echo "mp3lame enabled $mp3lame" |
81e0d0b4 | 904 | echo "vorbis enabled $vorbis" |
445ad18d ZK |
905 | echo "faad enabled $faad" |
906 | echo "faadbin enabled $faadbin" | |
29d48296 | 907 | echo "faac enabled $faac" |
5cbcf02c | 908 | echo "a52 support $a52" |
57514323 | 909 | echo "a52 dlopened $a52bin" |
bba9b16c | 910 | echo "pp support $pp" |
cddf3f45 GM |
911 | echo "debug symbols $debug" |
912 | echo "optimize $optimize" | |
bba9b16c | 913 | echo "shared pp $shared_pp" |
47930f09 | 914 | echo "Video hooking $vhook" |
a86b921c FB |
915 | echo "SDL support $sdl" |
916 | if test $sdl_too_old = "yes"; then | |
917 | echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support" | |
918 | fi | |
1d0d55da | 919 | echo "risky / patent encumbered codecs $risky" |
68892110 PG |
920 | |
921 | if test "$vhook" = "yes" ; then | |
47930f09 | 922 | echo "Imlib2 support $imlib2" |
04511d53 | 923 | echo "freetype support $freetype2" |
68892110 | 924 | fi |
f80f7964 | 925 | echo "Sun medialib support" $sunmlib |
9c3d33d6 | 926 | echo "pthreads support" $pthreads |
bc634f6f ZK |
927 | echo "AMR-NB float support" $amr_nb |
928 | echo "AMR-NB fixed support" $amr_nb_fixed | |
d663a1fd | 929 | echo "AMR-WB float support" $amr_wb |
de6d9b64 | 930 | |
980fc7b8 | 931 | echo "Creating config.mak and config.h" |
de6d9b64 | 932 | |
980fc7b8 | 933 | echo "# Automatically generated by configure - do not modify" > config.mak |
045ed63f | 934 | echo "/* Automatically generated by configure - do not modify */" > $TMPH |
de6d9b64 | 935 | |
980fc7b8 | 936 | echo "prefix=$prefix" >> config.mak |
951bf3e6 | 937 | echo "bindir=$bindir" >> config.mak |
23a65308 | 938 | echo "mandir=$mandir" >> config.mak |
4a908fbc | 939 | echo "MAKE=$make" >> config.mak |
980fc7b8 FB |
940 | echo "CC=$cc" >> config.mak |
941 | echo "AR=$ar" >> config.mak | |
be7109c1 | 942 | echo "RANLIB=$ranlib" >> config.mak |
0f3cb305 | 943 | echo "STRIP=$strip" >> config.mak |
75388c74 MN |
944 | |
945 | # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building | |
946 | # shared modules on OS/X (vhook/Makefile). | |
947 | SHCFLAGS=$CFLAGS | |
948 | if test "$needmdynamicnopic" = yes; then | |
949 | CFLAGS="$CFLAGS -mdynamic-no-pic" | |
950 | fi | |
951 | ||
a9b3f630 | 952 | echo "OPTFLAGS=$CFLAGS" >> config.mak |
75388c74 | 953 | echo "SHCFLAGS=$SHCFLAGS">>config.mak |
0f3cb305 | 954 | echo "LDFLAGS=$LDFLAGS" >> config.mak |
4baca069 | 955 | echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak |
e1707f52 | 956 | echo "SHFLAGS=$SHFLAGS" >> config.mak |
f3ec2d46 SG |
957 | echo "LIBPREF=$LIBPREF" >> config.mak |
958 | echo "LIBSUF=$LIBSUF" >> config.mak | |
959 | echo "SLIBPREF=$SLIBPREF" >> config.mak | |
960 | echo "SLIBSUF=$SLIBSUF" >> config.mak | |
951bf3e6 | 961 | echo "EXESUF=$EXESUF" >> config.mak |
6852ac95 | 962 | echo "TARGET_OS=$TARGET_OS" >> config.mak |
57514323 | 963 | if test "$cpu" = "x86" ; then |
980fc7b8 | 964 | echo "TARGET_ARCH_X86=yes" >> config.mak |
045ed63f | 965 | echo "#define ARCH_X86 1" >> $TMPH |
0f3cb305 | 966 | elif test "$cpu" = "armv4l" ; then |
6ed7422a | 967 | echo "TARGET_ARCH_ARMV4L=yes" >> config.mak |
045ed63f | 968 | echo "#define ARCH_ARMV4L 1" >> $TMPH |
0f3cb305 | 969 | elif test "$cpu" = "alpha" ; then |
91d1f1a4 | 970 | echo "TARGET_ARCH_ALPHA=yes" >> config.mak |
045ed63f | 971 | echo "#define ARCH_ALPHA 1" >> $TMPH |
35fedfc3 PG |
972 | elif test "$cpu" = "sparc64" ; then |
973 | echo "TARGET_ARCH_SPARC64=yes" >> config.mak | |
974 | echo "#define ARCH_SPARC64 1" >> $TMPH | |
0f3cb305 FB |
975 | elif test "$cpu" = "powerpc" ; then |
976 | echo "TARGET_ARCH_POWERPC=yes" >> config.mak | |
977 | echo "#define ARCH_POWERPC 1" >> $TMPH | |
e45a2872 RD |
978 | if test "$powerpc_perf" = "yes"; then |
979 | echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH | |
980 | fi | |
d46aba26 LS |
981 | elif test "$cpu" = "mips" ; then |
982 | echo "TARGET_ARCH_MIPS=yes" >> config.mak | |
983 | echo "#define ARCH_MIPS 1" >> $TMPH | |
bdb2e37c AB |
984 | elif test "$cpu" = "sh4" ; then |
985 | echo "TARGET_ARCH_SH4=yes" >> config.mak | |
986 | echo "#define ARCH_SH4 1" >> $TMPH | |
987 | fi | |
a4adb608 | 988 | echo "#define TUNECPU $TUNECPU" >> $TMPH |
0f3cb305 FB |
989 | if test "$bigendian" = "yes" ; then |
990 | echo "WORDS_BIGENDIAN=yes" >> config.mak | |
991 | echo "#define WORDS_BIGENDIAN 1" >> $TMPH | |
91d1f1a4 | 992 | fi |
d2a9bddd MN |
993 | if test "$inttypes" != "yes" ; then |
994 | echo "#define EMULATE_INTTYPES 1" >> $TMPH | |
7f965c1c | 995 | fi |
b5c950c4 | 996 | if test "$emu_fast_int" = "yes" ; then |
19d053c5 | 997 | echo "#define EMULATE_FAST_INT 1" >> $TMPH |
b5c950c4 | 998 | fi |
57514323 | 999 | if test "$mmx" = "yes" ; then |
980fc7b8 | 1000 | echo "TARGET_MMX=yes" >> config.mak |
045ed63f | 1001 | echo "#define HAVE_MMX 1" >> $TMPH |
e82c5a8c | 1002 | echo "#define __CPU__ 586" >> $TMPH |
de6d9b64 | 1003 | fi |
52b41d7f FB |
1004 | if test "$builtin_vector" = "yes" ; then |
1005 | echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak | |
1006 | echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH | |
1007 | fi | |
d46aba26 LS |
1008 | if test "$mmi" = "yes" ; then |
1009 | echo "TARGET_MMI=yes" >> config.mak | |
1010 | echo "#define HAVE_MMI 1" >> $TMPH | |
1011 | fi | |
ab6c65f6 BF |
1012 | if test "$altivec" = "yes" ; then |
1013 | echo "TARGET_ALTIVEC=yes" >> config.mak | |
1014 | echo "#define HAVE_ALTIVEC 1" >> $TMPH | |
db40a39a MN |
1015 | echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH |
1016 | echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH | |
a9a07762 MN |
1017 | if test "$_altivec_h" = "yes" ; then |
1018 | echo "#define HAVE_ALTIVEC_H 1" >> $TMPH | |
1019 | else | |
e67e14d5 | 1020 | echo "#undef HAVE_ALTIVEC_H" >> $TMPH |
a9a07762 | 1021 | fi |
ab6c65f6 | 1022 | fi |
57514323 | 1023 | if test "$gprof" = "yes" ; then |
980fc7b8 | 1024 | echo "TARGET_GPROF=yes" >> config.mak |
045ed63f | 1025 | echo "#define HAVE_GPROF 1" >> $TMPH |
de6d9b64 | 1026 | fi |
5e4639e2 GM |
1027 | if test "$localtime_r" = "yes" ; then |
1028 | echo "#define HAVE_LOCALTIME_R 1" >> $TMPH | |
5e4639e2 | 1029 | fi |
68892110 PG |
1030 | if test "$imlib2" = "yes" ; then |
1031 | echo "HAVE_IMLIB2=yes" >> config.mak | |
1032 | fi | |
04511d53 PG |
1033 | if test "$freetype2" = "yes" ; then |
1034 | echo "HAVE_FREETYPE2=yes" >> config.mak | |
1035 | fi | |
f80f7964 RS |
1036 | if test "$sunmlib" = "yes" ; then |
1037 | echo "HAVE_MLIB=yes" >> config.mak | |
1038 | echo "#define HAVE_MLIB 1" >> $TMPH | |
1039 | extralibs="$extralibs -lmlib" | |
1040 | fi | |
9c3d33d6 MN |
1041 | if test "$pthreads" = "yes" ; then |
1042 | echo "HAVE_PTHREADS=yes" >> config.mak | |
1043 | echo "#define HAVE_PTHREADS 1" >> $TMPH | |
1044 | extralibs="$extralibs -lpthread" | |
1045 | fi | |
a86b921c FB |
1046 | if test "$sdl" = "yes" ; then |
1047 | echo "CONFIG_SDL=yes" >> config.mak | |
1048 | echo "SDL_LIBS=`sdl-config --libs`" >> config.mak | |
1049 | echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak | |
1050 | fi | |
95e2ce4a MN |
1051 | if test "$have_lrintf" = "yes" ; then |
1052 | echo "#define HAVE_LRINTF 1" >> $TMPH | |
1053 | fi | |
68892110 PG |
1054 | if test "$vhook" = "yes" ; then |
1055 | echo "BUILD_VHOOK=yes" >> config.mak | |
1056 | echo "#define HAVE_VHOOK 1" >> $TMPH | |
9c938e77 | 1057 | extralibs="$extralibs $ldl" |
68892110 | 1058 | fi |
57514323 | 1059 | if test "$lshared" = "yes" ; then |
0319c531 | 1060 | echo "BUILD_SHARED=yes" >> config.mak |
5cbcf02c | 1061 | echo "PIC=-fPIC" >> config.mak |
0319c531 | 1062 | fi |
ef0bc4c9 | 1063 | echo "EXTRALIBS=$extralibs" >> config.mak |
258207b7 FB |
1064 | version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h | |
1065 | cut -d '"' -f 2` | |
1066 | echo "VERSION=$version" >>config.mak | |
d771bcae | 1067 | # if you do not want to use encoders, disable that. |
045ed63f | 1068 | echo "#define CONFIG_ENCODERS 1" >> $TMPH |
d771bcae FB |
1069 | echo "CONFIG_ENCODERS=yes" >> config.mak |
1070 | ||
1071 | # if you do not want to use decoders, disable that. | |
045ed63f | 1072 | echo "#define CONFIG_DECODERS 1" >> $TMPH |
d771bcae FB |
1073 | echo "CONFIG_DECODERS=yes" >> config.mak |
1074 | ||
5cbcf02c FB |
1075 | # AC3 |
1076 | if test "$a52" = "yes" ; then | |
1077 | echo "#define CONFIG_AC3 1" >> $TMPH | |
1078 | echo "CONFIG_AC3=yes" >> config.mak | |
d771bcae | 1079 | |
5cbcf02c FB |
1080 | if test "$a52bin" = "yes" ; then |
1081 | echo "#define CONFIG_A52BIN 1" >> $TMPH | |
1082 | echo "CONFIG_A52BIN=yes" >> config.mak | |
1083 | fi | |
1084 | fi | |
1085 | ||
bba9b16c MN |
1086 | # PP |
1087 | if test "$pp" = "yes" ; then | |
1088 | echo "#define CONFIG_PP 1" >> $TMPH | |
1089 | echo "CONFIG_PP=yes" >> config.mak | |
1090 | ||
1091 | if test "$shared_pp" = "yes" ; then | |
1092 | echo "#define SHARED_PP 1" >> $TMPH | |
1093 | echo "SHARED_PP=yes" >> config.mak | |
1094 | fi | |
1095 | fi | |
1096 | ||
1eb2212e FB |
1097 | # mpeg audio high precision mode |
1098 | if test "$mpegaudio_hp" = "yes" ; then | |
1099 | echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH | |
1100 | fi | |
1101 | ||
5cbcf02c FB |
1102 | if test "$v4l" = "yes" ; then |
1103 | echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH | |
1104 | echo "CONFIG_VIDEO4LINUX=yes" >> config.mak | |
1105 | fi | |
1106 | ||
8aa3ee32 MK |
1107 | if test "$dv1394" = "yes" ; then |
1108 | echo "#define CONFIG_DV1394 1" >> $TMPH | |
1109 | echo "CONFIG_DV1394=yes" >> config.mak | |
1110 | fi | |
1111 | ||
adbc0510 PG |
1112 | if test "$dlopen" = "yes" ; then |
1113 | echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH | |
1114 | fi | |
1115 | ||
1116 | if test "$dlfcn" = "yes" ; then | |
1117 | echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH | |
1118 | fi | |
1119 | ||
5cbcf02c FB |
1120 | if test "$audio_oss" = "yes" ; then |
1121 | echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH | |
1122 | echo "CONFIG_AUDIO_OSS=yes" >> config.mak | |
57514323 ZK |
1123 | fi |
1124 | ||
dfdfa47c FR |
1125 | if test "$audio_beos" = "yes" ; then |
1126 | echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH | |
1127 | echo "CONFIG_AUDIO_BEOS=yes" >> config.mak | |
1128 | fi | |
1129 | ||
5cbcf02c FB |
1130 | if test "$network" = "yes" ; then |
1131 | echo "#define CONFIG_NETWORK 1" >> $TMPH | |
1132 | echo "CONFIG_NETWORK=yes" >> config.mak | |
6ed7422a | 1133 | fi |
daf8e955 | 1134 | |
0147f198 FR |
1135 | if test "$zlib" = "yes" ; then |
1136 | echo "#define CONFIG_ZLIB 1" >> $TMPH | |
1137 | echo "CONFIG_ZLIB=yes" >> config.mak | |
1138 | fi | |
1139 | ||
57514323 | 1140 | if test "$mp3lame" = "yes" ; then |
045ed63f | 1141 | echo "#define CONFIG_MP3LAME 1" >> $TMPH |
a6741398 J |
1142 | echo "CONFIG_MP3LAME=yes" >> config.mak |
1143 | fi | |
1144 | ||
81e0d0b4 MH |
1145 | if test "$vorbis" = "yes" ; then |
1146 | echo "#define CONFIG_VORBIS 1" >> $TMPH | |
1147 | echo "CONFIG_VORBIS=yes" >> config.mak | |
1148 | fi | |
1149 | ||
0fc50e58 ZK |
1150 | if test "$faad" = "yes" ; then |
1151 | echo "#define CONFIG_FAAD 1" >> $TMPH | |
1152 | echo "CONFIG_FAAD=yes" >> config.mak | |
1153 | fi | |
1154 | ||
1155 | if test "$faadbin" = "yes" ; then | |
1156 | echo "#define CONFIG_FAADBIN 1" >> $TMPH | |
445ad18d | 1157 | echo "CONFIG_FAADBIN=yes" >> config.mak |
0fc50e58 ZK |
1158 | fi |
1159 | ||
29d48296 MN |
1160 | if test "$faac" = "yes" ; then |
1161 | echo "#define CONFIG_FAAC 1" >> $TMPH | |
1162 | echo "CONFIG_FAAC=yes" >> config.mak | |
1163 | fi | |
1164 | ||
732d9245 BE |
1165 | if test "$mingw32" = "yes" ; then |
1166 | echo "#define CONFIG_WIN32 1" >> $TMPH | |
1167 | echo "CONFIG_WIN32=yes" >> config.mak | |
16806499 MN |
1168 | echo "HAVE_W32THREADS=yes" >> config.mak |
1169 | echo "#define HAVE_W32THREADS 1" >> $TMPH | |
7eea5766 | 1170 | echo "#ifndef __MINGW32__" >> $TMPH |
732d9245 | 1171 | echo "#define __MINGW32__ 1" >> $TMPH |
7eea5766 | 1172 | echo "#endif" >> $TMPH |
3f027ca7 FB |
1173 | fi |
1174 | ||
f3ec2d46 SG |
1175 | if test "$os2" = "yes" ; then |
1176 | echo "#define CONFIG_OS2 1" >> $TMPH | |
1177 | echo "CONFIG_OS2=yes" >> config.mak | |
1178 | fi | |
1179 | ||
6e023978 RS |
1180 | if test "$TARGET_OS" = "SunOS" ; then |
1181 | echo "#define CONFIG_SUNOS 1" >> $TMPH | |
1182 | fi | |
1183 | ||
90cee0c3 MN |
1184 | if test "$darwin" = "yes"; then |
1185 | echo "#define CONFIG_DARWIN 1" >> $TMPH | |
1186 | echo "CONFIG_DARWIN=yes" >> config.mak | |
1187 | fi | |
1188 | ||
57514323 | 1189 | if test "$_malloc_h" = "yes" ; then |
045ed63f | 1190 | echo "#define HAVE_MALLOC_H 1" >> $TMPH |
3d204385 | 1191 | else |
045ed63f | 1192 | echo "#undef HAVE_MALLOC_H" >> $TMPH |
3d204385 NK |
1193 | fi |
1194 | ||
57514323 | 1195 | if test "$_memalign" = "yes" ; then |
045ed63f ZK |
1196 | echo "#define HAVE_MEMALIGN 1" >> $TMPH |
1197 | else | |
1198 | echo "#undef HAVE_MEMALIGN" >> $TMPH | |
1199 | fi | |
1200 | ||
26b35efb FR |
1201 | if test "$netserver" = "yes" ; then |
1202 | echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH | |
1203 | echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak | |
1204 | fi | |
1205 | ||
4baca069 PG |
1206 | if test "$need_inet_aton" = "yes" ; then |
1207 | echo "NEED_INET_ATON=yes" >> config.mak | |
1208 | fi | |
1209 | ||
57514323 | 1210 | if test "$simpleidct" = "yes" ; then |
045ed63f ZK |
1211 | echo "#define SIMPLE_IDCT 1" >> $TMPH |
1212 | fi | |
1213 | ||
8154d2e0 FB |
1214 | if test "$ffserver" = "yes" ; then |
1215 | echo "#define CONFIG_FFSERVER 1" >> $TMPH | |
1216 | echo "CONFIG_FFSERVER=yes" >> config.mak | |
1217 | fi | |
1218 | ||
a86b921c FB |
1219 | if test "$ffplay" = "yes" ; then |
1220 | echo "CONFIG_FFPLAY=yes" >> config.mak | |
1221 | fi | |
1222 | ||
1d0d55da MN |
1223 | if test "$risky" = "yes" ; then |
1224 | echo "#define CONFIG_RISKY 1" >> $TMPH | |
1225 | echo "CONFIG_RISKY=yes" >> config.mak | |
1226 | fi | |
1227 | ||
c13e1abd FH |
1228 | echo "#define restrict $_restrict" >> $TMPH |
1229 | ||
0f3cb305 FB |
1230 | # build tree in object directory if source path is different from current one |
1231 | if test "$source_path_used" = "yes" ; then | |
a382b927 | 1232 | DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \ |
5f6b58de MR |
1233 | libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook" |
1234 | FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile" | |
0f3cb305 FB |
1235 | for dir in $DIRS ; do |
1236 | mkdir -p $dir | |
1237 | done | |
1238 | for f in $FILES ; do | |
1239 | ln -sf $source_path/$f $f | |
1240 | done | |
1241 | fi | |
1242 | echo "SRC_PATH=$source_path" >> config.mak | |
1243 | ||
d663a1fd MN |
1244 | if test "$amr_wb" = "yes" ; then |
1245 | echo "#define AMR_WB 1" >> $TMPH | |
1246 | echo "AMR_WB=yes" >> config.mak | |
1247 | echo | |
1248 | echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204" | |
1249 | echo "V5.1.0 from " | |
1250 | echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip" | |
1251 | echo "and extracted the source to libavcodec/amrwb_float" | |
1252 | echo | |
1253 | fi | |
1254 | ||
891f64b3 | 1255 | if test "$amr_nb" = "yes" ; then |
1256 | echo "#define AMR_NB 1" >> $TMPH | |
1257 | echo "AMR_NB=yes" >> config.mak | |
1258 | echo | |
bc634f6f ZK |
1259 | if test "$amr_nb_fixed" = "yes" ; then |
1260 | echo "AMR_NB_FIXED=yes" >> config.mak | |
1261 | echo "#define AMR_NB_FIXED 1" >> $TMPH | |
1262 | echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 " | |
1263 | echo "REL-5 version 5.1.0 from " | |
891f64b3 | 1264 | echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip" |
1265 | echo "and extracted src to libavcodec/amr" | |
bc634f6f ZK |
1266 | echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile." |
1267 | echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO" | |
1268 | echo | |
1269 | else | |
1270 | echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104" | |
1271 | echo "REL-5 V5.1.0 from " | |
1272 | echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip" | |
1273 | echo "and extracted the source to libavcodec/amr_float" | |
821e46f4 | 1274 | echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h" |
891f64b3 | 1275 | echo |
1276 | fi | |
1277 | ||
bc634f6f ZK |
1278 | fi |
1279 | ||
a7c02e25 | 1280 | diff $TMPH config.h >/dev/null 2>&1 |
045ed63f ZK |
1281 | if test $? -ne 0 ; then |
1282 | mv -f $TMPH config.h | |
3d204385 | 1283 | else |
045ed63f | 1284 | echo "config.h is unchanged" |
3d204385 NK |
1285 | fi |
1286 | ||
f3ec2d46 | 1287 | rm -f $TMPO $TMPC $TMPE $TMPS $TMPH |