sample_rate and channels in aac audio patch by (Luca Abeni <lucabe72 at email dot...
[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 ;;
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 ;;
130esac
131gprof="no"
5cbcf02c
FB
132v4l="yes"
133audio_oss="yes"
dfdfa47c 134audio_beos="no"
8aa3ee32 135dv1394="yes"
5cbcf02c 136network="yes"
0147f198 137zlib="yes"
a6741398 138mp3lame="no"
81e0d0b4 139vorbis="no"
0fc50e58
ZK
140faad="no"
141faadbin="no"
29d48296 142faac="no"
ba9261e5 143a52="no"
57514323 144a52bin="no"
ba9261e5 145pp="no"
bba9b16c 146shared_pp="no"
732d9245 147mingw32="no"
3f027ca7 148cygwin="no"
f3ec2d46 149os2="no"
83286d2a 150lshared="no"
cddf3f45
GM
151optimize="yes"
152debug="yes"
ef0bc4c9 153extralibs="-lm"
c02dbee1 154simpleidct="yes"
0f3cb305 155bigendian="no"
7f965c1c 156inttypes="yes"
b5c950c4 157emu_fast_int="no"
a8721c09 158vhook="default"
adbc0510
PG
159dlfcn="no"
160dlopen="no"
1eb2212e 161mpegaudio_hp="yes"
e1707f52 162SHFLAGS=-shared
26b35efb 163netserver="no"
4baca069 164need_inet_aton="no"
8154d2e0 165ffserver="yes"
a86b921c 166ffplay="yes"
4baca069
PG
167LDFLAGS=-Wl,--warn-common
168FFSLDFLAGS=-Wl,-E
f3ec2d46
SG
169LIBPREF="lib"
170LIBSUF=".a"
171SLIBPREF="lib"
172SLIBSUF=".so"
951bf3e6 173EXESUF=""
1d0d55da 174risky="yes"
891f64b3 175amr_nb="no"
d663a1fd 176amr_wb="no"
bc634f6f 177amr_nb_fixed="no"
f80f7964 178sunmlib="no"
9c3d33d6 179pthreads="no"
b2e3c528 180gpl="no"
ef0bc4c9
FR
181
182# OS specific
183targetos=`uname -s`
184case $targetos in
185BeOS)
186prefix="/boot/home/config"
187# helps building libavcodec
cddf3f45 188CFLAGS="-DPIC -fomit-frame-pointer"
31ba0b4d 189# 3 gcc releases known for BeOS, each with ugly bugs
b2924696 190gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
31ba0b4d
FR
191case "$gcc_version" in
1922.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
193mmx="no"
194;;
195*20010315*) echo "BeBits gcc"
196CFLAGS="$CFLAGS -fno-expensive-optimizations"
197;;
198esac
e1707f52
MN
199SHFLAGS=-nostart
200# disable linux things
201audio_oss="no"
5cbcf02c 202v4l="no"
8aa3ee32 203dv1394="no"
dfdfa47c
FR
204# enable beos things
205audio_beos="yes"
ef0bc4c9
FR
206# no need for libm, but the inet stuff
207# Check for BONE
208if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
209extralibs="-lbind -lsocket"
210else
26b35efb 211netserver="yes"
4baca069 212need_inet_aton="yes"
26b35efb 213extralibs="-lnet"
ef0bc4c9 214fi ;;
4baca069
PG
215SunOS)
216v4l="no"
217audio_oss="no"
8aa3ee32 218dv1394="no"
4baca069
PG
219make="gmake"
220LDFLAGS=""
221FFSLDFLAGS=""
222need_inet_aton="yes"
223extralibs="$extralibs -lsocket -lnsl"
224;;
9c938e77
PG
225FreeBSD)
226v4l="no"
227audio_oss="yes"
8aa3ee32 228dv1394="no"
9c938e77 229make="gmake"
12043e1d
SS
230CFLAGS="-pthread"
231LDFLAGS="$LDFLAGS -export-dynamic -pthread"
9c938e77 232;;
4a908fbc 233BSD/OS)
5cbcf02c 234v4l="no"
6063bce7 235audio_oss="yes"
8aa3ee32 236dv1394="no"
4a908fbc
AB
237extralibs="-lpoll -lgnugetopt -lm"
238make="gmake"
239;;
90cee0c3 240Darwin)
a43bd1d7 241cc="cc"
90cee0c3
MN
242v4l="no"
243audio_oss="no"
8aa3ee32 244dv1394="no"
d3b15036 245ffserver="no"
a43bd1d7 246SHFLAGS="-dynamiclib"
90cee0c3 247extralibs=""
a43bd1d7 248darwin="yes"
47930f09 249strip="strip -x"
4850b2d2 250LDFLAGS="-Wl,-d"
4baca069 251FFSLDFLAGS=-Wl,-bind_at_load
90cee0c3 252;;
732d9245 253MINGW32*)
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
256mingw32="yes"
257;;
3f027ca7
FB
258CYGWIN*)
259v4l="no"
260audio_oss="yes"
8aa3ee32 261dv1394="no"
3f027ca7
FB
262extralibs=""
263cygwin="yes"
264test -f /usr/include/inttypes.h || \
265test -f /usr/local/include/inttypes.h || \
266echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
267 "/usr/include/inttypes.h !!!"
268;;
b55e4ef4 269Linux)
4baca069 270LDFLAGS="$LDFLAGS -rdynamic"
b55e4ef4 271;;
99614dd4
MB
272IRIX*)
273ranlib="echo ignoring ranlib"
274v4l="no"
275audio_oss="no"
276make="gmake"
277;;
f3ec2d46
SG
278OS/2)
279TMPE=$TMPE".exe"
69db4e10
SG
280ar="emxomfar -p64"
281ranlib="echo ignoring ranlib"
282strip="echo ignoring strip"
cddf3f45 283CFLAGS="-Zomf"
69db4e10 284LDFLAGS="-Zomf -Zstack 16384 -s"
f3ec2d46
SG
285SHFLAGS=""
286FFSLDFLAGS=""
287LIBPREF=""
288LIBSUF=".lib"
289SLIBPREF=""
290SLIBSUF=".dll"
951bf3e6 291EXESUF=".exe"
f3ec2d46
SG
292extralibs=""
293v4l="no"
294audio_oss="no"
8aa3ee32 295dv1394="no"
f3ec2d46
SG
296network="no"
297ffserver="no"
298os2="yes"
299;;
ef0bc4c9
FR
300*) ;;
301esac
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
306TARGET_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 327source_path="`echo $0 | sed -e 's#/configure##'`"
0f3cb305
FB
328source_path_used="yes"
329if test -z "$source_path" -o "$source_path" = "." ; then
330 source_path=`pwd`
331 source_path_used="no"
de6d9b64
FB
332fi
333
334for 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
431done
432
b2e3c528
MN
433if 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; }
448EOF
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; }
457EOF
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
473fi
474
0f3cb305
FB
475# compute mmx state
476if test $mmx = "default"; then
477 if test $cpu = "x86"; then
478 mmx="yes"
479 else
480 mmx="no"
481 fi
482fi
483
cf9d24ad 484#Darwin CC versions
75388c74 485needmdynamicnopic="no"
cf9d24ad 486if 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
509fi
510
ab6c65f6
BF
511# Can only do AltiVec on PowerPC
512if test $altivec = "default"; then
513 if test $cpu = "powerpc"; then
514 altivec="yes"
515 else
516 altivec="no"
517 fi
518fi
519
a4adb608
MN
520# Add processor-specific flags
521TUNECPU="generic"
9007f514 522POWERPCMODE="32bits"
a4adb608
MN
523if 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
579fi
580
cf9d24ad 581# AltiVec flags: The FSF version of GCC differs from the Apple version
b6e52719
MD
582if 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
590fi
591
a9a07762
MN
592# See if we have <altivec.h>
593cat > $TMPC << EOF
594#include <altivec.h>
595int main( void ) { return 0; }
596EOF
597
598_altivec_h="no"
b6e52719 599if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
a9a07762
MN
600_altivec_h="yes"
601fi
602
ab6c65f6
BF
603# See does our compiler support Motorola AltiVec C API
604if test $altivec = "yes"; then
a9a07762 605if test $_altivec_h = "yes"; then
ab6c65f6 606cat > $TMPC << EOF
a9a07762 607#include <altivec.h>
ab6c65f6
BF
608int main(void) {
609 vector signed int v1, v2, v3;
610 v1 = vec_add(v2,v3);
611 return 0;
612}
613EOF
a9a07762
MN
614else
615cat > $TMPC << EOF
616int main(void) {
617 vector signed int v1, v2, v3;
618 v1 = vec_add(v2,v3);
619 return 0;
620}
621EOF
622fi
b6e52719 623$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
ab6c65f6
BF
624fi
625
d46aba26
LS
626# Can only do mmi on mips
627if test $mmi = "default"; then
628 if test $cpu = "mips"; then
629 mmi="yes"
630 else
631 mmi="no"
632 fi
633fi
634
635# See does our compiler support mmi
636if test $mmi = "yes"; then
637cat > $TMPC << EOF
638int main(void) {
639 __asm__ ("lq \$2, 0(\$2)");
640 return 0;
641}
642EOF
f3ec2d46 643$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
d46aba26
LS
644fi
645
732d9245 646if 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
659fi
660
0f3cb305
FB
661cc="${cross_prefix}${cc}"
662ar="${cross_prefix}${ar}"
be7109c1 663ranlib="${cross_prefix}${ranlib}"
0f3cb305
FB
664strip="${cross_prefix}${strip}"
665
487a54d7
FB
666if test -z "$cross_prefix" ; then
667
3d204385 668# ---
a3999908
MN
669# big/little endian test
670cat > $TMPC << EOF
671#include <inttypes.h>
672int main(int argc, char ** argv){
673 volatile uint32_t i=0x01234567;
674 return (*((uint8_t*)(&i))) == 0x67;
675}
676EOF
677
f3ec2d46
SG
678if $cc -o $TMPE $TMPC 2>/dev/null ; then
679$TMPE && bigendian="yes"
a3999908
MN
680else
681echo big/little test failed
682fi
683
487a54d7
FB
684else
685
686# if cross compiling, cannot launch a program, so make a static guess
687if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
688 bigendian="yes"
689fi
690
691fi
692
a3999908 693# ---
7f965c1c
CF
694# *inttypes.h* test
695cat > $TMPC << EOF
696#include <inttypes.h>
697int main(int argc, char ** argv){
698 return 0;
699}
700EOF
701
702$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
703
704# ---
b5c950c4
MN
705# *int_fast* test
706cat > $TMPC << EOF
707#include <inttypes.h>
708int main(int argc, char ** argv){
709 volatile uint_fast64_t i=0x01234567;
710 return 0;
711}
712EOF
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
719cat > $TMPC << EOF
720#include <malloc.h>
721int main( void ) { return 0; }
722EOF
723
724_memalign=no
725_malloc_h=no
f3ec2d46 726if $cc -o $TMPE $TMPC 2> /dev/null ; then
3d204385
NK
727_malloc_h=yes
728_memalign=yes
729# check for memalign - atmos
730cat > $TMPC << EOF
731#include <malloc.h>
732int main ( void ) {
733char *string = NULL;
734string = memalign(64, sizeof(char));
735return 0;
736}
737EOF
f3ec2d46 738$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
3d204385
NK
739fi
740
68892110 741cat > $TMPC << EOF
5e4639e2
GM
742#include <time.h>
743int main( void ) { localtime_r(NULL, NULL); }
744EOF
745
746localtime_r=no
747if $cc -o $TMPE $TMPC 2> /dev/null ; then
748 localtime_r=yes
749fi
750
0147f198
FR
751if test "$zlib" = "yes"; then
752# check for zlib - mmu_man
753cat > $TMPC << EOF
754#include <zlib.h>
755int main ( void ) {
756if (zlibVersion() != ZLIB_VERSION)
757 puts("zlib version differs !!!");
758 return 1;
759return 0;
760}
761EOF
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
765fi
766if test "$zlib" = "yes"; then
767extralibs="$extralibs -lz"
768fi
769
95e2ce4a
MN
770# test for lrintf in math.h
771cat > $TMPC << EOF
772#define _ISOC9X_SOURCE 1
773#include <math.h>
774int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
775EOF
776
777have_lrintf="no"
f3ec2d46 778if $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
781fi
782
c13e1abd
FH
783_restrict=
784for 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
790done
791
52b41d7f
FB
792# test gcc version to see if vector builtins can be used
793# currently only used on i386 for MMX builtins
794cat > $TMPC << EOF
795int main(void) {
796#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
797return 0;
798#else
799#error no vector builtins
800#endif
801}
802EOF
803
804builtin_vector=no
805if $cc -o $TMPO $TMPC 2> /dev/null ; then
806 builtin_vector=yes
a8721c09
FB
807fi
808
809# dlopen/dlfcn.h probing
810
811cat > $TMPC << EOF
812#include <dlfcn.h>
813int main( void ) { return (int) dlopen("foo", 0); }
814EOF
815
816ldl=-ldl
817
cf9d24ad 818if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
819dlfcn=yes
820dlopen=yes
821fi
822
cf9d24ad 823if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
824dlfcn=yes
825dlopen=yes
826ldl=""
827fi
828
829cat > $TMPC << EOF
830int main( void ) { return (int) dlopen("foo", 0); }
831EOF
832
cf9d24ad 833if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
834dlopen=yes
835fi
836
cf9d24ad 837if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
838dlopen=yes
839ldl=""
840fi
841
842if test "$vhook" = "default" ; then
843 vhook="$dlopen"
844fi
845
a86b921c
FB
846##########################################
847# imlib probe
848
a8721c09
FB
849cat > $TMPC << EOF
850#include <X11/Xlib.h>
851#include <Imlib2.h>
852int main( void ) { return (int) imlib_load_font("foo"); }
853EOF
854
855imlib2=no
7802d373 856if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
a8721c09 857imlib2=yes
52b41d7f
FB
858fi
859
a86b921c
FB
860##########################################
861# freetype probe
862
04511d53
PG
863cat > $TMPC << EOF
864#include <ft2build.h>
865int main( void ) { return (int) FT_Init_FreeType(0); }
866EOF
867
868freetype2=no
69db4e10 869if 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
875fi
876
a86b921c
FB
877##########################################
878# SDL probe
879
880cat > $TMPC << EOF
881#include <SDL.h>
31319a8c 882#undef main /* We don't want SDL to override our main() */
a86b921c
FB
883int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
884EOF
885
886sdl_too_old=no
887sdl=no
c3f6b472 888if sdl-config --version >/dev/null 2>&1 ; then
cf9d24ad 889if $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'`
891if test "$_sdlversion" -lt 121 ; then
892sdl_too_old=yes
893else
894sdl=yes
895fi
896fi
c3f6b472 897fi
a86b921c 898
b2924696 899case "`$cc -v 2>&1 | grep version`" in
cf9d24ad
DC
900 *gcc*)
901 CFLAGS="-Wall $CFLAGS"
902 ;;
903 *)
904 ;;
905esac
906
94a3401e
FB
907if test "$sdl" = "no" ; then
908 ffplay=no
909fi
910
cddf3f45 911if test "$debug" = "yes"; then
7906085f 912 CFLAGS="-g $CFLAGS"
cddf3f45
GM
913fi
914
915if test "$optimize" = "small"; then
98ca7790 916# CFLAGS=${CFLAGS//-O3/-Os}
553a6284
MN
917 CFLAGS="$CFLAGS -Os"
918fi
919
cddf3f45 920if 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
927fi
928
951bf3e6
FB
929if test x"$bindir" = x""; then
930bindir="${prefix}/bin"
931fi
932
23a65308
FB
933if test x"$mandir" = x""; then
934mandir="${prefix}/man"
935fi
936
de6d9b64 937echo "Install prefix $prefix"
0f3cb305 938echo "Source path $source_path"
de6d9b64 939echo "C compiler $cc"
4a908fbc 940echo "make $make"
a4adb608 941echo "CPU $cpu ($tune)"
0f3cb305 942echo "Big Endian $bigendian"
7f965c1c 943echo "inttypes.h $inttypes"
b5c950c4 944echo "broken inttypes.h $emu_fast_int"
e41e8342 945if test $cpu = "x86"; then
de6d9b64 946echo "MMX enabled $mmx"
52b41d7f 947echo "Vector Builtins $builtin_vector"
e41e8342
FB
948fi
949if test $cpu = "mips"; then
d46aba26 950echo "MMI enabled $mmi"
e41e8342
FB
951fi
952if test $cpu = "powerpc"; then
ab6c65f6 953echo "AltiVec enabled $altivec"
e41e8342 954fi
de6d9b64 955echo "gprof enabled $gprof"
0147f198 956echo "zlib enabled $zlib"
a6741398 957echo "mp3lame enabled $mp3lame"
81e0d0b4 958echo "vorbis enabled $vorbis"
445ad18d
ZK
959echo "faad enabled $faad"
960echo "faadbin enabled $faadbin"
29d48296 961echo "faac enabled $faac"
5cbcf02c 962echo "a52 support $a52"
57514323 963echo "a52 dlopened $a52bin"
bba9b16c 964echo "pp support $pp"
cddf3f45
GM
965echo "debug symbols $debug"
966echo "optimize $optimize"
bba9b16c 967echo "shared pp $shared_pp"
47930f09 968echo "Video hooking $vhook"
a86b921c
FB
969echo "SDL support $sdl"
970if test $sdl_too_old = "yes"; then
971echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
972fi
1d0d55da 973echo "risky / patent encumbered codecs $risky"
68892110
PG
974
975if test "$vhook" = "yes" ; then
47930f09 976echo "Imlib2 support $imlib2"
04511d53 977echo "freetype support $freetype2"
68892110 978fi
f80f7964 979echo "Sun medialib support" $sunmlib
9c3d33d6 980echo "pthreads support" $pthreads
bc634f6f
ZK
981echo "AMR-NB float support" $amr_nb
982echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 983echo "AMR-WB float support" $amr_wb
b2e3c528
MN
984if test "$gpl" = "no" ; then
985echo "License: LGPL"
986else
987echo "License: GPL"
988fi
de6d9b64 989
980fc7b8 990echo "Creating config.mak and config.h"
de6d9b64 991
980fc7b8 992echo "# Automatically generated by configure - do not modify" > config.mak
045ed63f 993echo "/* Automatically generated by configure - do not modify */" > $TMPH
de6d9b64 994
980fc7b8 995echo "prefix=$prefix" >> config.mak
951bf3e6 996echo "bindir=$bindir" >> config.mak
23a65308 997echo "mandir=$mandir" >> config.mak
4a908fbc 998echo "MAKE=$make" >> config.mak
980fc7b8
FB
999echo "CC=$cc" >> config.mak
1000echo "AR=$ar" >> config.mak
be7109c1 1001echo "RANLIB=$ranlib" >> config.mak
0f3cb305 1002echo "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).
1006SHCFLAGS=$CFLAGS
1007if test "$needmdynamicnopic" = yes; then
1008 CFLAGS="$CFLAGS -mdynamic-no-pic"
1009fi
1010
a9b3f630 1011echo "OPTFLAGS=$CFLAGS" >> config.mak
75388c74 1012echo "SHCFLAGS=$SHCFLAGS">>config.mak
0f3cb305 1013echo "LDFLAGS=$LDFLAGS" >> config.mak
4baca069 1014echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 1015echo "SHFLAGS=$SHFLAGS" >> config.mak
f3ec2d46
SG
1016echo "LIBPREF=$LIBPREF" >> config.mak
1017echo "LIBSUF=$LIBSUF" >> config.mak
1018echo "SLIBPREF=$SLIBPREF" >> config.mak
1019echo "SLIBSUF=$SLIBSUF" >> config.mak
951bf3e6 1020echo "EXESUF=$EXESUF" >> config.mak
6852ac95 1021echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 1022if test "$cpu" = "x86" ; then
980fc7b8 1023 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 1024 echo "#define ARCH_X86 1" >> $TMPH
0f3cb305 1025elif test "$cpu" = "armv4l" ; then
6ed7422a 1026 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 1027 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 1028elif test "$cpu" = "alpha" ; then
91d1f1a4 1029 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 1030 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
1031elif 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
1036elif test "$cpu" = "sparc" ; then
1037 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1038 echo "#define ARCH_SPARC 1" >> $TMPH
0f3cb305
FB
1039elif 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
1050elif test "$cpu" = "mips" ; then
1051 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1052 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
1053elif test "$cpu" = "sh4" ; then
1054 echo "TARGET_ARCH_SH4=yes" >> config.mak
1055 echo "#define ARCH_SH4 1" >> $TMPH
1056fi
a4adb608 1057echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
1058if test "$bigendian" = "yes" ; then
1059 echo "WORDS_BIGENDIAN=yes" >> config.mak
1060 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 1061fi
d2a9bddd
MN
1062if test "$inttypes" != "yes" ; then
1063 echo "#define EMULATE_INTTYPES 1" >> $TMPH
7f965c1c 1064fi
b5c950c4 1065if test "$emu_fast_int" = "yes" ; then
19d053c5 1066 echo "#define EMULATE_FAST_INT 1" >> $TMPH
b5c950c4 1067fi
57514323 1068if 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 1072fi
52b41d7f
FB
1073if test "$builtin_vector" = "yes" ; then
1074 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1075 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1076fi
d46aba26
LS
1077if test "$mmi" = "yes" ; then
1078 echo "TARGET_MMI=yes" >> config.mak
1079 echo "#define HAVE_MMI 1" >> $TMPH
1080fi
ab6c65f6
BF
1081if 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 1091fi
57514323 1092if test "$gprof" = "yes" ; then
980fc7b8 1093 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 1094 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 1095fi
5e4639e2
GM
1096if test "$localtime_r" = "yes" ; then
1097 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 1098fi
68892110
PG
1099if test "$imlib2" = "yes" ; then
1100 echo "HAVE_IMLIB2=yes" >> config.mak
1101fi
04511d53
PG
1102if test "$freetype2" = "yes" ; then
1103 echo "HAVE_FREETYPE2=yes" >> config.mak
1104fi
f80f7964
RS
1105if test "$sunmlib" = "yes" ; then
1106 echo "HAVE_MLIB=yes" >> config.mak
1107 echo "#define HAVE_MLIB 1" >> $TMPH
1108 extralibs="$extralibs -lmlib"
1109fi
9c3d33d6
MN
1110if 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 1116fi
a86b921c
FB
1117if 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
1121fi
95e2ce4a
MN
1122if test "$have_lrintf" = "yes" ; then
1123 echo "#define HAVE_LRINTF 1" >> $TMPH
1124fi
68892110
PG
1125if test "$vhook" = "yes" ; then
1126 echo "BUILD_VHOOK=yes" >> config.mak
1127 echo "#define HAVE_VHOOK 1" >> $TMPH
9c938e77 1128 extralibs="$extralibs $ldl"
68892110 1129fi
57514323 1130if test "$lshared" = "yes" ; then
0319c531 1131 echo "BUILD_SHARED=yes" >> config.mak
5cbcf02c 1132 echo "PIC=-fPIC" >> config.mak
0319c531 1133fi
ef0bc4c9 1134echo "EXTRALIBS=$extralibs" >> config.mak
258207b7
FB
1135version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1136 cut -d '"' -f 2`
1137echo "VERSION=$version" >>config.mak
d771bcae 1138# if you do not want to use encoders, disable that.
045ed63f 1139echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
1140echo "CONFIG_ENCODERS=yes" >> config.mak
1141
1142# if you do not want to use decoders, disable that.
045ed63f 1143echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
1144echo "CONFIG_DECODERS=yes" >> config.mak
1145
5cbcf02c
FB
1146# AC3
1147if 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
1155fi
1156
bba9b16c
MN
1157# PP
1158if 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
1166fi
1167
1eb2212e
FB
1168# mpeg audio high precision mode
1169if test "$mpegaudio_hp" = "yes" ; then
1170 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1171fi
1172
5cbcf02c
FB
1173if test "$v4l" = "yes" ; then
1174 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1175 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1176fi
1177
8aa3ee32
MK
1178if test "$dv1394" = "yes" ; then
1179 echo "#define CONFIG_DV1394 1" >> $TMPH
1180 echo "CONFIG_DV1394=yes" >> config.mak
1181fi
1182
adbc0510
PG
1183if test "$dlopen" = "yes" ; then
1184 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1185fi
1186
1187if test "$dlfcn" = "yes" ; then
1188 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1189fi
1190
5cbcf02c
FB
1191if test "$audio_oss" = "yes" ; then
1192 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1193 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1194fi
1195
dfdfa47c
FR
1196if test "$audio_beos" = "yes" ; then
1197 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1198 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1199fi
1200
5cbcf02c
FB
1201if test "$network" = "yes" ; then
1202 echo "#define CONFIG_NETWORK 1" >> $TMPH
1203 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1204fi
daf8e955 1205
0147f198
FR
1206if test "$zlib" = "yes" ; then
1207 echo "#define CONFIG_ZLIB 1" >> $TMPH
1208 echo "CONFIG_ZLIB=yes" >> config.mak
1209fi
1210
57514323 1211if test "$mp3lame" = "yes" ; then
045ed63f 1212 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1213 echo "CONFIG_MP3LAME=yes" >> config.mak
1214fi
1215
81e0d0b4
MH
1216if test "$vorbis" = "yes" ; then
1217 echo "#define CONFIG_VORBIS 1" >> $TMPH
1218 echo "CONFIG_VORBIS=yes" >> config.mak
1219fi
1220
0fc50e58
ZK
1221if test "$faad" = "yes" ; then
1222 echo "#define CONFIG_FAAD 1" >> $TMPH
1223 echo "CONFIG_FAAD=yes" >> config.mak
1224fi
1225
1226if test "$faadbin" = "yes" ; then
1227 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1228 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1229fi
1230
29d48296
MN
1231if test "$faac" = "yes" ; then
1232 echo "#define CONFIG_FAAC 1" >> $TMPH
1233 echo "CONFIG_FAAC=yes" >> config.mak
1234fi
1235
732d9245
BE
1236if 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
1244fi
1245
f3ec2d46
SG
1246if test "$os2" = "yes" ; then
1247 echo "#define CONFIG_OS2 1" >> $TMPH
1248 echo "CONFIG_OS2=yes" >> config.mak
1249fi
1250
6e023978
RS
1251if test "$TARGET_OS" = "SunOS" ; then
1252 echo "#define CONFIG_SUNOS 1" >> $TMPH
1253fi
1254
90cee0c3
MN
1255if test "$darwin" = "yes"; then
1256 echo "#define CONFIG_DARWIN 1" >> $TMPH
1257 echo "CONFIG_DARWIN=yes" >> config.mak
1258fi
1259
57514323 1260if test "$_malloc_h" = "yes" ; then
045ed63f 1261 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1262else
045ed63f 1263 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1264fi
1265
57514323 1266if test "$_memalign" = "yes" ; then
045ed63f
ZK
1267 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1268else
1269 echo "#undef HAVE_MEMALIGN" >> $TMPH
1270fi
1271
26b35efb
FR
1272if test "$netserver" = "yes" ; then
1273 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1274 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1275fi
1276
4baca069
PG
1277if test "$need_inet_aton" = "yes" ; then
1278 echo "NEED_INET_ATON=yes" >> config.mak
1279fi
1280
57514323 1281if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1282 echo "#define SIMPLE_IDCT 1" >> $TMPH
1283fi
1284
8154d2e0
FB
1285if test "$ffserver" = "yes" ; then
1286 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1287 echo "CONFIG_FFSERVER=yes" >> config.mak
1288fi
1289
a86b921c
FB
1290if test "$ffplay" = "yes" ; then
1291 echo "CONFIG_FFPLAY=yes" >> config.mak
1292fi
1293
1d0d55da
MN
1294if test "$risky" = "yes" ; then
1295 echo "#define CONFIG_RISKY 1" >> $TMPH
1296 echo "CONFIG_RISKY=yes" >> config.mak
1297fi
1298
b2e3c528
MN
1299if test "$gpl" = "yes" ; then
1300 echo "#define CONFIG_GPL 1" >> $TMPH
1301 echo "CONFIG_GPL=yes" >> config.mak
1302fi
1303
c13e1abd
FH
1304echo "#define restrict $_restrict" >> $TMPH
1305
bb801c97
MN
1306if test "$optimize" = "small"; then
1307 echo "#define always_inline" >> $TMPH
1308fi
1309
0f3cb305
FB
1310# build tree in object directory if source path is different from current one
1311if 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
1321fi
1322echo "SRC_PATH=$source_path" >> config.mak
1323
d663a1fd
MN
1324if 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
1333fi
1334
891f64b3 1335if test "$amr_nb" = "yes" ; then
1336 echo "#define AMR_NB 1" >> $TMPH
1337 echo "AMR_NB=yes" >> config.mak
1338 echo
bc634f6f
ZK
1339if 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
1349else
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
1356fi
1357
bc634f6f
ZK
1358fi
1359
a7c02e25 1360diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
1361if test $? -ne 0 ; then
1362 mv -f $TMPH config.h
3d204385 1363else
045ed63f 1364 echo "config.h is unchanged"
3d204385
NK
1365fi
1366
f3ec2d46 1367rm -f $TMPO $TMPC $TMPE $TMPS $TMPH