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