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