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