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