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