use get_format
[libav.git] / configure
CommitLineData
de6d9b64 1#!/bin/sh
0f3cb305 2#
5cbcf02c 3# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
0f3cb305 4#
cf9d24ad
DC
5
6if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
7cat << EOF
8
9Usage: configure [options]
10Options: [defaults in brackets after descriptions]
11
12EOF
13echo "Standard options:"
14echo " --help print this message"
15echo " --prefix=PREFIX install in PREFIX [$prefix]"
16echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
17echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
18echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
19echo " --enable-faad enable faad support via libfaad [default=no]"
20echo " --enable-faadbin build faad support with runtime linking [default=no]"
21echo " --enable-faac enable faac support via libfaac [default=no]"
22echo " --enable-mingw32 enable mingw32 native/cross windows compile"
23echo " --enable-a52 enable GPL'ed A52 support [default=no]"
24echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
25echo " --enable-pp enable GPL'ed post processing support [default=no]"
26echo " --enable-shared-pp use libpostproc.so [default=no]"
27echo " --enable-shared build shared libraries [default=no]"
28echo " --enable-amr_nb enable amr_nb float audio codec"
29echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
64cba748 30echo " --enable-amr_wb enable amr_wb float audio codec"
cf9d24ad 31echo " --enable-sunmlib use Sun medialib [default=no]"
9c3d33d6 32echo " --enable-pthreads use pthreads [default=no]"
cf9d24ad
DC
33echo ""
34echo "Advanced options (experts only):"
35echo " --source-path=PATH path of source code [$source_path]"
36echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
37echo " --cc=CC use C compiler CC [$cc]"
38echo " --make=MAKE use specified make [$make]"
39echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
40echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
41echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
42echo " --cpu=CPU force cpu to CPU [$cpu]"
43echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
44echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
45echo " --disable-mmx disable mmx usage"
46echo " --disable-altivec disable AltiVec usage"
47echo " --disable-audio-oss disable OSS audio support [default=no]"
48echo " --disable-audio-beos disable BeOS audio support [default=no]"
49echo " --disable-v4l disable video4linux grabbing [default=no]"
50echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
51echo " --disable-network disable network support [default=no]"
52echo " --disable-zlib disable zlib [default=no]"
53echo " --disable-simple_idct disable simple IDCT routines [default=no]"
54echo " --disable-vhook disable video hooking support"
55echo " --enable-gprof enable profiling with gprof [$gprof]"
56echo " --disable-debug disable debugging symbols"
57echo " --disable-opts disable compiler optimizations"
58echo " --disable-mpegaudio-hp faster (but less accurate)"
59echo " mpegaudio decoding [default=no]"
60echo " --disable-ffserver disable ffserver build"
61echo " --disable-ffplay disable ffplay build"
62echo " --disable-risky disables patent encumbered codecs"
63echo " --enable-small optimize for size instead of speed"
64echo ""
65echo "NOTE: The object files are build at the place where configure is launched"
66exit 1
67fi
68
0f3cb305 69# set temporary file name
57514323 70if test ! -z "$TMPDIR" ; then
0f3cb305 71 TMPDIR1="${TMPDIR}"
57514323 72elif test ! -z "$TEMPDIR" ; then
0f3cb305 73 TMPDIR1="${TEMPDIR}"
3d204385 74else
0f3cb305 75 TMPDIR1="/tmp"
3d204385
NK
76fi
77
0f3cb305
FB
78TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
79TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
f3ec2d46 80TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
0f3cb305
FB
81TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
82TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
83
de6d9b64
FB
84# default parameters
85prefix="/usr/local"
23a65308 86mandir=""
951bf3e6 87bindir=""
0f3cb305 88cross_prefix=""
de6d9b64
FB
89cc="gcc"
90ar="ar"
be7109c1 91ranlib="ranlib"
4a908fbc 92make="make"
0f3cb305 93strip="strip"
de6d9b64 94cpu=`uname -m`
a4adb608 95tune="generic"
e45a2872 96powerpc_perf="no"
0f3cb305 97mmx="default"
ab6c65f6 98altivec="default"
d46aba26 99mmi="default"
de6d9b64 100case "$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 ;;
126esac
127gprof="no"
5cbcf02c
FB
128v4l="yes"
129audio_oss="yes"
dfdfa47c 130audio_beos="no"
8aa3ee32 131dv1394="yes"
5cbcf02c 132network="yes"
0147f198 133zlib="yes"
a6741398 134mp3lame="no"
81e0d0b4 135vorbis="no"
0fc50e58
ZK
136faad="no"
137faadbin="no"
29d48296 138faac="no"
ba9261e5 139a52="no"
57514323 140a52bin="no"
ba9261e5 141pp="no"
bba9b16c 142shared_pp="no"
732d9245 143mingw32="no"
3f027ca7 144cygwin="no"
f3ec2d46 145os2="no"
83286d2a 146lshared="no"
cddf3f45
GM
147optimize="yes"
148debug="yes"
ef0bc4c9 149extralibs="-lm"
c02dbee1 150simpleidct="yes"
0f3cb305 151bigendian="no"
7f965c1c 152inttypes="yes"
b5c950c4 153emu_fast_int="no"
a8721c09 154vhook="default"
adbc0510
PG
155dlfcn="no"
156dlopen="no"
1eb2212e 157mpegaudio_hp="yes"
e1707f52 158SHFLAGS=-shared
26b35efb 159netserver="no"
4baca069 160need_inet_aton="no"
8154d2e0 161ffserver="yes"
a86b921c 162ffplay="yes"
4baca069
PG
163LDFLAGS=-Wl,--warn-common
164FFSLDFLAGS=-Wl,-E
f3ec2d46
SG
165LIBPREF="lib"
166LIBSUF=".a"
167SLIBPREF="lib"
168SLIBSUF=".so"
951bf3e6 169EXESUF=""
1d0d55da 170risky="yes"
891f64b3 171amr_nb="no"
d663a1fd 172amr_wb="no"
bc634f6f 173amr_nb_fixed="no"
f80f7964 174sunmlib="no"
9c3d33d6 175pthreads="no"
ef0bc4c9
FR
176
177# OS specific
178targetos=`uname -s`
179case $targetos in
180BeOS)
181prefix="/boot/home/config"
182# helps building libavcodec
cddf3f45 183CFLAGS="-DPIC -fomit-frame-pointer"
31ba0b4d 184# 3 gcc releases known for BeOS, each with ugly bugs
b2924696 185gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
31ba0b4d
FR
186case "$gcc_version" in
1872.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
188mmx="no"
189;;
190*20010315*) echo "BeBits gcc"
191CFLAGS="$CFLAGS -fno-expensive-optimizations"
192;;
193esac
e1707f52
MN
194SHFLAGS=-nostart
195# disable linux things
196audio_oss="no"
5cbcf02c 197v4l="no"
8aa3ee32 198dv1394="no"
dfdfa47c
FR
199# enable beos things
200audio_beos="yes"
ef0bc4c9
FR
201# no need for libm, but the inet stuff
202# Check for BONE
203if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
204extralibs="-lbind -lsocket"
205else
26b35efb 206netserver="yes"
4baca069 207need_inet_aton="yes"
26b35efb 208extralibs="-lnet"
ef0bc4c9 209fi ;;
4baca069
PG
210SunOS)
211v4l="no"
212audio_oss="no"
8aa3ee32 213dv1394="no"
4baca069
PG
214make="gmake"
215LDFLAGS=""
216FFSLDFLAGS=""
217need_inet_aton="yes"
218extralibs="$extralibs -lsocket -lnsl"
219;;
9c938e77
PG
220FreeBSD)
221v4l="no"
222audio_oss="yes"
8aa3ee32 223dv1394="no"
9c938e77 224make="gmake"
4baca069 225LDFLAGS="$LDFLAGS -export-dynamic"
9c938e77 226;;
4a908fbc 227BSD/OS)
5cbcf02c 228v4l="no"
6063bce7 229audio_oss="yes"
8aa3ee32 230dv1394="no"
4a908fbc
AB
231extralibs="-lpoll -lgnugetopt -lm"
232make="gmake"
233;;
90cee0c3 234Darwin)
a43bd1d7 235cc="cc"
90cee0c3
MN
236v4l="no"
237audio_oss="no"
8aa3ee32 238dv1394="no"
d3b15036 239ffserver="no"
a43bd1d7 240SHFLAGS="-dynamiclib"
90cee0c3 241extralibs=""
a43bd1d7 242darwin="yes"
47930f09 243strip="strip -x"
4850b2d2 244LDFLAGS="-Wl,-d"
4baca069 245FFSLDFLAGS=-Wl,-bind_at_load
90cee0c3 246;;
732d9245 247MINGW32*)
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
250mingw32="yes"
251;;
3f027ca7
FB
252CYGWIN*)
253v4l="no"
254audio_oss="yes"
8aa3ee32 255dv1394="no"
3f027ca7
FB
256extralibs=""
257cygwin="yes"
258test -f /usr/include/inttypes.h || \
259test -f /usr/local/include/inttypes.h || \
260echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
261 "/usr/include/inttypes.h !!!"
262;;
b55e4ef4 263Linux)
4baca069 264LDFLAGS="$LDFLAGS -rdynamic"
b55e4ef4 265;;
99614dd4
MB
266IRIX*)
267ranlib="echo ignoring ranlib"
268v4l="no"
269audio_oss="no"
270make="gmake"
271;;
f3ec2d46
SG
272OS/2)
273TMPE=$TMPE".exe"
69db4e10
SG
274ar="emxomfar -p64"
275ranlib="echo ignoring ranlib"
276strip="echo ignoring strip"
cddf3f45 277CFLAGS="-Zomf"
69db4e10 278LDFLAGS="-Zomf -Zstack 16384 -s"
f3ec2d46
SG
279SHFLAGS=""
280FFSLDFLAGS=""
281LIBPREF=""
282LIBSUF=".lib"
283SLIBPREF=""
284SLIBSUF=".dll"
951bf3e6 285EXESUF=".exe"
f3ec2d46
SG
286extralibs=""
287v4l="no"
288audio_oss="no"
8aa3ee32 289dv1394="no"
f3ec2d46
SG
290network="no"
291ffserver="no"
292os2="yes"
293;;
ef0bc4c9
FR
294*) ;;
295esac
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
300TARGET_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 321source_path="`echo $0 | sed -e 's#/configure##'`"
0f3cb305
FB
322source_path_used="yes"
323if test -z "$source_path" -o "$source_path" = "." ; then
324 source_path=`pwd`
325 source_path_used="no"
de6d9b64
FB
326fi
327
328for 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
423done
424
0f3cb305
FB
425# compute mmx state
426if test $mmx = "default"; then
427 if test $cpu = "x86"; then
428 mmx="yes"
429 else
430 mmx="no"
431 fi
432fi
433
cf9d24ad 434#Darwin CC versions
75388c74 435needmdynamicnopic="no"
cf9d24ad 436if 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
459fi
460
ab6c65f6
BF
461# Can only do AltiVec on PowerPC
462if test $altivec = "default"; then
463 if test $cpu = "powerpc"; then
464 altivec="yes"
465 else
466 altivec="no"
467 fi
468fi
469
a4adb608
MN
470# Add processor-specific flags
471TUNECPU="generic"
472if 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
527fi
528
cf9d24ad 529# AltiVec flags: The FSF version of GCC differs from the Apple version
b6e52719
MD
530if 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
538fi
539
a9a07762
MN
540# See if we have <altivec.h>
541cat > $TMPC << EOF
542#include <altivec.h>
543int main( void ) { return 0; }
544EOF
545
546_altivec_h="no"
b6e52719 547if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
a9a07762
MN
548_altivec_h="yes"
549fi
550
ab6c65f6
BF
551# See does our compiler support Motorola AltiVec C API
552if test $altivec = "yes"; then
a9a07762 553if test $_altivec_h = "yes"; then
ab6c65f6 554cat > $TMPC << EOF
a9a07762 555#include <altivec.h>
ab6c65f6
BF
556int main(void) {
557 vector signed int v1, v2, v3;
558 v1 = vec_add(v2,v3);
559 return 0;
560}
561EOF
a9a07762
MN
562else
563cat > $TMPC << EOF
564int main(void) {
565 vector signed int v1, v2, v3;
566 v1 = vec_add(v2,v3);
567 return 0;
568}
569EOF
570fi
b6e52719 571$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
ab6c65f6
BF
572fi
573
d46aba26
LS
574# Can only do mmi on mips
575if test $mmi = "default"; then
576 if test $cpu = "mips"; then
577 mmi="yes"
578 else
579 mmi="no"
580 fi
581fi
582
583# See does our compiler support mmi
584if test $mmi = "yes"; then
585cat > $TMPC << EOF
586int main(void) {
587 __asm__ ("lq \$2, 0(\$2)");
588 return 0;
589}
590EOF
f3ec2d46 591$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
d46aba26
LS
592fi
593
732d9245 594if 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
607fi
608
0f3cb305
FB
609cc="${cross_prefix}${cc}"
610ar="${cross_prefix}${ar}"
be7109c1 611ranlib="${cross_prefix}${ranlib}"
0f3cb305
FB
612strip="${cross_prefix}${strip}"
613
487a54d7
FB
614if test -z "$cross_prefix" ; then
615
3d204385 616# ---
a3999908
MN
617# big/little endian test
618cat > $TMPC << EOF
619#include <inttypes.h>
620int main(int argc, char ** argv){
621 volatile uint32_t i=0x01234567;
622 return (*((uint8_t*)(&i))) == 0x67;
623}
624EOF
625
f3ec2d46
SG
626if $cc -o $TMPE $TMPC 2>/dev/null ; then
627$TMPE && bigendian="yes"
a3999908
MN
628else
629echo big/little test failed
630fi
631
487a54d7
FB
632else
633
634# if cross compiling, cannot launch a program, so make a static guess
635if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
636 bigendian="yes"
637fi
638
639fi
640
a3999908 641# ---
7f965c1c
CF
642# *inttypes.h* test
643cat > $TMPC << EOF
644#include <inttypes.h>
645int main(int argc, char ** argv){
646 return 0;
647}
648EOF
649
650$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
651
652# ---
b5c950c4
MN
653# *int_fast* test
654cat > $TMPC << EOF
655#include <inttypes.h>
656int main(int argc, char ** argv){
657 volatile uint_fast64_t i=0x01234567;
658 return 0;
659}
660EOF
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
667cat > $TMPC << EOF
668#include <malloc.h>
669int main( void ) { return 0; }
670EOF
671
672_memalign=no
673_malloc_h=no
f3ec2d46 674if $cc -o $TMPE $TMPC 2> /dev/null ; then
3d204385
NK
675_malloc_h=yes
676_memalign=yes
677# check for memalign - atmos
678cat > $TMPC << EOF
679#include <malloc.h>
680int main ( void ) {
681char *string = NULL;
682string = memalign(64, sizeof(char));
683return 0;
684}
685EOF
f3ec2d46 686$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
3d204385
NK
687fi
688
68892110 689cat > $TMPC << EOF
5e4639e2
GM
690#include <time.h>
691int main( void ) { localtime_r(NULL, NULL); }
692EOF
693
694localtime_r=no
695if $cc -o $TMPE $TMPC 2> /dev/null ; then
696 localtime_r=yes
697fi
698
0147f198
FR
699if test "$zlib" = "yes"; then
700# check for zlib - mmu_man
701cat > $TMPC << EOF
702#include <zlib.h>
703int main ( void ) {
704if (zlibVersion() != ZLIB_VERSION)
705 puts("zlib version differs !!!");
706 return 1;
707return 0;
708}
709EOF
f3ec2d46
SG
710$cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
711# $TMPE 2> /dev/null > /dev/null || zlib="no"
0147f198
FR
712# XXX: more tests needed - runtime test
713fi
714if test "$zlib" = "yes"; then
715extralibs="$extralibs -lz"
716fi
717
95e2ce4a
MN
718# test for lrintf in math.h
719cat > $TMPC << EOF
720#define _ISOC9X_SOURCE 1
721#include <math.h>
722int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
723EOF
724
725have_lrintf="no"
f3ec2d46 726if $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
729fi
730
c13e1abd
FH
731_restrict=
732for 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
738done
739
52b41d7f
FB
740# test gcc version to see if vector builtins can be used
741# currently only used on i386 for MMX builtins
742cat > $TMPC << EOF
743int main(void) {
744#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
745return 0;
746#else
747#error no vector builtins
748#endif
749}
750EOF
751
752builtin_vector=no
753if $cc -o $TMPO $TMPC 2> /dev/null ; then
754 builtin_vector=yes
a8721c09
FB
755fi
756
757# dlopen/dlfcn.h probing
758
759cat > $TMPC << EOF
760#include <dlfcn.h>
761int main( void ) { return (int) dlopen("foo", 0); }
762EOF
763
764ldl=-ldl
765
cf9d24ad 766if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
767dlfcn=yes
768dlopen=yes
769fi
770
cf9d24ad 771if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
772dlfcn=yes
773dlopen=yes
774ldl=""
775fi
776
777cat > $TMPC << EOF
778int main( void ) { return (int) dlopen("foo", 0); }
779EOF
780
cf9d24ad 781if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
782dlopen=yes
783fi
784
cf9d24ad 785if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
786dlopen=yes
787ldl=""
788fi
789
790if test "$vhook" = "default" ; then
791 vhook="$dlopen"
792fi
793
a86b921c
FB
794##########################################
795# imlib probe
796
a8721c09
FB
797cat > $TMPC << EOF
798#include <X11/Xlib.h>
799#include <Imlib2.h>
800int main( void ) { return (int) imlib_load_font("foo"); }
801EOF
802
803imlib2=no
cf9d24ad 804if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
a8721c09 805imlib2=yes
52b41d7f
FB
806fi
807
a86b921c
FB
808##########################################
809# freetype probe
810
04511d53
PG
811cat > $TMPC << EOF
812#include <ft2build.h>
813int main( void ) { return (int) FT_Init_FreeType(0); }
814EOF
815
816freetype2=no
69db4e10 817if 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
823fi
824
a86b921c
FB
825##########################################
826# SDL probe
827
828cat > $TMPC << EOF
829#include <SDL.h>
31319a8c 830#undef main /* We don't want SDL to override our main() */
a86b921c
FB
831int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
832EOF
833
834sdl_too_old=no
835sdl=no
cf9d24ad 836if $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'`
838if test "$_sdlversion" -lt 121 ; then
839sdl_too_old=yes
840else
841sdl=yes
842fi
843fi
844
b2924696 845case "`$cc -v 2>&1 | grep version`" in
cf9d24ad
DC
846 *gcc*)
847 CFLAGS="-Wall $CFLAGS"
848 ;;
849 *)
850 ;;
851esac
852
94a3401e
FB
853if test "$sdl" = "no" ; then
854 ffplay=no
855fi
856
cddf3f45
GM
857if test "$debug" = "yes"; then
858 CFLAGS="$CFLAGS -g"
859fi
860
861if test "$optimize" = "small"; then
98ca7790 862# CFLAGS=${CFLAGS//-O3/-Os}
553a6284
MN
863 CFLAGS="$CFLAGS -Os"
864fi
865
cddf3f45 866if 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
cddf3f45 871 CFLAGS="$CFLAGS -O3"
cf9d24ad 872 fi
cddf3f45
GM
873fi
874
951bf3e6
FB
875if test x"$bindir" = x""; then
876bindir="${prefix}/bin"
877fi
878
23a65308
FB
879if test x"$mandir" = x""; then
880mandir="${prefix}/man"
881fi
882
de6d9b64 883echo "Install prefix $prefix"
0f3cb305 884echo "Source path $source_path"
de6d9b64 885echo "C compiler $cc"
4a908fbc 886echo "make $make"
a4adb608 887echo "CPU $cpu ($tune)"
0f3cb305 888echo "Big Endian $bigendian"
7f965c1c 889echo "inttypes.h $inttypes"
b5c950c4 890echo "broken inttypes.h $emu_fast_int"
e41e8342 891if test $cpu = "x86"; then
de6d9b64 892echo "MMX enabled $mmx"
52b41d7f 893echo "Vector Builtins $builtin_vector"
e41e8342
FB
894fi
895if test $cpu = "mips"; then
d46aba26 896echo "MMI enabled $mmi"
e41e8342
FB
897fi
898if test $cpu = "powerpc"; then
ab6c65f6 899echo "AltiVec enabled $altivec"
e41e8342 900fi
de6d9b64 901echo "gprof enabled $gprof"
0147f198 902echo "zlib enabled $zlib"
a6741398 903echo "mp3lame enabled $mp3lame"
81e0d0b4 904echo "vorbis enabled $vorbis"
445ad18d
ZK
905echo "faad enabled $faad"
906echo "faadbin enabled $faadbin"
29d48296 907echo "faac enabled $faac"
5cbcf02c 908echo "a52 support $a52"
57514323 909echo "a52 dlopened $a52bin"
bba9b16c 910echo "pp support $pp"
cddf3f45
GM
911echo "debug symbols $debug"
912echo "optimize $optimize"
bba9b16c 913echo "shared pp $shared_pp"
47930f09 914echo "Video hooking $vhook"
a86b921c
FB
915echo "SDL support $sdl"
916if test $sdl_too_old = "yes"; then
917echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
918fi
1d0d55da 919echo "risky / patent encumbered codecs $risky"
68892110
PG
920
921if test "$vhook" = "yes" ; then
47930f09 922echo "Imlib2 support $imlib2"
04511d53 923echo "freetype support $freetype2"
68892110 924fi
f80f7964 925echo "Sun medialib support" $sunmlib
9c3d33d6 926echo "pthreads support" $pthreads
bc634f6f
ZK
927echo "AMR-NB float support" $amr_nb
928echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 929echo "AMR-WB float support" $amr_wb
de6d9b64 930
980fc7b8 931echo "Creating config.mak and config.h"
de6d9b64 932
980fc7b8 933echo "# Automatically generated by configure - do not modify" > config.mak
045ed63f 934echo "/* Automatically generated by configure - do not modify */" > $TMPH
de6d9b64 935
980fc7b8 936echo "prefix=$prefix" >> config.mak
951bf3e6 937echo "bindir=$bindir" >> config.mak
23a65308 938echo "mandir=$mandir" >> config.mak
4a908fbc 939echo "MAKE=$make" >> config.mak
980fc7b8
FB
940echo "CC=$cc" >> config.mak
941echo "AR=$ar" >> config.mak
be7109c1 942echo "RANLIB=$ranlib" >> config.mak
0f3cb305 943echo "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).
947SHCFLAGS=$CFLAGS
948if test "$needmdynamicnopic" = yes; then
949 CFLAGS="$CFLAGS -mdynamic-no-pic"
950fi
951
a9b3f630 952echo "OPTFLAGS=$CFLAGS" >> config.mak
75388c74 953echo "SHCFLAGS=$SHCFLAGS">>config.mak
0f3cb305 954echo "LDFLAGS=$LDFLAGS" >> config.mak
4baca069 955echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 956echo "SHFLAGS=$SHFLAGS" >> config.mak
f3ec2d46
SG
957echo "LIBPREF=$LIBPREF" >> config.mak
958echo "LIBSUF=$LIBSUF" >> config.mak
959echo "SLIBPREF=$SLIBPREF" >> config.mak
960echo "SLIBSUF=$SLIBSUF" >> config.mak
951bf3e6 961echo "EXESUF=$EXESUF" >> config.mak
6852ac95 962echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 963if test "$cpu" = "x86" ; then
980fc7b8 964 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 965 echo "#define ARCH_X86 1" >> $TMPH
0f3cb305 966elif test "$cpu" = "armv4l" ; then
6ed7422a 967 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 968 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 969elif test "$cpu" = "alpha" ; then
91d1f1a4 970 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 971 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
972elif test "$cpu" = "sparc64" ; then
973 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
974 echo "#define ARCH_SPARC64 1" >> $TMPH
0f3cb305
FB
975elif 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
981elif test "$cpu" = "mips" ; then
982 echo "TARGET_ARCH_MIPS=yes" >> config.mak
983 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
984elif test "$cpu" = "sh4" ; then
985 echo "TARGET_ARCH_SH4=yes" >> config.mak
986 echo "#define ARCH_SH4 1" >> $TMPH
987fi
a4adb608 988echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
989if test "$bigendian" = "yes" ; then
990 echo "WORDS_BIGENDIAN=yes" >> config.mak
991 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 992fi
d2a9bddd
MN
993if test "$inttypes" != "yes" ; then
994 echo "#define EMULATE_INTTYPES 1" >> $TMPH
7f965c1c 995fi
b5c950c4 996if test "$emu_fast_int" = "yes" ; then
19d053c5 997 echo "#define EMULATE_FAST_INT 1" >> $TMPH
b5c950c4 998fi
57514323 999if 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 1003fi
52b41d7f
FB
1004if test "$builtin_vector" = "yes" ; then
1005 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1006 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1007fi
d46aba26
LS
1008if test "$mmi" = "yes" ; then
1009 echo "TARGET_MMI=yes" >> config.mak
1010 echo "#define HAVE_MMI 1" >> $TMPH
1011fi
ab6c65f6
BF
1012if 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 1022fi
57514323 1023if test "$gprof" = "yes" ; then
980fc7b8 1024 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 1025 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 1026fi
5e4639e2
GM
1027if test "$localtime_r" = "yes" ; then
1028 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 1029fi
68892110
PG
1030if test "$imlib2" = "yes" ; then
1031 echo "HAVE_IMLIB2=yes" >> config.mak
1032fi
04511d53
PG
1033if test "$freetype2" = "yes" ; then
1034 echo "HAVE_FREETYPE2=yes" >> config.mak
1035fi
f80f7964
RS
1036if test "$sunmlib" = "yes" ; then
1037 echo "HAVE_MLIB=yes" >> config.mak
1038 echo "#define HAVE_MLIB 1" >> $TMPH
1039 extralibs="$extralibs -lmlib"
1040fi
9c3d33d6
MN
1041if test "$pthreads" = "yes" ; then
1042 echo "HAVE_PTHREADS=yes" >> config.mak
1043 echo "#define HAVE_PTHREADS 1" >> $TMPH
1044 extralibs="$extralibs -lpthread"
1045fi
a86b921c
FB
1046if 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
1050fi
95e2ce4a
MN
1051if test "$have_lrintf" = "yes" ; then
1052 echo "#define HAVE_LRINTF 1" >> $TMPH
1053fi
68892110
PG
1054if test "$vhook" = "yes" ; then
1055 echo "BUILD_VHOOK=yes" >> config.mak
1056 echo "#define HAVE_VHOOK 1" >> $TMPH
9c938e77 1057 extralibs="$extralibs $ldl"
68892110 1058fi
57514323 1059if test "$lshared" = "yes" ; then
0319c531 1060 echo "BUILD_SHARED=yes" >> config.mak
5cbcf02c 1061 echo "PIC=-fPIC" >> config.mak
0319c531 1062fi
ef0bc4c9 1063echo "EXTRALIBS=$extralibs" >> config.mak
258207b7
FB
1064version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1065 cut -d '"' -f 2`
1066echo "VERSION=$version" >>config.mak
d771bcae 1067# if you do not want to use encoders, disable that.
045ed63f 1068echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
1069echo "CONFIG_ENCODERS=yes" >> config.mak
1070
1071# if you do not want to use decoders, disable that.
045ed63f 1072echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
1073echo "CONFIG_DECODERS=yes" >> config.mak
1074
5cbcf02c
FB
1075# AC3
1076if 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
1084fi
1085
bba9b16c
MN
1086# PP
1087if 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
1095fi
1096
1eb2212e
FB
1097# mpeg audio high precision mode
1098if test "$mpegaudio_hp" = "yes" ; then
1099 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1100fi
1101
5cbcf02c
FB
1102if test "$v4l" = "yes" ; then
1103 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1104 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1105fi
1106
8aa3ee32
MK
1107if test "$dv1394" = "yes" ; then
1108 echo "#define CONFIG_DV1394 1" >> $TMPH
1109 echo "CONFIG_DV1394=yes" >> config.mak
1110fi
1111
adbc0510
PG
1112if test "$dlopen" = "yes" ; then
1113 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1114fi
1115
1116if test "$dlfcn" = "yes" ; then
1117 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1118fi
1119
5cbcf02c
FB
1120if test "$audio_oss" = "yes" ; then
1121 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1122 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1123fi
1124
dfdfa47c
FR
1125if test "$audio_beos" = "yes" ; then
1126 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1127 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1128fi
1129
5cbcf02c
FB
1130if test "$network" = "yes" ; then
1131 echo "#define CONFIG_NETWORK 1" >> $TMPH
1132 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1133fi
daf8e955 1134
0147f198
FR
1135if test "$zlib" = "yes" ; then
1136 echo "#define CONFIG_ZLIB 1" >> $TMPH
1137 echo "CONFIG_ZLIB=yes" >> config.mak
1138fi
1139
57514323 1140if test "$mp3lame" = "yes" ; then
045ed63f 1141 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1142 echo "CONFIG_MP3LAME=yes" >> config.mak
1143fi
1144
81e0d0b4
MH
1145if test "$vorbis" = "yes" ; then
1146 echo "#define CONFIG_VORBIS 1" >> $TMPH
1147 echo "CONFIG_VORBIS=yes" >> config.mak
1148fi
1149
0fc50e58
ZK
1150if test "$faad" = "yes" ; then
1151 echo "#define CONFIG_FAAD 1" >> $TMPH
1152 echo "CONFIG_FAAD=yes" >> config.mak
1153fi
1154
1155if test "$faadbin" = "yes" ; then
1156 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1157 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1158fi
1159
29d48296
MN
1160if test "$faac" = "yes" ; then
1161 echo "#define CONFIG_FAAC 1" >> $TMPH
1162 echo "CONFIG_FAAC=yes" >> config.mak
1163fi
1164
732d9245
BE
1165if test "$mingw32" = "yes" ; then
1166 echo "#define CONFIG_WIN32 1" >> $TMPH
1167 echo "CONFIG_WIN32=yes" >> config.mak
7eea5766 1168 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1169 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1170 echo "#endif" >> $TMPH
3f027ca7
FB
1171fi
1172
f3ec2d46
SG
1173if test "$os2" = "yes" ; then
1174 echo "#define CONFIG_OS2 1" >> $TMPH
1175 echo "CONFIG_OS2=yes" >> config.mak
1176fi
1177
6e023978
RS
1178if test "$TARGET_OS" = "SunOS" ; then
1179 echo "#define CONFIG_SUNOS 1" >> $TMPH
1180fi
1181
90cee0c3
MN
1182if test "$darwin" = "yes"; then
1183 echo "#define CONFIG_DARWIN 1" >> $TMPH
1184 echo "CONFIG_DARWIN=yes" >> config.mak
1185fi
1186
57514323 1187if test "$_malloc_h" = "yes" ; then
045ed63f 1188 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1189else
045ed63f 1190 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1191fi
1192
57514323 1193if test "$_memalign" = "yes" ; then
045ed63f
ZK
1194 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1195else
1196 echo "#undef HAVE_MEMALIGN" >> $TMPH
1197fi
1198
26b35efb
FR
1199if test "$netserver" = "yes" ; then
1200 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1201 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1202fi
1203
4baca069
PG
1204if test "$need_inet_aton" = "yes" ; then
1205 echo "NEED_INET_ATON=yes" >> config.mak
1206fi
1207
57514323 1208if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1209 echo "#define SIMPLE_IDCT 1" >> $TMPH
1210fi
1211
8154d2e0
FB
1212if test "$ffserver" = "yes" ; then
1213 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1214 echo "CONFIG_FFSERVER=yes" >> config.mak
1215fi
1216
a86b921c
FB
1217if test "$ffplay" = "yes" ; then
1218 echo "CONFIG_FFPLAY=yes" >> config.mak
1219fi
1220
1d0d55da
MN
1221if test "$risky" = "yes" ; then
1222 echo "#define CONFIG_RISKY 1" >> $TMPH
1223 echo "CONFIG_RISKY=yes" >> config.mak
1224fi
1225
c13e1abd
FH
1226echo "#define restrict $_restrict" >> $TMPH
1227
0f3cb305
FB
1228# build tree in object directory if source path is different from current one
1229if test "$source_path_used" = "yes" ; then
a382b927 1230 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
5f6b58de
MR
1231 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1232 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
0f3cb305
FB
1233 for dir in $DIRS ; do
1234 mkdir -p $dir
1235 done
1236 for f in $FILES ; do
1237 ln -sf $source_path/$f $f
1238 done
1239fi
1240echo "SRC_PATH=$source_path" >> config.mak
1241
d663a1fd
MN
1242if test "$amr_wb" = "yes" ; then
1243 echo "#define AMR_WB 1" >> $TMPH
1244 echo "AMR_WB=yes" >> config.mak
1245 echo
1246 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1247 echo "V5.1.0 from "
1248 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1249 echo "and extracted the source to libavcodec/amrwb_float"
1250 echo
1251fi
1252
891f64b3 1253if test "$amr_nb" = "yes" ; then
1254 echo "#define AMR_NB 1" >> $TMPH
1255 echo "AMR_NB=yes" >> config.mak
1256 echo
bc634f6f
ZK
1257if test "$amr_nb_fixed" = "yes" ; then
1258 echo "AMR_NB_FIXED=yes" >> config.mak
1259 echo "#define AMR_NB_FIXED 1" >> $TMPH
1260 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1261 echo "REL-5 version 5.1.0 from "
891f64b3 1262 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1263 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
1264 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1265 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1266 echo
1267else
1268 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1269 echo "REL-5 V5.1.0 from "
1270 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1271 echo "and extracted the source to libavcodec/amr_float"
821e46f4 1272 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
891f64b3 1273 echo
1274fi
1275
bc634f6f
ZK
1276fi
1277
a7c02e25 1278diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
1279if test $? -ne 0 ; then
1280 mv -f $TMPH config.h
3d204385 1281else
045ed63f 1282 echo "config.h is unchanged"
3d204385
NK
1283fi
1284
f3ec2d46 1285rm -f $TMPO $TMPC $TMPE $TMPS $TMPH