Fix some #ifdef to allow building amr_wb alone.
[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]"
cc973ecb 16echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
29799f8b
DB
17echo " --mandir=DIR install man page in DIR [PREFIX/man]"
18echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
19echo " --enable-libogg enable Ogg support via libogg [default=no]"
20echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
21echo " --enable-theora enable Theora support via libtheora [default=no]"
22echo " --enable-faad enable FAAD support via libfaad [default=no]"
23echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
24echo " --enable-faac enable FAAC support via libfaac [default=no]"
25echo " --enable-libgsm enable GSM support via libgsm [default=no]"
26echo " --enable-xvid enable XviD support via xvidcore [default=no]"
6662ec29 27echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
29799f8b
DB
28echo " --enable-mingw32 enable MinGW native/cross Windows compile"
29echo " --enable-a52 enable GPLed A52 support [default=no]"
cf9d24ad 30echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
29799f8b
DB
31echo " --enable-dts enable GPLed DTS support [default=no]"
32echo " --enable-pp enable GPLed postprocessing support [default=no]"
cf9d24ad
DC
33echo " --enable-shared-pp use libpostproc.so [default=no]"
34echo " --enable-shared build shared libraries [default=no]"
35echo " --enable-amr_nb enable amr_nb float audio codec"
36echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
64cba748 37echo " --enable-amr_wb enable amr_wb float audio codec"
29799f8b 38echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
cf9d24ad 39echo " --enable-sunmlib use Sun medialib [default=no]"
9c3d33d6 40echo " --enable-pthreads use pthreads [default=no]"
29799f8b
DB
41echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
42echo " and libraw1394 [default=no]"
43echo " --enable-gpl allow use of GPL code, the resulting libav*"
44echo " and ffmpeg will be under GPL [default=no]"
cf9d24ad
DC
45echo ""
46echo "Advanced options (experts only):"
29799f8b
DB
47echo " --source-path=PATH path to source code [$source_path]"
48echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
cf9d24ad
DC
49echo " --cc=CC use C compiler CC [$cc]"
50echo " --make=MAKE use specified make [$make]"
51echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
52echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
53echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
eb94aca9 54echo " --build-suffix=SUFFIX suffix for application specific build []"
cf9d24ad 55echo " --cpu=CPU force cpu to CPU [$cpu]"
29799f8b
DB
56echo " --tune=CPU tune code for a particular CPU"
57echo " (may fail or perform badly on other CPUs)"
58echo " --powerpc-perf-enable enable performance report on PPC"
59echo " (requires enabling PMC)"
60echo " --disable-mmx disable MMX usage"
eba9ae3c 61echo " --disable-iwmmxt disable iwmmxt usage"
cf9d24ad
DC
62echo " --disable-altivec disable AltiVec usage"
63echo " --disable-audio-oss disable OSS audio support [default=no]"
64echo " --disable-audio-beos disable BeOS audio support [default=no]"
65echo " --disable-v4l disable video4linux grabbing [default=no]"
6beefa40 66echo " --disable-bktr disable bktr video grabbing [default=no]"
cf9d24ad
DC
67echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
68echo " --disable-network disable network support [default=no]"
69echo " --disable-zlib disable zlib [default=no]"
70echo " --disable-simple_idct disable simple IDCT routines [default=no]"
71echo " --disable-vhook disable video hooking support"
72echo " --enable-gprof enable profiling with gprof [$gprof]"
73echo " --disable-debug disable debugging symbols"
74echo " --disable-opts disable compiler optimizations"
75echo " --disable-mpegaudio-hp faster (but less accurate)"
29799f8b 76echo " MPEG audio decoding [default=no]"
cf9d24ad
DC
77echo " --disable-ffserver disable ffserver build"
78echo " --disable-ffplay disable ffplay build"
cf9d24ad 79echo " --enable-small optimize for size instead of speed"
da9b170c 80echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
65d1bea2 81echo " --disable-strip disable stripping of executables and shared libraries"
29799f8b
DB
82echo " --enable-codec=CODEC enables CODEC"
83echo " --disable-codec=CODEC disables CODEC"
009cf97d 84echo " --disable-encoders disables all encoders"
b4cad537 85echo " --disable-decoders disables all decoders"
a9e35095
DB
86echo " --disable-muxers disables all muxers"
87echo " --disable-demuxers disables all demuxers"
cf9d24ad 88echo ""
29799f8b 89echo "NOTE: Object files are built at the place where configure is launched."
cf9d24ad
DC
90exit 1
91fi
92
0f3cb305 93# set temporary file name
57514323 94if test ! -z "$TMPDIR" ; then
0f3cb305 95 TMPDIR1="${TMPDIR}"
57514323 96elif test ! -z "$TEMPDIR" ; then
0f3cb305 97 TMPDIR1="${TEMPDIR}"
3d204385 98else
0f3cb305 99 TMPDIR1="/tmp"
3d204385
NK
100fi
101
0f3cb305
FB
102TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
103TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
f3ec2d46 104TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
0f3cb305
FB
105TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
106TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
107
de6d9b64
FB
108# default parameters
109prefix="/usr/local"
cc973ecb 110libdir=""
23a65308 111mandir=""
951bf3e6 112bindir=""
0f3cb305 113cross_prefix=""
de6d9b64
FB
114cc="gcc"
115ar="ar"
be7109c1 116ranlib="ranlib"
4a908fbc 117make="make"
0f3cb305 118strip="strip"
de6d9b64 119cpu=`uname -m`
a4adb608 120tune="generic"
e45a2872 121powerpc_perf="no"
0f3cb305 122mmx="default"
eba9ae3c 123iwmmxt="default"
ab6c65f6 124altivec="default"
d46aba26 125mmi="default"
de6d9b64 126case "$cpu" in
ef0bc4c9 127 i386|i486|i586|i686|i86pc|BePC)
de6d9b64 128 cpu="x86"
de6d9b64 129 ;;
7bf9648e
JM
130 x86_64|amd64)
131 cpu="x86"
132 canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
133 if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
134 if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
135 cpu="x86_64"
136 fi
053dea12
AJ
137 fi
138 ;;
93caefc7
AB
139 # armv4l is a subset of armv5tel
140 armv4l|armv5tel)
6ed7422a 141 cpu="armv4l"
6ed7422a 142 ;;
91d1f1a4
NK
143 alpha)
144 cpu="alpha"
91d1f1a4 145 ;;
a43bd1d7 146 "Power Macintosh"|ppc)
90cee0c3
MN
147 cpu="powerpc"
148 ;;
67860b26 149 mips|mipsel)
d46aba26
LS
150 cpu="mips"
151 ;;
bb476ff3 152 sun4u|sparc64)
a7beab73
RS
153 cpu="sparc64"
154 ;;
bb476ff3
JM
155 sparc)
156 cpu="sparc"
157 ;;
bdb2e37c
AB
158 sh4)
159 cpu="sh4"
160 ;;
67860b26
SH
161 parisc|parisc64)
162 cpu="parisc"
163 ;;
164 s390|s390x)
165 cpu="s390"
166 ;;
167 m68k)
168 cpu="m68k"
169 ;;
170 ia64)
171 cpu="ia64"
172 ;;
de6d9b64 173 *)
0f3cb305 174 cpu="unknown"
de6d9b64
FB
175 ;;
176esac
177gprof="no"
5cbcf02c 178v4l="yes"
6beefa40 179bktr="no"
5cbcf02c 180audio_oss="yes"
dfdfa47c 181audio_beos="no"
8aa3ee32 182dv1394="yes"
f02be79d 183dc1394="no"
5cbcf02c 184network="yes"
0147f198 185zlib="yes"
bb4c2140 186libgsm="no"
a6741398 187mp3lame="no"
9146ca37 188libogg="no"
81e0d0b4 189vorbis="no"
5c5dea3f 190theora="no"
0fc50e58
ZK
191faad="no"
192faadbin="no"
29d48296 193faac="no"
1ddadfa9 194xvid="no"
6662ec29 195x264="no"
ba9261e5 196a52="no"
57514323 197a52bin="no"
23c99253 198dts="no"
ba9261e5 199pp="no"
bba9b16c 200shared_pp="no"
732d9245 201mingw32="no"
3f027ca7 202cygwin="no"
f3ec2d46 203os2="no"
83286d2a 204lshared="no"
cddf3f45
GM
205optimize="yes"
206debug="yes"
65d1bea2 207dostrip="yes"
ef0bc4c9 208extralibs="-lm"
c02dbee1 209simpleidct="yes"
0f3cb305 210bigendian="no"
7f965c1c 211inttypes="yes"
b5c950c4 212emu_fast_int="no"
a8721c09 213vhook="default"
adbc0510
PG
214dlfcn="no"
215dlopen="no"
1eb2212e 216mpegaudio_hp="yes"
e1707f52 217SHFLAGS=-shared
26b35efb 218netserver="no"
4baca069 219need_inet_aton="no"
8154d2e0 220ffserver="yes"
a86b921c 221ffplay="yes"
80581e98 222LIBOBJFLAGS=""
4baca069
PG
223LDFLAGS=-Wl,--warn-common
224FFSLDFLAGS=-Wl,-E
f39e56a8 225LDCONFIG="ldconfig"
f3ec2d46
SG
226LIBPREF="lib"
227LIBSUF=".a"
228SLIBPREF="lib"
229SLIBSUF=".so"
951bf3e6 230EXESUF=""
eb94aca9 231BUILDSUF=""
891f64b3 232amr_nb="no"
d663a1fd 233amr_wb="no"
bc634f6f 234amr_nb_fixed="no"
2a515c08 235amr_if2="no"
f80f7964 236sunmlib="no"
9c3d33d6 237pthreads="no"
b2e3c528 238gpl="no"
da9b170c 239memalignhack="no"
a9e35095
DB
240muxers="yes"
241demuxers="yes"
ef0bc4c9
FR
242
243# OS specific
244targetos=`uname -s`
245case $targetos in
246BeOS)
247prefix="/boot/home/config"
248# helps building libavcodec
cddf3f45 249CFLAGS="-DPIC -fomit-frame-pointer"
31ba0b4d 250# 3 gcc releases known for BeOS, each with ugly bugs
b2924696 251gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
31ba0b4d
FR
252case "$gcc_version" in
2532.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
254mmx="no"
255;;
256*20010315*) echo "BeBits gcc"
257CFLAGS="$CFLAGS -fno-expensive-optimizations"
258;;
259esac
e1707f52 260SHFLAGS=-nostart
29799f8b 261# disable Linux things
e1707f52 262audio_oss="no"
5cbcf02c 263v4l="no"
8aa3ee32 264dv1394="no"
29799f8b 265# enable BeOS things
dfdfa47c 266audio_beos="yes"
ef0bc4c9
FR
267# no need for libm, but the inet stuff
268# Check for BONE
269if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
270extralibs="-lbind -lsocket"
271else
26b35efb 272netserver="yes"
4baca069 273need_inet_aton="yes"
26b35efb 274extralibs="-lnet"
ef0bc4c9 275fi ;;
4baca069
PG
276SunOS)
277v4l="no"
278audio_oss="no"
8aa3ee32 279dv1394="no"
4baca069
PG
280make="gmake"
281LDFLAGS=""
282FFSLDFLAGS=""
283need_inet_aton="yes"
284extralibs="$extralibs -lsocket -lnsl"
285;;
b7aa4a59
SS
286NetBSD)
287v4l="no"
6beefa40 288bktr="yes"
b7aa4a59
SS
289audio_oss="yes"
290dv1394="no"
291make="gmake"
292LDFLAGS="$LDFLAGS -export-dynamic"
293case `uname -r` in
2942.*) extralibs="-lossaudio"
295;;
296esac
297;;
8c802695
JM
298OpenBSD)
299v4l="no"
6beefa40 300bktr="yes"
8c802695
JM
301audio_oss="yes"
302dv1394="no"
303make="gmake"
80581e98 304LIBOBJFLAGS="\$(PIC)"
8c802695 305LDFLAGS="$LDFLAGS -export-dynamic -pthread"
f39e56a8 306LDCONFIG="ldconfig -m \$(libdir)"
8c802695
JM
307extralibs="$extralibs -lossaudio"
308;;
9c938e77
PG
309FreeBSD)
310v4l="no"
6beefa40 311bktr="yes"
9c938e77 312audio_oss="yes"
8aa3ee32 313dv1394="no"
9c938e77 314make="gmake"
12043e1d
SS
315CFLAGS="-pthread"
316LDFLAGS="$LDFLAGS -export-dynamic -pthread"
9c938e77 317;;
4a908fbc 318BSD/OS)
5cbcf02c 319v4l="no"
6beefa40 320bktr="yes"
6063bce7 321audio_oss="yes"
8aa3ee32 322dv1394="no"
4a908fbc
AB
323extralibs="-lpoll -lgnugetopt -lm"
324make="gmake"
325;;
90cee0c3 326Darwin)
a43bd1d7 327cc="cc"
90cee0c3
MN
328v4l="no"
329audio_oss="no"
8aa3ee32 330dv1394="no"
d3b15036 331ffserver="no"
a43bd1d7 332SHFLAGS="-dynamiclib"
90cee0c3 333extralibs=""
a43bd1d7 334darwin="yes"
47930f09 335strip="strip -x"
f2af0e5e 336LDFLAGS="-Wl,-search_paths_first"
4baca069 337FFSLDFLAGS=-Wl,-bind_at_load
90cee0c3 338;;
732d9245 339MINGW32*)
951bf3e6 340# Note: the rest of the mingw32 config is done afterwards as mingw32
29799f8b 341# can be forced on the command line for Linux cross compilation.
732d9245
BE
342mingw32="yes"
343;;
3f027ca7
FB
344CYGWIN*)
345v4l="no"
346audio_oss="yes"
8aa3ee32 347dv1394="no"
487c2fad 348ffserver="no"
3f027ca7
FB
349extralibs=""
350cygwin="yes"
487c2fad 351EXESUF=".exe"
3f027ca7 352;;
b55e4ef4 353Linux)
4baca069 354LDFLAGS="$LDFLAGS -rdynamic"
b55e4ef4 355;;
99614dd4
MB
356IRIX*)
357ranlib="echo ignoring ranlib"
358v4l="no"
359audio_oss="no"
360make="gmake"
361;;
f3ec2d46
SG
362OS/2)
363TMPE=$TMPE".exe"
3ca4b654 364ar="emxomfar -p128"
69db4e10
SG
365ranlib="echo ignoring ranlib"
366strip="echo ignoring strip"
cddf3f45 367CFLAGS="-Zomf"
69db4e10 368LDFLAGS="-Zomf -Zstack 16384 -s"
3ca4b654 369SHFLAGS="-Zdll -Zomf"
f3ec2d46
SG
370FFSLDFLAGS=""
371LIBPREF=""
372LIBSUF=".lib"
373SLIBPREF=""
374SLIBSUF=".dll"
951bf3e6 375EXESUF=".exe"
f3ec2d46
SG
376extralibs=""
377v4l="no"
378audio_oss="no"
8aa3ee32 379dv1394="no"
f3ec2d46
SG
380network="no"
381ffserver="no"
3ca4b654 382vhook="no"
f3ec2d46 383os2="yes"
3ca4b654 384
f3ec2d46 385;;
ef0bc4c9
FR
386*) ;;
387esac
de6d9b64 388
29799f8b 389# From MPlayer configure. We need TARGET_OS available
6852ac95 390# to the Makefile, so it can distinguish between flavors
29799f8b 391# of AltiVec on PowerPC.
6852ac95
RD
392TARGET_OS=`( uname -s ) 2>&1`
393 case "$TARGET_OS" in
2450cff2 394 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
6852ac95
RD
395 ;;
396 IRIX*)
397 TARGET_OS=IRIX
398 ;;
399 HP-UX*)
400 TARGET_OS=HP-UX
401 ;;
402 [cC][yY][gG][wW][iI][nN]*)
403 TARGET_OS=CYGWIN
404 ;;
405 *)
406 TARGET_OS="$TARGET_OS-UNKNOWN"
407 ;;
408 esac
409
0f3cb305 410# find source path
586bc755 411source_path="`echo $0 | sed -e 's#/configure##'`"
0f3cb305
FB
412source_path_used="yes"
413if test -z "$source_path" -o "$source_path" = "." ; then
414 source_path=`pwd`
415 source_path_used="no"
e7a4dafb
MR
416else
417 source_path="`cd \"$source_path\"; pwd`"
de6d9b64
FB
418fi
419
f255e0ab
MB
420FFMPEG_CONFIGURATION=" "
421for opt do
422 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
423done
424
24a9ad7e 425CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
009cf97d 426
de6d9b64
FB
427for opt do
428 case "$opt" in
eba9ae3c 429 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
de6d9b64 430 ;;
eba9ae3c 431 --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
cc973ecb 432 ;;
23a65308
FB
433 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
434 ;;
0f3cb305
FB
435 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
436 ;;
437 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
438 ;;
eba9ae3c 439 --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
de6d9b64 440 ;;
4a908fbc
AB
441 --make=*) make=`echo $opt | cut -d '=' -f 2`
442 ;;
f4e2c4b1 443 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
0f3cb305 444 ;;
f4e2c4b1 445 --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
0f3cb305
FB
446 ;;
447 --extra-libs=*) extralibs=${opt#--extra-libs=}
448 ;;
eb94aca9
CY
449 --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
450 ;;
de6d9b64
FB
451 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
452 ;;
a4adb608
MN
453 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
454 ;;
e45a2872
RD
455 --powerpc-perf-enable) powerpc_perf="yes"
456 ;;
de6d9b64
FB
457 --disable-mmx) mmx="no"
458 ;;
eba9ae3c
GB
459 --disable-iwmmxt) iwmmxt="no"
460 ;;
ab6c65f6
BF
461 --disable-altivec) altivec="no"
462 ;;
de6d9b64
FB
463 --enable-gprof) gprof="yes"
464 ;;
5cbcf02c
FB
465 --disable-v4l) v4l="no"
466 ;;
6beefa40
MN
467 --disable-bktr) bktr="no"
468 ;;
5cbcf02c
FB
469 --disable-audio-oss) audio_oss="no"
470 ;;
dfdfa47c
FR
471 --disable-audio-beos) audio_beos="no"
472 ;;
8aa3ee32
MK
473 --disable-dv1394) dv1394="no"
474 ;;
ffc0ef96 475 --disable-network) network="no"; ffserver="no"
5cbcf02c 476 ;;
0147f198
FR
477 --disable-zlib) zlib="no"
478 ;;
ba9261e5 479 --enable-a52) a52="yes"
6ed7422a 480 ;;
bfd2edeb 481 --enable-a52bin) a52bin="yes"
57514323 482 ;;
23c99253
MN
483 --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
484 ;;
ba9261e5 485 --enable-pp) pp="yes"
bba9b16c
MN
486 ;;
487 --enable-shared-pp) shared_pp="yes"
488 ;;
bb4c2140
MN
489 --enable-libgsm) libgsm="yes"
490 ;;
a6741398
J
491 --enable-mp3lame) mp3lame="yes"
492 ;;
9146ca37 493 --enable-libogg) libogg="yes"
5c5dea3f 494 ;;
81e0d0b4
MH
495 --enable-vorbis) vorbis="yes"
496 ;;
5c5dea3f
NB
497 --enable-theora) theora="yes"
498 ;;
445ad18d
ZK
499 --enable-faad) faad="yes"
500 ;;
501 --enable-faadbin) faadbin="yes"
502 ;;
29d48296
MN
503 --enable-faac) faac="yes"
504 ;;
1ddadfa9
AT
505 --enable-xvid) xvid="yes"
506 ;;
6662ec29
MN
507 --enable-x264) x264="yes"; extralibs="$extralibs -lx264"
508 ;;
f02be79d
RS
509 --enable-dc1394) dc1394="yes"
510 ;;
68892110
PG
511 --disable-vhook) vhook="no"
512 ;;
c02dbee1 513 --disable-simple_idct) simpleidct="no"
045ed63f 514 ;;
732d9245
BE
515 --enable-mingw32) mingw32="yes"
516 ;;
83286d2a 517 --enable-shared) lshared="yes"
0319c531 518 ;;
cddf3f45
GM
519 --disable-debug) debug="no"
520 ;;
521 --disable-opts) optimize="no"
522 ;;
1eb2212e
FB
523 --disable-mpegaudio-hp) mpegaudio_hp="no"
524 ;;
8154d2e0
FB
525 --disable-ffserver) ffserver="no"
526 ;;
a86b921c
FB
527 --disable-ffplay) ffplay="no"
528 ;;
cddf3f45 529 --enable-small) optimize="small"
553a6284 530 ;;
891f64b3 531 --enable-amr_nb) amr_nb="yes"
532 ;;
bc634f6f
ZK
533 --enable-amr_nb-fixed) amr_nb_fixed="yes"
534 ;;
64cba748
MN
535 --enable-amr_wb) amr_wb="yes"
536 ;;
2a515c08
TM
537 --enable-amr_if2) amr_if2="yes"
538 ;;
f80f7964
RS
539 --enable-sunmlib) sunmlib="yes"
540 ;;
9c3d33d6
MN
541 --enable-pthreads) pthreads="yes"
542 ;;
b2e3c528
MN
543 --enable-gpl) gpl="yes"
544 ;;
da9b170c
MN
545 --enable-memalign-hack) memalignhack="yes"
546 ;;
65d1bea2
MB
547 --disable-strip) dostrip="no"
548 ;;
009cf97d
MN
549 --enable-codec=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-codec=}"
550 ;;
551 --disable-codec=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-codec=}##\"`"
552 ;;
553 --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
554 ;;
b4cad537
EP
555 --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
556 ;;
a9e35095
DB
557 --disable-muxers) muxers="no"
558 ;;
559 --disable-demuxers) demuxers="no"
560 ;;
b34c63f7
DB
561 *)
562 echo "Unknown option \"$opt\"."
563 echo "See $0 --help for available options."
564 exit 1
565 ;;
de6d9b64
FB
566 esac
567done
568
5c5dea3f 569if test "$theora" = "yes" ; then
9146ca37 570 if test "$libogg" = "no"; then
29799f8b 571 echo "libogg must be enabled to enable Theora."
5c5dea3f
NB
572 fail="yes"
573 theora="no"
574 fi
575fi
576
577if test "$vorbis" = "yes" ; then
9146ca37 578 if test "$libogg" = "no"; then
29799f8b 579 echo "libogg must be enabled to enable Vorbis."
5c5dea3f
NB
580 fail="yes"
581 vorbis="no"
582 fi
583fi
584
b2e3c528
MN
585if test "$gpl" != "yes"; then
586 if test "$pp" != "no" -o "$shared_pp" != "no"; then
29799f8b 587 echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
b2e3c528
MN
588 fail="yes"
589 fi
590
591 if test "$a52" != "no" -o "$a52bin" != "no"; then
29799f8b 592 echo "liba52 is under GPL and --enable-gpl is not specified."
b2e3c528
MN
593 fail="yes"
594 fi
23c99253 595
1ddadfa9 596 if test "$xvid" != "no"; then
29799f8b 597 echo "libxvidcore is under GPL and --enable-gpl is not specified."
1ddadfa9
AT
598 fail="yes"
599 fi
600
6662ec29 601 if test "$x264" != "no"; then
29799f8b 602 echo "x264 is under GPL and --enable-gpl is not specified."
6662ec29
MN
603 fail="yes"
604 fi
605
23c99253 606 if test "$dts" != "no"; then
29799f8b 607 echo "libdts is under GPL and --enable-gpl is not specified."
23c99253
MN
608 fail="yes"
609 fi
b2e3c528
MN
610
611 if test "$faad" != "no" -o "$faadbin" != "no"; then
612 cat > $TMPC << EOF
613 #include <faad.h>
614 int main( void ) { return 0; }
615EOF
616
617 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
618 cat > $TMPC << EOF
619 #include <faad.h>
620 #ifndef FAAD2_VERSION
621 ok faad1
622 #endif
623 int main( void ) { return 0; }
624EOF
625 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
29799f8b 626 echo "FAAD2 is under GPL and --enable-gpl is not specified."
b2e3c528
MN
627 fail="yes"
628 fi
629 else
630 faad="no"
631 faadbin="no"
29799f8b 632 echo "FAAD test failed."
b2e3c528
MN
633 fi
634 fi
635
636
a18b5183 637 if test "$fail" = "yes"; then
b2e3c528
MN
638 exit 1
639 fi
640fi
641
29799f8b 642# compute MMX state
0f3cb305 643if test $mmx = "default"; then
053dea12 644 if test $cpu = "x86" -o $cpu = "x86_64"; then
0f3cb305
FB
645 mmx="yes"
646 else
647 mmx="no"
648 fi
649fi
650
eba9ae3c
GB
651# check iwmmxt support
652if test $iwmmxt = "default" -a $cpu = "armv4l"; then
653 cat > $TMPC << EOF
654 int main(void) {
655 __asm__ __volatile__ ("wunpckelub wr6, wr4");
656 }
657EOF
658
659 iwmmxt=no
660 if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
661 iwmmxt=yes
662 fi
663fi
664
cf9d24ad 665#Darwin CC versions
75388c74 666needmdynamicnopic="no"
cf9d24ad 667if test $targetos = Darwin; then
b2924696 668 if test -n "`$cc -v 2>&1 | grep xlc`"; then
747a0554 669 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
cf9d24ad 670 else
b2924696 671 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
cf9d24ad
DC
672 case "$gcc_version" in
673 *2.95*)
747a0554 674 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
cf9d24ad 675 ;;
369a02c2 676 *[34].*)
747a0554 677 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
75388c74
MN
678 if test "$lshared" = no; then
679 needmdynamicnopic="yes"
680 fi
cf9d24ad
DC
681 ;;
682 *)
747a0554 683 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
75388c74
MN
684 if test "$lshared" = no; then
685 needmdynamicnopic="yes"
686 fi
cf9d24ad
DC
687 ;;
688 esac
689 fi
690fi
691
ab6c65f6
BF
692# Can only do AltiVec on PowerPC
693if test $altivec = "default"; then
694 if test $cpu = "powerpc"; then
695 altivec="yes"
696 else
697 altivec="no"
698 fi
699fi
700
a4adb608
MN
701# Add processor-specific flags
702TUNECPU="generic"
9007f514 703POWERPCMODE="32bits"
a4adb608
MN
704if test $tune != "generic"; then
705 case $tune in
706 601|ppc601|PowerPC601)
707 CFLAGS="$CFLAGS -mcpu=601"
708 if test $altivec = "yes"; then
29799f8b 709 echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
a4adb608
MN
710 fi
711 TUNECPU=ppc601
712 ;;
713 603*|ppc603*|PowerPC603*)
714 CFLAGS="$CFLAGS -mcpu=603"
715 if test $altivec = "yes"; then
29799f8b 716 echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
a4adb608
MN
717 fi
718 TUNECPU=ppc603
719 ;;
720 604*|ppc604*|PowerPC604*)
721 CFLAGS="$CFLAGS -mcpu=604"
722 if test $altivec = "yes"; then
29799f8b 723 echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
a4adb608
MN
724 fi
725 TUNECPU=ppc604
726 ;;
8d6625b6 727 G3|g3|75*|ppc75*|PowerPC75*)
fe0f2a97 728 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
a4adb608 729 if test $altivec = "yes"; then
29799f8b 730 echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
a4adb608
MN
731 fi
732 TUNECPU=ppc750
733 ;;
8d6625b6 734 G4|g4|745*|ppc745*|PowerPC745*)
fe0f2a97 735 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
3efd4952 736 if test $altivec = "no"; then
29799f8b 737 echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
3efd4952
RD
738 fi
739 TUNECPU=ppc7450
740 ;;
741 74*|ppc74*|PowerPC74*)
fe0f2a97 742 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
a4adb608 743 if test $altivec = "no"; then
29799f8b 744 echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
a4adb608 745 fi
e45a2872 746 TUNECPU=ppc7400
a4adb608 747 ;;
8d6625b6 748 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
9007f514 749 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
a4adb608 750 if test $altivec = "no"; then
29799f8b 751 echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
a4adb608
MN
752 fi
753 TUNECPU=ppc970
9007f514 754 POWERPCMODE="64bits"
a4adb608 755 ;;
efc39ba8
MR
756 i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona)
757 CFLAGS="$CFLAGS -march=$tune"
758 ;;
a4adb608 759 *)
29799f8b 760 echo "WARNING: Unknown CPU \"$tune\", ignored."
a4adb608
MN
761 ;;
762 esac
763fi
764
cf9d24ad 765# AltiVec flags: The FSF version of GCC differs from the Apple version
b6e52719
MD
766if test $cpu = "powerpc"; then
767 if test $altivec = "yes"; then
b2924696 768 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
49f1a349 769 CFLAGS="$CFLAGS -faltivec"
b6e52719
MD
770 else
771 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
772 fi
773 fi
774fi
775
29799f8b 776# check if we have <altivec.h>
a9a07762
MN
777cat > $TMPC << EOF
778#include <altivec.h>
779int main( void ) { return 0; }
780EOF
781
782_altivec_h="no"
b6e52719 783if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
a9a07762
MN
784_altivec_h="yes"
785fi
786
29799f8b 787# check if our compiler supports Motorola AltiVec C API
ab6c65f6 788if test $altivec = "yes"; then
a9a07762 789if test $_altivec_h = "yes"; then
ab6c65f6 790cat > $TMPC << EOF
a9a07762 791#include <altivec.h>
ab6c65f6
BF
792int main(void) {
793 vector signed int v1, v2, v3;
794 v1 = vec_add(v2,v3);
795 return 0;
796}
797EOF
a9a07762
MN
798else
799cat > $TMPC << EOF
800int main(void) {
801 vector signed int v1, v2, v3;
802 v1 = vec_add(v2,v3);
803 return 0;
804}
805EOF
806fi
b6e52719 807$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
ab6c65f6
BF
808fi
809
29799f8b 810# mmi only available on mips
d46aba26
LS
811if test $mmi = "default"; then
812 if test $cpu = "mips"; then
813 mmi="yes"
814 else
815 mmi="no"
816 fi
817fi
818
29799f8b 819# check if our compiler supports mmi
d46aba26
LS
820if test $mmi = "yes"; then
821cat > $TMPC << EOF
822int main(void) {
823 __asm__ ("lq \$2, 0(\$2)");
824 return 0;
825}
826EOF
f3ec2d46 827$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
d46aba26
LS
828fi
829
732d9245 830if test "$mingw32" = "yes" ; then
732d9245 831 v4l="no"
6beefa40 832 bktr="no"
732d9245 833 audio_oss="no"
8aa3ee32 834 dv1394="no"
f02be79d 835 dc1394="no"
951bf3e6 836 ffserver="no"
732d9245 837 network="no"
951bf3e6
FB
838 SLIBPREF=""
839 SLIBSUF=".dll"
840 EXESUF=".exe"
eba9ae3c
GB
841 if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
842 if test "$force_libdir" != yes; then bindir="$prefix"; fi
732d9245
BE
843fi
844
0f3cb305
FB
845cc="${cross_prefix}${cc}"
846ar="${cross_prefix}${ar}"
be7109c1 847ranlib="${cross_prefix}${ranlib}"
0f3cb305
FB
848strip="${cross_prefix}${strip}"
849
487a54d7
FB
850if test -z "$cross_prefix" ; then
851
3d204385 852# ---
29799f8b 853# big/little-endian test
a3999908
MN
854cat > $TMPC << EOF
855#include <inttypes.h>
856int main(int argc, char ** argv){
857 volatile uint32_t i=0x01234567;
858 return (*((uint8_t*)(&i))) == 0x67;
859}
860EOF
861
f3ec2d46
SG
862if $cc -o $TMPE $TMPC 2>/dev/null ; then
863$TMPE && bigendian="yes"
a3999908
MN
864else
865echo big/little test failed
866fi
867
487a54d7
FB
868else
869
29799f8b 870# programs cannot be launched if cross compiling, so make a static guess
487a54d7
FB
871if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
872 bigendian="yes"
873fi
874
875fi
876
a3999908 877# ---
7f965c1c
CF
878# *inttypes.h* test
879cat > $TMPC << EOF
880#include <inttypes.h>
881int main(int argc, char ** argv){
882 return 0;
883}
884EOF
885
886$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
887
888# ---
b5c950c4
MN
889# *int_fast* test
890cat > $TMPC << EOF
891#include <inttypes.h>
892int main(int argc, char ** argv){
893 volatile uint_fast64_t i=0x01234567;
894 return 0;
895}
896EOF
897
898$cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
899
900# ---
3d204385
NK
901# check availability of some header files
902
903cat > $TMPC << EOF
904#include <malloc.h>
905int main( void ) { return 0; }
906EOF
907
908_memalign=no
909_malloc_h=no
f3ec2d46 910if $cc -o $TMPE $TMPC 2> /dev/null ; then
3d204385
NK
911_malloc_h=yes
912_memalign=yes
913# check for memalign - atmos
914cat > $TMPC << EOF
487c2fad 915#include <stdio.h>
3d204385
NK
916#include <malloc.h>
917int main ( void ) {
918char *string = NULL;
919string = memalign(64, sizeof(char));
920return 0;
921}
922EOF
f3ec2d46 923$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
3d204385
NK
924fi
925
8bf5d58f 926if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
29799f8b 927 echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
8bf5d58f
MN
928 exit 1
929fi
930
68892110 931cat > $TMPC << EOF
5e4639e2
GM
932#include <time.h>
933int main( void ) { localtime_r(NULL, NULL); }
934EOF
935
936localtime_r=no
937if $cc -o $TMPE $TMPC 2> /dev/null ; then
938 localtime_r=yes
939fi
940
0147f198
FR
941if test "$zlib" = "yes"; then
942# check for zlib - mmu_man
943cat > $TMPC << EOF
944#include <zlib.h>
945int main ( void ) {
946if (zlibVersion() != ZLIB_VERSION)
947 puts("zlib version differs !!!");
948 return 1;
949return 0;
950}
951EOF
e27ca59b 952$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
f3ec2d46 953# $TMPE 2> /dev/null > /dev/null || zlib="no"
0147f198
FR
954# XXX: more tests needed - runtime test
955fi
956if test "$zlib" = "yes"; then
957extralibs="$extralibs -lz"
958fi
959
95e2ce4a
MN
960# test for lrintf in math.h
961cat > $TMPC << EOF
962#define _ISOC9X_SOURCE 1
963#include <math.h>
964int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
965EOF
966
967have_lrintf="no"
f3ec2d46 968if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
95e2ce4a 969 have_lrintf="yes"
c2b9685e
MN
970 # allanc@chickenandporn.com: cannot execute cross-compiled
971 # code on the host. Only execute if not cross-compiling.
972 if test -z "$cross_prefix" ; then
973 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
974 fi
95e2ce4a
MN
975fi
976
c13e1abd
FH
977_restrict=
978for restrict_keyword in restrict __restrict__ __restrict; do
979 echo "void foo(char * $restrict_keyword p);" > $TMPC
980 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
981 _restrict=$restrict_keyword
982 break;
983 fi
984done
985
52b41d7f
FB
986# test gcc version to see if vector builtins can be used
987# currently only used on i386 for MMX builtins
988cat > $TMPC << EOF
053dea12 989#include <xmmintrin.h>
52b41d7f
FB
990int main(void) {
991#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
992return 0;
993#else
994#error no vector builtins
995#endif
996}
997EOF
998
999builtin_vector=no
13c2469d 1000if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
52b41d7f 1001 builtin_vector=yes
a8721c09
FB
1002fi
1003
1004# dlopen/dlfcn.h probing
1005
1006cat > $TMPC << EOF
1007#include <dlfcn.h>
1008int main( void ) { return (int) dlopen("foo", 0); }
1009EOF
1010
1011ldl=-ldl
1012
cf9d24ad 1013if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
1014dlfcn=yes
1015dlopen=yes
1016fi
1017
cf9d24ad 1018if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
1019dlfcn=yes
1020dlopen=yes
1021ldl=""
1022fi
1023
1024cat > $TMPC << EOF
1025int main( void ) { return (int) dlopen("foo", 0); }
1026EOF
1027
cf9d24ad 1028if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
1029dlopen=yes
1030fi
1031
cf9d24ad 1032if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
1033dlopen=yes
1034ldl=""
1035fi
1036
1037if test "$vhook" = "default" ; then
1038 vhook="$dlopen"
1039fi
1040
bfd2edeb
MN
1041if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1042 extralibs="$extralibs $ldl"
1043fi
1044
1045
a86b921c 1046##########################################
29799f8b 1047# imlib check
a86b921c 1048
a8721c09
FB
1049cat > $TMPC << EOF
1050#include <X11/Xlib.h>
1051#include <Imlib2.h>
1052int main( void ) { return (int) imlib_load_font("foo"); }
1053EOF
1054
1055imlib2=no
56b04ceb 1056if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
a8721c09 1057imlib2=yes
52b41d7f
FB
1058fi
1059
a86b921c 1060##########################################
29799f8b 1061# FreeType check
a86b921c 1062
04511d53
PG
1063cat > $TMPC << EOF
1064#include <ft2build.h>
1065int main( void ) { return (int) FT_Init_FreeType(0); }
1066EOF
1067
1068freetype2=no
69db4e10 1069if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
e2a3cd59 1070 if (freetype-config --version) >/dev/null 2>&1 ; then
cf9d24ad 1071 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
dee076fc 1072 freetype2=yes
04511d53 1073 fi
dee076fc 1074 fi
04511d53
PG
1075fi
1076
a86b921c 1077##########################################
29799f8b 1078# SDL check
a86b921c
FB
1079
1080cat > $TMPC << EOF
1081#include <SDL.h>
31319a8c 1082#undef main /* We don't want SDL to override our main() */
a86b921c
FB
1083int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1084EOF
1085
1086sdl_too_old=no
1087sdl=no
e2a3cd59 1088if (sdl-config --version) >/dev/null 2>&1 ; then
cf9d24ad 1089if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
a86b921c
FB
1090_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1091if test "$_sdlversion" -lt 121 ; then
1092sdl_too_old=yes
1093else
1094sdl=yes
1095fi
1096fi
c3f6b472 1097fi
a86b921c 1098
146ea952 1099##########################################
29799f8b 1100# texi2html check
146ea952
NB
1101
1102texi2html=no
e2a3cd59 1103if (texi2html -version) >/dev/null 2>&1; then
146ea952
NB
1104texi2html=yes
1105fi
1106
7a91333f
HZ
1107if test "$network" = "yes" ; then
1108##########################################
29799f8b 1109# IPv6 check
7a91333f
HZ
1110
1111cat > $TMPC << EOF
1112#include <sys/types.h>
1113#include <sys/socket.h>
1114#include <netinet/in.h>
1115#include <netdb.h>
1116int main( void ) {
1117 struct sockaddr_storage saddr;
1118 struct ipv6_mreq mreq6;
1119 getaddrinfo(0,0,0,0);
1120 getnameinfo(0,0,0,0,0,0,0);
1121 IN6_IS_ADDR_MULTICAST(0);
1122}
1123EOF
1124
1125ipv6=no
1126if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1127ipv6=yes
1128fi
1129fi
1130
b2924696 1131case "`$cc -v 2>&1 | grep version`" in
cf9d24ad 1132 *gcc*)
2f3eca08 1133 CFLAGS="-Wall -Wno-switch $CFLAGS"
cf9d24ad
DC
1134 ;;
1135 *)
1136 ;;
1137esac
1138
94a3401e
FB
1139if test "$sdl" = "no" ; then
1140 ffplay=no
1141fi
1142
cddf3f45 1143if test "$debug" = "yes"; then
7906085f 1144 CFLAGS="-g $CFLAGS"
cddf3f45
GM
1145fi
1146
1147if test "$optimize" = "small"; then
98ca7790 1148# CFLAGS=${CFLAGS//-O3/-Os}
553a6284
MN
1149 CFLAGS="$CFLAGS -Os"
1150fi
1151
cddf3f45 1152if test "$optimize" = "yes"; then
b2924696 1153 if test -n "`$cc -v 2>&1 | grep xlc`"; then
cf9d24ad
DC
1154 CFLAGS="$CFLAGS -O5"
1155 LDFLAGS="$LDFLAGS -O5"
1156 else
7906085f 1157 CFLAGS="-O3 $CFLAGS"
cf9d24ad 1158 fi
cddf3f45
GM
1159fi
1160
80581e98
MN
1161# PIC flags for shared library objects where they are needed
1162if test "$lshared" = "yes" ; then
1163 # LIBOBJFLAGS may have already been set in the OS configuration
1164 if test -z "$LIBOBJFLAGS" ; then
966265bc 1165 if test "$cpu" = "x86_64" -o "$cpu" = "ia64" ; then
80581e98
MN
1166 LIBOBJFLAGS="\$(PIC)"
1167 fi
1168 fi
1169fi
1170
951bf3e6
FB
1171if test x"$bindir" = x""; then
1172bindir="${prefix}/bin"
1173fi
1174
cc973ecb
LB
1175if test x"$libdir" = x""; then
1176libdir="${prefix}/lib"
1177fi
1178
23a65308
FB
1179if test x"$mandir" = x""; then
1180mandir="${prefix}/man"
1181fi
1182
29799f8b
DB
1183echo "install prefix $prefix"
1184echo "source path $source_path"
de6d9b64 1185echo "C compiler $cc"
4a908fbc 1186echo "make $make"
a4adb608 1187echo "CPU $cpu ($tune)"
eb94aca9 1188if test "$BUILDSUF" != ""; then
29799f8b 1189echo "build suffix $BUILDSUF"
eb94aca9 1190fi
29799f8b 1191echo "big-endian $bigendian"
7f965c1c 1192echo "inttypes.h $inttypes"
b5c950c4 1193echo "broken inttypes.h $emu_fast_int"
053dea12 1194if test $cpu = "x86" -o $cpu = "x86_64"; then
de6d9b64 1195echo "MMX enabled $mmx"
52b41d7f 1196echo "Vector Builtins $builtin_vector"
e41e8342 1197fi
eba9ae3c
GB
1198if test $cpu = "armv4l"; then
1199echo "IWMMXT enabled $iwmmxt"
1200fi
e41e8342 1201if test $cpu = "mips"; then
d46aba26 1202echo "MMI enabled $mmi"
e41e8342
FB
1203fi
1204if test $cpu = "powerpc"; then
ab6c65f6 1205echo "AltiVec enabled $altivec"
e41e8342 1206fi
de6d9b64 1207echo "gprof enabled $gprof"
0147f198 1208echo "zlib enabled $zlib"
bb4c2140 1209echo "libgsm enabled $libgsm"
a6741398 1210echo "mp3lame enabled $mp3lame"
9146ca37 1211echo "libogg enabled $libogg"
29799f8b
DB
1212echo "Vorbis enabled $vorbis"
1213echo "Theora enabled $theora"
1214echo "FAAD enabled $faad"
445ad18d 1215echo "faadbin enabled $faadbin"
29799f8b
DB
1216echo "FAAC enabled $faac"
1217echo "XviD enabled $xvid"
6662ec29 1218echo "x264 enabled $x264"
5cbcf02c 1219echo "a52 support $a52"
57514323 1220echo "a52 dlopened $a52bin"
29799f8b 1221echo "DTS support $dts"
bba9b16c 1222echo "pp support $pp"
cddf3f45 1223echo "debug symbols $debug"
65d1bea2 1224echo "strip symbols $dostrip"
cddf3f45 1225echo "optimize $optimize"
bba9b16c 1226echo "shared pp $shared_pp"
29799f8b 1227echo "video hooking $vhook"
a86b921c
FB
1228echo "SDL support $sdl"
1229if test $sdl_too_old = "yes"; then
29799f8b 1230echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
a86b921c 1231fi
68892110
PG
1232
1233if test "$vhook" = "yes" ; then
47930f09 1234echo "Imlib2 support $imlib2"
29799f8b 1235echo "FreeType support $freetype2"
68892110 1236fi
f80f7964 1237echo "Sun medialib support" $sunmlib
9c3d33d6 1238echo "pthreads support" $pthreads
bc634f6f
ZK
1239echo "AMR-NB float support" $amr_nb
1240echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 1241echo "AMR-WB float support" $amr_wb
2a515c08 1242echo "AMR-WB IF2 support" $amr_if2
7a91333f
HZ
1243echo "network support $network"
1244if test "$network" = "yes" ; then
1245echo "IPv6 support $ipv6"
1246fi
b2e3c528
MN
1247if test "$gpl" = "no" ; then
1248echo "License: LGPL"
1249else
1250echo "License: GPL"
1251fi
de6d9b64 1252
29799f8b 1253echo "Creating config.mak and config.h..."
de6d9b64 1254
f255e0ab
MB
1255date >> config.log
1256echo " $0 $FFMPEG_CONFIGURATION" >> config.log
29799f8b
DB
1257echo "# Automatically generated by configure - do not modify!" > config.mak
1258echo "/* Automatically generated by configure - do not modify! */" > $TMPH
f255e0ab 1259echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
de6d9b64 1260
980fc7b8 1261echo "prefix=$prefix" >> config.mak
cc973ecb 1262echo "libdir=$libdir" >> config.mak
951bf3e6 1263echo "bindir=$bindir" >> config.mak
23a65308 1264echo "mandir=$mandir" >> config.mak
4a908fbc 1265echo "MAKE=$make" >> config.mak
980fc7b8
FB
1266echo "CC=$cc" >> config.mak
1267echo "AR=$ar" >> config.mak
be7109c1 1268echo "RANLIB=$ranlib" >> config.mak
65d1bea2 1269if test "$dostrip" = "yes" ; then
0f3cb305 1270echo "STRIP=$strip" >> config.mak
65d1bea2
MB
1271echo "INSTALLSTRIP=-s" >> config.mak
1272else
1273echo "STRIP=echo ignoring strip" >> config.mak
1274echo "INSTALLSTRIP=" >> config.mak
1275fi
75388c74 1276
29799f8b 1277# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
75388c74
MN
1278# shared modules on OS/X (vhook/Makefile).
1279SHCFLAGS=$CFLAGS
1280if test "$needmdynamicnopic" = yes; then
1281 CFLAGS="$CFLAGS -mdynamic-no-pic"
1282fi
1283
a9b3f630 1284echo "OPTFLAGS=$CFLAGS" >> config.mak
75388c74 1285echo "SHCFLAGS=$SHCFLAGS">>config.mak
0f3cb305 1286echo "LDFLAGS=$LDFLAGS" >> config.mak
f39e56a8 1287echo "LDCONFIG=$LDCONFIG" >> config.mak
4baca069 1288echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 1289echo "SHFLAGS=$SHFLAGS" >> config.mak
80581e98 1290echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
eb94aca9 1291echo "BUILDSUF=$BUILDSUF" >> config.mak
f3ec2d46 1292echo "LIBPREF=$LIBPREF" >> config.mak
eb94aca9 1293echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
f3ec2d46 1294echo "SLIBPREF=$SLIBPREF" >> config.mak
eb94aca9
CY
1295echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1296echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
6852ac95 1297echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 1298if test "$cpu" = "x86" ; then
980fc7b8 1299 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 1300 echo "#define ARCH_X86 1" >> $TMPH
053dea12
AJ
1301elif test "$cpu" = "x86_64" ; then
1302 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1303 echo "#define ARCH_X86_64 1" >> $TMPH
0f3cb305 1304elif test "$cpu" = "armv4l" ; then
6ed7422a 1305 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 1306 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 1307elif test "$cpu" = "alpha" ; then
91d1f1a4 1308 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 1309 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
1310elif test "$cpu" = "sparc64" ; then
1311 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1312 echo "#define ARCH_SPARC64 1" >> $TMPH
bb476ff3
JM
1313 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1314 echo "#define ARCH_SPARC 1" >> $TMPH
1315elif test "$cpu" = "sparc" ; then
1316 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1317 echo "#define ARCH_SPARC 1" >> $TMPH
0f3cb305
FB
1318elif test "$cpu" = "powerpc" ; then
1319 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1320 echo "#define ARCH_POWERPC 1" >> $TMPH
9007f514
RD
1321 if test $POWERPCMODE = "32bits"; then
1322 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1323 else
1324 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1325 fi
e45a2872
RD
1326 if test "$powerpc_perf" = "yes"; then
1327 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1328 fi
d46aba26
LS
1329elif test "$cpu" = "mips" ; then
1330 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1331 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
1332elif test "$cpu" = "sh4" ; then
1333 echo "TARGET_ARCH_SH4=yes" >> config.mak
1334 echo "#define ARCH_SH4 1" >> $TMPH
67860b26
SH
1335elif test "$cpu" = "parisc" ; then
1336 echo "TARGET_ARCH_PARISC=yes" >> config.mak
1337 echo "#define ARCH_PARISC 1" >> $TMPH
1338elif test "$cpu" = "s390" ; then
1339 echo "TARGET_ARCH_S390=yes" >> config.mak
1340 echo "#define ARCH_S390 1" >> $TMPH
1341elif test "$cpu" = "m68k" ; then
1342 echo "TARGET_ARCH_M68K=yes" >> config.mak
1343 echo "#define ARCH_M68K 1" >> $TMPH
1344elif test "$cpu" = "ia64" ; then
1345 echo "TARGET_ARCH_IA64=yes" >> config.mak
1346 echo "#define ARCH_IA64 1" >> $TMPH
bdb2e37c 1347fi
a4adb608 1348echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
1349if test "$bigendian" = "yes" ; then
1350 echo "WORDS_BIGENDIAN=yes" >> config.mak
1351 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 1352fi
d2a9bddd
MN
1353if test "$inttypes" != "yes" ; then
1354 echo "#define EMULATE_INTTYPES 1" >> $TMPH
7f965c1c 1355fi
b5c950c4 1356if test "$emu_fast_int" = "yes" ; then
19d053c5 1357 echo "#define EMULATE_FAST_INT 1" >> $TMPH
b5c950c4 1358fi
57514323 1359if test "$mmx" = "yes" ; then
980fc7b8 1360 echo "TARGET_MMX=yes" >> config.mak
045ed63f 1361 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 1362 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 1363fi
52b41d7f
FB
1364if test "$builtin_vector" = "yes" ; then
1365 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1366 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1367fi
eba9ae3c
GB
1368if test "$iwmmxt" = "yes" ; then
1369 echo "TARGET_IWMMXT=yes" >> config.mak
1370 echo "#define HAVE_IWMMXT 1" >> $TMPH
1371fi
d46aba26
LS
1372if test "$mmi" = "yes" ; then
1373 echo "TARGET_MMI=yes" >> config.mak
1374 echo "#define HAVE_MMI 1" >> $TMPH
1375fi
ab6c65f6
BF
1376if test "$altivec" = "yes" ; then
1377 echo "TARGET_ALTIVEC=yes" >> config.mak
1378 echo "#define HAVE_ALTIVEC 1" >> $TMPH
db40a39a
MN
1379 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1380 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
a9a07762
MN
1381 if test "$_altivec_h" = "yes" ; then
1382 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1383 else
e67e14d5 1384 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
a9a07762 1385 fi
ab6c65f6 1386fi
57514323 1387if test "$gprof" = "yes" ; then
980fc7b8 1388 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 1389 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 1390fi
5e4639e2
GM
1391if test "$localtime_r" = "yes" ; then
1392 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 1393fi
68892110
PG
1394if test "$imlib2" = "yes" ; then
1395 echo "HAVE_IMLIB2=yes" >> config.mak
1396fi
04511d53
PG
1397if test "$freetype2" = "yes" ; then
1398 echo "HAVE_FREETYPE2=yes" >> config.mak
1399fi
f80f7964
RS
1400if test "$sunmlib" = "yes" ; then
1401 echo "HAVE_MLIB=yes" >> config.mak
1402 echo "#define HAVE_MLIB 1" >> $TMPH
1403 extralibs="$extralibs -lmlib"
1404fi
9c3d33d6
MN
1405if test "$pthreads" = "yes" ; then
1406 echo "HAVE_PTHREADS=yes" >> config.mak
1407 echo "#define HAVE_PTHREADS 1" >> $TMPH
2450cff2 1408 echo "#define HAVE_THREADS 1" >> $TMPH
8c802695 1409 if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
12043e1d
SS
1410 extralibs="$extralibs -lpthread"
1411 fi
9c3d33d6 1412fi
a86b921c
FB
1413if test "$sdl" = "yes" ; then
1414 echo "CONFIG_SDL=yes" >> config.mak
1415 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1416 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1417fi
146ea952
NB
1418if test "$texi2html" = "yes"; then
1419 echo "BUILD_DOC=yes" >> config.mak
1420fi
95e2ce4a
MN
1421if test "$have_lrintf" = "yes" ; then
1422 echo "#define HAVE_LRINTF 1" >> $TMPH
1423fi
68892110
PG
1424if test "$vhook" = "yes" ; then
1425 echo "BUILD_VHOOK=yes" >> config.mak
1426 echo "#define HAVE_VHOOK 1" >> $TMPH
68892110 1427fi
57514323 1428if test "$lshared" = "yes" ; then
0319c531 1429 echo "BUILD_SHARED=yes" >> config.mak
97006039 1430 echo "PIC=-fPIC -DPIC" >> config.mak
0319c531 1431fi
ef0bc4c9 1432echo "EXTRALIBS=$extralibs" >> config.mak
281a74da 1433version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
258207b7
FB
1434 cut -d '"' -f 2`
1435echo "VERSION=$version" >>config.mak
29799f8b 1436# If you do not want to use encoders, disable them.
045ed63f 1437echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
1438echo "CONFIG_ENCODERS=yes" >> config.mak
1439
29799f8b 1440# If you do not want to use decoders, disable them.
045ed63f 1441echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
1442echo "CONFIG_DECODERS=yes" >> config.mak
1443
a9e35095
DB
1444# muxers
1445if test "$muxers" = "yes" ; then
1446 echo "#define CONFIG_MUXERS 1" >> $TMPH
1447 echo "CONFIG_MUXERS=yes" >> config.mak
1448fi
1449
1450# demuxers
1451if test "$demuxers" = "yes" ; then
1452 echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1453 echo "CONFIG_DEMUXERS=yes" >> config.mak
1454fi
1455
5cbcf02c
FB
1456# AC3
1457if test "$a52" = "yes" ; then
1458 echo "#define CONFIG_AC3 1" >> $TMPH
1459 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 1460
5cbcf02c
FB
1461 if test "$a52bin" = "yes" ; then
1462 echo "#define CONFIG_A52BIN 1" >> $TMPH
1463 echo "CONFIG_A52BIN=yes" >> config.mak
1464 fi
1465fi
1466
23c99253
MN
1467# DTS
1468if test "$dts" = "yes" ; then
1469 echo "#define CONFIG_DTS 1" >> $TMPH
1470 echo "CONFIG_DTS=yes" >> config.mak
1471fi
1472
bba9b16c
MN
1473# PP
1474if test "$pp" = "yes" ; then
1475 echo "#define CONFIG_PP 1" >> $TMPH
1476 echo "CONFIG_PP=yes" >> config.mak
1477
1478 if test "$shared_pp" = "yes" ; then
1479 echo "#define SHARED_PP 1" >> $TMPH
1480 echo "SHARED_PP=yes" >> config.mak
1481 fi
1482fi
1483
29799f8b 1484# MPEG audio high precision mode
1eb2212e
FB
1485if test "$mpegaudio_hp" = "yes" ; then
1486 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1487fi
1488
5cbcf02c
FB
1489if test "$v4l" = "yes" ; then
1490 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1491 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1492fi
1493
6beefa40
MN
1494if test "$bktr" = "yes" ; then
1495 echo "#define CONFIG_BKTR 1" >> $TMPH
1496 echo "CONFIG_BKTR=yes" >> config.mak
1497fi
1498
8aa3ee32
MK
1499if test "$dv1394" = "yes" ; then
1500 echo "#define CONFIG_DV1394 1" >> $TMPH
1501 echo "CONFIG_DV1394=yes" >> config.mak
1502fi
1503
f02be79d
RS
1504if test "$dc1394" = "yes" ; then
1505 echo "#define CONFIG_DC1394 1" >> $TMPH
1506 echo "CONFIG_DC1394=yes" >> config.mak
1507fi
1508
adbc0510
PG
1509if test "$dlopen" = "yes" ; then
1510 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1511fi
1512
1513if test "$dlfcn" = "yes" ; then
1514 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1515fi
1516
5cbcf02c
FB
1517if test "$audio_oss" = "yes" ; then
1518 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1519 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1520fi
1521
dfdfa47c
FR
1522if test "$audio_beos" = "yes" ; then
1523 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1524 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1525fi
1526
5cbcf02c
FB
1527if test "$network" = "yes" ; then
1528 echo "#define CONFIG_NETWORK 1" >> $TMPH
1529 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1530fi
daf8e955 1531
7a91333f
HZ
1532if test "$ipv6" = "yes" ; then
1533 echo "#define CONFIG_IPV6 1" >> $TMPH
1534fi
1535
0147f198
FR
1536if test "$zlib" = "yes" ; then
1537 echo "#define CONFIG_ZLIB 1" >> $TMPH
1538 echo "CONFIG_ZLIB=yes" >> config.mak
1539fi
1540
bb4c2140
MN
1541if test "$libgsm" = "yes" ; then
1542 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1543 echo "CONFIG_LIBGSM=yes" >> config.mak
1544fi
1545
57514323 1546if test "$mp3lame" = "yes" ; then
045ed63f 1547 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1548 echo "CONFIG_MP3LAME=yes" >> config.mak
1549fi
1550
9146ca37 1551if test "$libogg" = "yes" ; then
5c5dea3f
NB
1552 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1553 echo "CONFIG_LIBOGG=yes" >> config.mak
1554fi
1555
81e0d0b4 1556if test "$vorbis" = "yes" ; then
5c5dea3f
NB
1557 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1558 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1559fi
1560
1561if test "$theora" = "yes" ; then
1562 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1563 echo "CONFIG_LIBTHEORA=yes" >> config.mak
81e0d0b4
MH
1564fi
1565
0fc50e58
ZK
1566if test "$faad" = "yes" ; then
1567 echo "#define CONFIG_FAAD 1" >> $TMPH
1568 echo "CONFIG_FAAD=yes" >> config.mak
1569fi
1570
1571if test "$faadbin" = "yes" ; then
1572 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1573 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1574fi
1575
29d48296
MN
1576if test "$faac" = "yes" ; then
1577 echo "#define CONFIG_FAAC 1" >> $TMPH
1578 echo "CONFIG_FAAC=yes" >> config.mak
1579fi
1580
1ddadfa9
AT
1581if test "$xvid" = "yes" ; then
1582 echo "#define CONFIG_XVID 1" >> $TMPH
1583 echo "CONFIG_XVID=yes" >> config.mak
1584fi
1585
6662ec29
MN
1586if test "$x264" = "yes" ; then
1587 echo "#define CONFIG_X264 1" >> $TMPH
1588 echo "CONFIG_X264=yes" >> config.mak
1589fi
1590
732d9245
BE
1591if test "$mingw32" = "yes" ; then
1592 echo "#define CONFIG_WIN32 1" >> $TMPH
1593 echo "CONFIG_WIN32=yes" >> config.mak
16806499
MN
1594 echo "HAVE_W32THREADS=yes" >> config.mak
1595 echo "#define HAVE_W32THREADS 1" >> $TMPH
2450cff2 1596 echo "#define HAVE_THREADS 1" >> $TMPH
7eea5766 1597 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1598 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1599 echo "#endif" >> $TMPH
3f027ca7
FB
1600fi
1601
f3ec2d46
SG
1602if test "$os2" = "yes" ; then
1603 echo "#define CONFIG_OS2 1" >> $TMPH
1604 echo "CONFIG_OS2=yes" >> config.mak
1605fi
1606
6e023978
RS
1607if test "$TARGET_OS" = "SunOS" ; then
1608 echo "#define CONFIG_SUNOS 1" >> $TMPH
1609fi
1610
2450cff2
FR
1611if test "$TARGET_OS" = "BeOS" ; then
1612 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1613 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1614 echo "#define HAVE_THREADS 1" >> $TMPH
1615fi
1616
90cee0c3
MN
1617if test "$darwin" = "yes"; then
1618 echo "#define CONFIG_DARWIN 1" >> $TMPH
1619 echo "CONFIG_DARWIN=yes" >> config.mak
1620fi
1621
57514323 1622if test "$_malloc_h" = "yes" ; then
045ed63f 1623 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1624else
045ed63f 1625 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1626fi
1627
57514323 1628if test "$_memalign" = "yes" ; then
045ed63f
ZK
1629 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1630else
1631 echo "#undef HAVE_MEMALIGN" >> $TMPH
1632fi
1633
da9b170c
MN
1634if test "$memalignhack" = "yes" ; then
1635 echo "#define MEMALIGN_HACK 1" >> $TMPH
1636fi
1637
1638
26b35efb
FR
1639if test "$netserver" = "yes" ; then
1640 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1641 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1642fi
1643
4baca069
PG
1644if test "$need_inet_aton" = "yes" ; then
1645 echo "NEED_INET_ATON=yes" >> config.mak
1646fi
1647
57514323 1648if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1649 echo "#define SIMPLE_IDCT 1" >> $TMPH
1650fi
1651
8154d2e0
FB
1652if test "$ffserver" = "yes" ; then
1653 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1654 echo "CONFIG_FFSERVER=yes" >> config.mak
1655fi
1656
a86b921c
FB
1657if test "$ffplay" = "yes" ; then
1658 echo "CONFIG_FFPLAY=yes" >> config.mak
1659fi
1660
b2e3c528
MN
1661if test "$gpl" = "yes" ; then
1662 echo "#define CONFIG_GPL 1" >> $TMPH
1663 echo "CONFIG_GPL=yes" >> config.mak
1664fi
1665
c13e1abd
FH
1666echo "#define restrict $_restrict" >> $TMPH
1667
bb801c97
MN
1668if test "$optimize" = "small"; then
1669 echo "#define always_inline" >> $TMPH
1670fi
1671
0f3cb305
FB
1672# build tree in object directory if source path is different from current one
1673if test "$source_path_used" = "yes" ; then
2a4e872b
AS
1674 DIRS="\
1675 doc \
1676 libavformat \
1677 libavcodec \
1678 libavcodec/alpha \
1679 libavcodec/armv4l \
1680 libavcodec/i386 \
1681 libavcodec/sparc \
1682 libavcodec/mlib \
1683 libavcodec/ppc \
1684 libavcodec/liba52 \
1685 libavcodec/libpostproc \
1686 libavutil \
1687 tests \
1688 vhook \
1689 "
1690 FILES="\
1691 Makefile \
1692 libavformat/Makefile \
1693 libavcodec/Makefile \
1694 libavcodec/libpostproc/Makefile \
1695 libavutil/Makefile \
1696 tests/Makefile \
1697 vhook/Makefile \
1698 doc/Makefile \
1699 doc/texi2pod.pl \
1700 "
0f3cb305
FB
1701 for dir in $DIRS ; do
1702 mkdir -p $dir
1703 done
1704 for f in $FILES ; do
281a74da 1705 ln -sf "$source_path/$f" $f
0f3cb305 1706 done
8b8e1c55
PMH
1707 echo "SRC_PATH=$source_path" >> config.mak
1708else
1709 echo "SRC_PATH='$source_path'" >> config.mak
0f3cb305 1710fi
0f3cb305 1711
d663a1fd
MN
1712if test "$amr_wb" = "yes" ; then
1713 echo "#define AMR_WB 1" >> $TMPH
1714 echo "AMR_WB=yes" >> config.mak
1715 echo
1716 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1717 echo "V5.1.0 from "
1718 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1719 echo "and extracted the source to libavcodec/amrwb_float"
1720 echo
1721fi
1722
891f64b3 1723if test "$amr_nb" = "yes" ; then
1724 echo "#define AMR_NB 1" >> $TMPH
1725 echo "AMR_NB=yes" >> config.mak
1726 echo
bc634f6f
ZK
1727if test "$amr_nb_fixed" = "yes" ; then
1728 echo "AMR_NB_FIXED=yes" >> config.mak
1729 echo "#define AMR_NB_FIXED 1" >> $TMPH
1730 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1731 echo "REL-5 version 5.1.0 from "
184582de 1732 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
891f64b3 1733 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
1734 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1735 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1736 echo
1737else
1738 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1739 echo "REL-5 V5.1.0 from "
184582de 1740 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
bc634f6f 1741 echo "and extracted the source to libavcodec/amr_float"
821e46f4 1742 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
891f64b3 1743 echo
1744fi
1745
2a515c08
TM
1746if test "$amr_if2" = "yes" ; then
1747 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1748fi
1749
bc634f6f
ZK
1750fi
1751
009cf97d 1752for codec in $CODEC_LIST ; do
ce869f59
MN
1753 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1754 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
009cf97d
MN
1755done
1756
a7c02e25 1757diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
1758if test $? -ne 0 ; then
1759 mv -f $TMPH config.h
3d204385 1760else
045ed63f 1761 echo "config.h is unchanged"
3d204385
NK
1762fi
1763
f3ec2d46 1764rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
def4272a
AJ
1765
1766
29799f8b 1767# build pkg-config files libav*.pc and libpostproc.pc
31abdc45 1768lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1769lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1770lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
def4272a
AJ
1771
1772requires=
1773test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
1774test "$vorbis" = "yes" && requires="$requires vorbis"
1775test "$theora" = "yes" && requires="$requires theora"
31abdc45 1776test "$faad" = "yes" && test "$faadbin" = "no" && extralibs="$extralibs -lfaad"
1777
1778# libavutil.pc
1779cat <<EOF >libavutil.pc
1780prefix=$prefix
1781exec_prefix=\${prefix}
1782libdir=\${exec_prefix}/lib
1783includedir=\${prefix}/include
1784
1785Name: libavutil
1786Description: FFmpeg utility library
1787Version: $lavu_version
1788Requires:
1789Conflicts:
1790Libs: -L\${libdir} -lavutil
1791Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1792EOF
1793
1794cat <<EOF >libavutil-uninstalled.pc
1795prefix=
1796exec_prefix=
1797libdir=\${pcfiledir}/libavutil
1798includedir=\${pcfiledir}/libavutil
1799
1800Name: libavutil
1801Description: FFmpeg utility library
1802Version: $lavu_version
1803Requires:
1804Conflicts:
1805Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1806Cflags: -I\${includedir}
1807EOF
def4272a
AJ
1808
1809# libavcodec.pc
1810cat <<EOF >libavcodec.pc
1811prefix=$prefix
1812exec_prefix=\${prefix}
1813libdir=\${exec_prefix}/lib
1814includedir=\${prefix}/include
1815
1816Name: libavcodec
1817Description: FFmpeg codec library
31abdc45 1818Version: $lavc_version
1819Requires: $requires libavutil = $lavu_version
def4272a
AJ
1820Conflicts:
1821Libs: -L\${libdir} -lavcodec $extralibs
1822Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1823EOF
1824
1825cat <<EOF >libavcodec-uninstalled.pc
1826prefix=
1827exec_prefix=
1828libdir=\${pcfiledir}/libavcodec
1829includedir=\${pcfiledir}/libavcodec
1830
1831Name: libavcodec
1832Description: FFmpeg codec library
31abdc45 1833Version: $lavc_version
1834Requires: $requires libavutil = $lavu_version
def4272a
AJ
1835Conflicts:
1836Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1837Cflags: -I\${includedir}
1838EOF
1839
1840# libavformat.pc
1841cat <<EOF >libavformat.pc
1842prefix=$prefix
1843exec_prefix=\${prefix}
1844libdir=\${exec_prefix}/lib
1845includedir=\${prefix}/include
1846
1847Name: libavformat
1848Description: FFmpeg container format library
31abdc45 1849Version: $lavf_version
1850Requires: $requires libavcodec = $lavc_version
def4272a
AJ
1851Conflicts:
1852Libs: -L\${libdir} -lavformat $extralibs
1853Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1854EOF
1855
1856cat <<EOF >libavformat-uninstalled.pc
1857prefix=
1858exec_prefix=
1859libdir=\${pcfiledir}/libavformat
1860includedir=\${pcfiledir}/libavformat
1861
1862Name: libavformat
1863Description: FFmpeg container format library
31abdc45 1864Version: $lavf_version
1865Requires: $requires libavcodec = $lavc_version
def4272a
AJ
1866Conflicts:
1867Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1868Cflags: -I\${includedir}
1869EOF
1870
1871
1872# libpostproc.pc
1873cat <<EOF >libpostproc.pc
1874prefix=$prefix
1875exec_prefix=\${prefix}
1876libdir=\${exec_prefix}/lib
1877includedir=\${prefix}/include
1878
1879Name: libpostproc
1880Description: FFmpeg post processing library
31abdc45 1881Version: $lavc_version
def4272a
AJ
1882Requires:
1883Conflicts:
1884Libs: -L\${libdir} -lpostproc
1885Cflags: -I\${includedir} -I\${includedir}/postproc
1886EOF
1887
1888cat <<EOF >libpostproc-uninstalled.pc
1889prefix=
1890exec_prefix=
1891libdir=\${pcfiledir}/libavcodec/libpostproc
1892includedir=\${pcfiledir}/libavcodec/libpostproc
1893
1894Name: libpostproc
1895Description: FFmpeg post processing library
31abdc45 1896Version: $lavc_version
def4272a
AJ
1897Requires:
1898Conflicts:
1899Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1900Cflags: -I\${includedir}
1901EOF