Replace CONFIG_ENCODERS/CONFIG_DECODERS with CONFIG_MUXERS/CONFIG_DEMUXERS
[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 ;;
de6d9b64
FB
544 esac
545done
546
5c5dea3f 547if test "$theora" = "yes" ; then
9146ca37
MR
548 if test "$libogg" = "no"; then
549 echo "libogg must be enabled to enable Theora"
5c5dea3f
NB
550 fail="yes"
551 theora="no"
552 fi
553fi
554
555if test "$vorbis" = "yes" ; then
9146ca37
MR
556 if test "$libogg" = "no"; then
557 echo "libogg must be enabled to enable Vorbis"
5c5dea3f
NB
558 fail="yes"
559 vorbis="no"
560 fi
561fi
562
b2e3c528
MN
563if test "$gpl" != "yes"; then
564 if test "$pp" != "no" -o "$shared_pp" != "no"; then
565 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
566 fail="yes"
567 fi
568
569 if test "$a52" != "no" -o "$a52bin" != "no"; then
570 echo "liba52 is under GPL and --enable-gpl is not specified"
571 fail="yes"
572 fi
23c99253 573
1ddadfa9
AT
574 if test "$xvid" != "no"; then
575 echo "libxvidcore is under GPL and --enable-gpl is not specified"
576 fail="yes"
577 fi
578
6662ec29
MN
579 if test "$x264" != "no"; then
580 echo "x264 is under GPL and --enable-gpl is not specified"
581 fail="yes"
582 fi
583
23c99253
MN
584 if test "$dts" != "no"; then
585 echo "libdts is under GPL and --enable-gpl is not specified"
586 fail="yes"
587 fi
b2e3c528
MN
588
589 if test "$faad" != "no" -o "$faadbin" != "no"; then
590 cat > $TMPC << EOF
591 #include <faad.h>
592 int main( void ) { return 0; }
593EOF
594
595 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
596 cat > $TMPC << EOF
597 #include <faad.h>
598 #ifndef FAAD2_VERSION
599 ok faad1
600 #endif
601 int main( void ) { return 0; }
602EOF
603 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
604 echo "faad2 is under GPL and --enable-gpl is not specified"
605 fail="yes"
606 fi
607 else
608 faad="no"
609 faadbin="no"
610 echo "faad test failed"
611 fi
612 fi
613
614
a18b5183 615 if test "$fail" = "yes"; then
b2e3c528
MN
616 exit 1
617 fi
618fi
619
0f3cb305
FB
620# compute mmx state
621if test $mmx = "default"; then
053dea12 622 if test $cpu = "x86" -o $cpu = "x86_64"; then
0f3cb305
FB
623 mmx="yes"
624 else
625 mmx="no"
626 fi
627fi
628
eba9ae3c
GB
629# check iwmmxt support
630if test $iwmmxt = "default" -a $cpu = "armv4l"; then
631 cat > $TMPC << EOF
632 int main(void) {
633 __asm__ __volatile__ ("wunpckelub wr6, wr4");
634 }
635EOF
636
637 iwmmxt=no
638 if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
639 iwmmxt=yes
640 fi
641fi
642
cf9d24ad 643#Darwin CC versions
75388c74 644needmdynamicnopic="no"
cf9d24ad 645if test $targetos = Darwin; then
b2924696 646 if test -n "`$cc -v 2>&1 | grep xlc`"; then
747a0554 647 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
cf9d24ad 648 else
b2924696 649 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
cf9d24ad
DC
650 case "$gcc_version" in
651 *2.95*)
747a0554 652 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
cf9d24ad 653 ;;
369a02c2 654 *[34].*)
747a0554 655 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
75388c74
MN
656 if test "$lshared" = no; then
657 needmdynamicnopic="yes"
658 fi
cf9d24ad
DC
659 ;;
660 *)
747a0554 661 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
75388c74
MN
662 if test "$lshared" = no; then
663 needmdynamicnopic="yes"
664 fi
cf9d24ad
DC
665 ;;
666 esac
667 fi
668fi
669
ab6c65f6
BF
670# Can only do AltiVec on PowerPC
671if test $altivec = "default"; then
672 if test $cpu = "powerpc"; then
673 altivec="yes"
674 else
675 altivec="no"
676 fi
677fi
678
a4adb608
MN
679# Add processor-specific flags
680TUNECPU="generic"
9007f514 681POWERPCMODE="32bits"
a4adb608
MN
682if test $tune != "generic"; then
683 case $tune in
684 601|ppc601|PowerPC601)
685 CFLAGS="$CFLAGS -mcpu=601"
686 if test $altivec = "yes"; then
687 echo "WARNING: tuning for PPC601 but altivec enabled !";
688 fi
689 TUNECPU=ppc601
690 ;;
691 603*|ppc603*|PowerPC603*)
692 CFLAGS="$CFLAGS -mcpu=603"
693 if test $altivec = "yes"; then
694 echo "WARNING: tuning for PPC603 but altivec enabled !";
695 fi
696 TUNECPU=ppc603
697 ;;
698 604*|ppc604*|PowerPC604*)
699 CFLAGS="$CFLAGS -mcpu=604"
700 if test $altivec = "yes"; then
701 echo "WARNING: tuning for PPC604 but altivec enabled !";
702 fi
703 TUNECPU=ppc604
704 ;;
8d6625b6 705 G3|g3|75*|ppc75*|PowerPC75*)
fe0f2a97 706 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
a4adb608
MN
707 if test $altivec = "yes"; then
708 echo "WARNING: tuning for PPC75x but altivec enabled !";
709 fi
710 TUNECPU=ppc750
711 ;;
8d6625b6 712 G4|g4|745*|ppc745*|PowerPC745*)
fe0f2a97 713 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
3efd4952
RD
714 if test $altivec = "no"; then
715 echo "WARNING: tuning for PPC745x but altivec disabled !";
716 fi
717 TUNECPU=ppc7450
718 ;;
719 74*|ppc74*|PowerPC74*)
fe0f2a97 720 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
a4adb608
MN
721 if test $altivec = "no"; then
722 echo "WARNING: tuning for PPC74xx but altivec disabled !";
723 fi
e45a2872 724 TUNECPU=ppc7400
a4adb608 725 ;;
8d6625b6 726 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
9007f514 727 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
a4adb608
MN
728 if test $altivec = "no"; then
729 echo "WARNING: tuning for PPC970 but altivec disabled !";
730 fi
731 TUNECPU=ppc970
9007f514 732 POWERPCMODE="64bits"
a4adb608 733 ;;
efc39ba8
MR
734 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)
735 CFLAGS="$CFLAGS -march=$tune"
736 ;;
a4adb608 737 *)
efc39ba8 738 echo "WARNING: unknown CPU \"$tune\", ignored"
a4adb608
MN
739 ;;
740 esac
741fi
742
cf9d24ad 743# AltiVec flags: The FSF version of GCC differs from the Apple version
b6e52719
MD
744if test $cpu = "powerpc"; then
745 if test $altivec = "yes"; then
b2924696 746 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
49f1a349 747 CFLAGS="$CFLAGS -faltivec"
b6e52719
MD
748 else
749 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
750 fi
751 fi
752fi
753
a9a07762
MN
754# See if we have <altivec.h>
755cat > $TMPC << EOF
756#include <altivec.h>
757int main( void ) { return 0; }
758EOF
759
760_altivec_h="no"
b6e52719 761if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
a9a07762
MN
762_altivec_h="yes"
763fi
764
ab6c65f6
BF
765# See does our compiler support Motorola AltiVec C API
766if test $altivec = "yes"; then
a9a07762 767if test $_altivec_h = "yes"; then
ab6c65f6 768cat > $TMPC << EOF
a9a07762 769#include <altivec.h>
ab6c65f6
BF
770int main(void) {
771 vector signed int v1, v2, v3;
772 v1 = vec_add(v2,v3);
773 return 0;
774}
775EOF
a9a07762
MN
776else
777cat > $TMPC << EOF
778int main(void) {
779 vector signed int v1, v2, v3;
780 v1 = vec_add(v2,v3);
781 return 0;
782}
783EOF
784fi
b6e52719 785$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
ab6c65f6
BF
786fi
787
d46aba26
LS
788# Can only do mmi on mips
789if test $mmi = "default"; then
790 if test $cpu = "mips"; then
791 mmi="yes"
792 else
793 mmi="no"
794 fi
795fi
796
797# See does our compiler support mmi
798if test $mmi = "yes"; then
799cat > $TMPC << EOF
800int main(void) {
801 __asm__ ("lq \$2, 0(\$2)");
802 return 0;
803}
804EOF
f3ec2d46 805$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
d46aba26
LS
806fi
807
732d9245 808if test "$mingw32" = "yes" ; then
732d9245 809 v4l="no"
6beefa40 810 bktr="no"
732d9245 811 audio_oss="no"
8aa3ee32 812 dv1394="no"
f02be79d 813 dc1394="no"
951bf3e6 814 ffserver="no"
732d9245 815 network="no"
951bf3e6
FB
816 SLIBPREF=""
817 SLIBSUF=".dll"
818 EXESUF=".exe"
eba9ae3c
GB
819 if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
820 if test "$force_libdir" != yes; then bindir="$prefix"; fi
732d9245
BE
821fi
822
0f3cb305
FB
823cc="${cross_prefix}${cc}"
824ar="${cross_prefix}${ar}"
be7109c1 825ranlib="${cross_prefix}${ranlib}"
0f3cb305
FB
826strip="${cross_prefix}${strip}"
827
487a54d7
FB
828if test -z "$cross_prefix" ; then
829
3d204385 830# ---
a3999908
MN
831# big/little endian test
832cat > $TMPC << EOF
833#include <inttypes.h>
834int main(int argc, char ** argv){
835 volatile uint32_t i=0x01234567;
836 return (*((uint8_t*)(&i))) == 0x67;
837}
838EOF
839
f3ec2d46
SG
840if $cc -o $TMPE $TMPC 2>/dev/null ; then
841$TMPE && bigendian="yes"
a3999908
MN
842else
843echo big/little test failed
844fi
845
487a54d7
FB
846else
847
848# if cross compiling, cannot launch a program, so make a static guess
849if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
850 bigendian="yes"
851fi
852
853fi
854
a3999908 855# ---
7f965c1c
CF
856# *inttypes.h* test
857cat > $TMPC << EOF
858#include <inttypes.h>
859int main(int argc, char ** argv){
860 return 0;
861}
862EOF
863
864$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
865
866# ---
b5c950c4
MN
867# *int_fast* test
868cat > $TMPC << EOF
869#include <inttypes.h>
870int main(int argc, char ** argv){
871 volatile uint_fast64_t i=0x01234567;
872 return 0;
873}
874EOF
875
876$cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
877
878# ---
3d204385
NK
879# check availability of some header files
880
881cat > $TMPC << EOF
882#include <malloc.h>
883int main( void ) { return 0; }
884EOF
885
886_memalign=no
887_malloc_h=no
f3ec2d46 888if $cc -o $TMPE $TMPC 2> /dev/null ; then
3d204385
NK
889_malloc_h=yes
890_memalign=yes
891# check for memalign - atmos
892cat > $TMPC << EOF
487c2fad 893#include <stdio.h>
3d204385
NK
894#include <malloc.h>
895int main ( void ) {
896char *string = NULL;
897string = memalign(64, sizeof(char));
898return 0;
899}
900EOF
f3ec2d46 901$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
3d204385
NK
902fi
903
8bf5d58f
MN
904if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
905 echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
906 exit 1
907fi
908
68892110 909cat > $TMPC << EOF
5e4639e2
GM
910#include <time.h>
911int main( void ) { localtime_r(NULL, NULL); }
912EOF
913
914localtime_r=no
915if $cc -o $TMPE $TMPC 2> /dev/null ; then
916 localtime_r=yes
917fi
918
0147f198
FR
919if test "$zlib" = "yes"; then
920# check for zlib - mmu_man
921cat > $TMPC << EOF
922#include <zlib.h>
923int main ( void ) {
924if (zlibVersion() != ZLIB_VERSION)
925 puts("zlib version differs !!!");
926 return 1;
927return 0;
928}
929EOF
e27ca59b 930$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
f3ec2d46 931# $TMPE 2> /dev/null > /dev/null || zlib="no"
0147f198
FR
932# XXX: more tests needed - runtime test
933fi
934if test "$zlib" = "yes"; then
935extralibs="$extralibs -lz"
936fi
937
95e2ce4a
MN
938# test for lrintf in math.h
939cat > $TMPC << EOF
940#define _ISOC9X_SOURCE 1
941#include <math.h>
942int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
943EOF
944
945have_lrintf="no"
f3ec2d46 946if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
95e2ce4a 947 have_lrintf="yes"
c2b9685e
MN
948 # allanc@chickenandporn.com: cannot execute cross-compiled
949 # code on the host. Only execute if not cross-compiling.
950 if test -z "$cross_prefix" ; then
951 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
952 fi
95e2ce4a
MN
953fi
954
c13e1abd
FH
955_restrict=
956for restrict_keyword in restrict __restrict__ __restrict; do
957 echo "void foo(char * $restrict_keyword p);" > $TMPC
958 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
959 _restrict=$restrict_keyword
960 break;
961 fi
962done
963
52b41d7f
FB
964# test gcc version to see if vector builtins can be used
965# currently only used on i386 for MMX builtins
966cat > $TMPC << EOF
053dea12 967#include <xmmintrin.h>
52b41d7f
FB
968int main(void) {
969#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
970return 0;
971#else
972#error no vector builtins
973#endif
974}
975EOF
976
977builtin_vector=no
13c2469d 978if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
52b41d7f 979 builtin_vector=yes
a8721c09
FB
980fi
981
982# dlopen/dlfcn.h probing
983
984cat > $TMPC << EOF
985#include <dlfcn.h>
986int main( void ) { return (int) dlopen("foo", 0); }
987EOF
988
989ldl=-ldl
990
cf9d24ad 991if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
992dlfcn=yes
993dlopen=yes
994fi
995
cf9d24ad 996if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
997dlfcn=yes
998dlopen=yes
999ldl=""
1000fi
1001
1002cat > $TMPC << EOF
1003int main( void ) { return (int) dlopen("foo", 0); }
1004EOF
1005
cf9d24ad 1006if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
1007dlopen=yes
1008fi
1009
cf9d24ad 1010if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
1011dlopen=yes
1012ldl=""
1013fi
1014
1015if test "$vhook" = "default" ; then
1016 vhook="$dlopen"
1017fi
1018
bfd2edeb
MN
1019if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1020 extralibs="$extralibs $ldl"
1021fi
1022
1023
a86b921c
FB
1024##########################################
1025# imlib probe
1026
a8721c09
FB
1027cat > $TMPC << EOF
1028#include <X11/Xlib.h>
1029#include <Imlib2.h>
1030int main( void ) { return (int) imlib_load_font("foo"); }
1031EOF
1032
1033imlib2=no
56b04ceb 1034if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
a8721c09 1035imlib2=yes
52b41d7f
FB
1036fi
1037
a86b921c
FB
1038##########################################
1039# freetype probe
1040
04511d53
PG
1041cat > $TMPC << EOF
1042#include <ft2build.h>
1043int main( void ) { return (int) FT_Init_FreeType(0); }
1044EOF
1045
1046freetype2=no
69db4e10 1047if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
e2a3cd59 1048 if (freetype-config --version) >/dev/null 2>&1 ; then
cf9d24ad 1049 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
dee076fc 1050 freetype2=yes
04511d53 1051 fi
dee076fc 1052 fi
04511d53
PG
1053fi
1054
a86b921c
FB
1055##########################################
1056# SDL probe
1057
1058cat > $TMPC << EOF
1059#include <SDL.h>
31319a8c 1060#undef main /* We don't want SDL to override our main() */
a86b921c
FB
1061int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1062EOF
1063
1064sdl_too_old=no
1065sdl=no
e2a3cd59 1066if (sdl-config --version) >/dev/null 2>&1 ; then
cf9d24ad 1067if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
a86b921c
FB
1068_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1069if test "$_sdlversion" -lt 121 ; then
1070sdl_too_old=yes
1071else
1072sdl=yes
1073fi
1074fi
c3f6b472 1075fi
a86b921c 1076
146ea952
NB
1077##########################################
1078# texi2html probe
1079
1080texi2html=no
e2a3cd59 1081if (texi2html -version) >/dev/null 2>&1; then
146ea952
NB
1082texi2html=yes
1083fi
1084
7a91333f
HZ
1085if test "$network" = "yes" ; then
1086##########################################
1087# IPv6 probe
1088
1089cat > $TMPC << EOF
1090#include <sys/types.h>
1091#include <sys/socket.h>
1092#include <netinet/in.h>
1093#include <netdb.h>
1094int main( void ) {
1095 struct sockaddr_storage saddr;
1096 struct ipv6_mreq mreq6;
1097 getaddrinfo(0,0,0,0);
1098 getnameinfo(0,0,0,0,0,0,0);
1099 IN6_IS_ADDR_MULTICAST(0);
1100}
1101EOF
1102
1103ipv6=no
1104if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1105ipv6=yes
1106fi
1107fi
1108
b2924696 1109case "`$cc -v 2>&1 | grep version`" in
cf9d24ad 1110 *gcc*)
2f3eca08 1111 CFLAGS="-Wall -Wno-switch $CFLAGS"
cf9d24ad
DC
1112 ;;
1113 *)
1114 ;;
1115esac
1116
94a3401e
FB
1117if test "$sdl" = "no" ; then
1118 ffplay=no
1119fi
1120
cddf3f45 1121if test "$debug" = "yes"; then
7906085f 1122 CFLAGS="-g $CFLAGS"
cddf3f45
GM
1123fi
1124
1125if test "$optimize" = "small"; then
98ca7790 1126# CFLAGS=${CFLAGS//-O3/-Os}
553a6284
MN
1127 CFLAGS="$CFLAGS -Os"
1128fi
1129
cddf3f45 1130if test "$optimize" = "yes"; then
b2924696 1131 if test -n "`$cc -v 2>&1 | grep xlc`"; then
cf9d24ad
DC
1132 CFLAGS="$CFLAGS -O5"
1133 LDFLAGS="$LDFLAGS -O5"
1134 else
7906085f 1135 CFLAGS="-O3 $CFLAGS"
cf9d24ad 1136 fi
cddf3f45
GM
1137fi
1138
80581e98
MN
1139# PIC flags for shared library objects where they are needed
1140if test "$lshared" = "yes" ; then
1141 # LIBOBJFLAGS may have already been set in the OS configuration
1142 if test -z "$LIBOBJFLAGS" ; then
966265bc 1143 if test "$cpu" = "x86_64" -o "$cpu" = "ia64" ; then
80581e98
MN
1144 LIBOBJFLAGS="\$(PIC)"
1145 fi
1146 fi
1147fi
1148
951bf3e6
FB
1149if test x"$bindir" = x""; then
1150bindir="${prefix}/bin"
1151fi
1152
cc973ecb
LB
1153if test x"$libdir" = x""; then
1154libdir="${prefix}/lib"
1155fi
1156
23a65308
FB
1157if test x"$mandir" = x""; then
1158mandir="${prefix}/man"
1159fi
1160
de6d9b64 1161echo "Install prefix $prefix"
0f3cb305 1162echo "Source path $source_path"
de6d9b64 1163echo "C compiler $cc"
4a908fbc 1164echo "make $make"
a4adb608 1165echo "CPU $cpu ($tune)"
eb94aca9
CY
1166if test "$BUILDSUF" != ""; then
1167echo "Build suffix $BUILDSUF"
1168fi
0f3cb305 1169echo "Big Endian $bigendian"
7f965c1c 1170echo "inttypes.h $inttypes"
b5c950c4 1171echo "broken inttypes.h $emu_fast_int"
053dea12 1172if test $cpu = "x86" -o $cpu = "x86_64"; then
de6d9b64 1173echo "MMX enabled $mmx"
52b41d7f 1174echo "Vector Builtins $builtin_vector"
e41e8342 1175fi
eba9ae3c
GB
1176if test $cpu = "armv4l"; then
1177echo "IWMMXT enabled $iwmmxt"
1178fi
e41e8342 1179if test $cpu = "mips"; then
d46aba26 1180echo "MMI enabled $mmi"
e41e8342
FB
1181fi
1182if test $cpu = "powerpc"; then
ab6c65f6 1183echo "AltiVec enabled $altivec"
e41e8342 1184fi
de6d9b64 1185echo "gprof enabled $gprof"
0147f198 1186echo "zlib enabled $zlib"
bb4c2140 1187echo "libgsm enabled $libgsm"
a6741398 1188echo "mp3lame enabled $mp3lame"
9146ca37 1189echo "libogg enabled $libogg"
81e0d0b4 1190echo "vorbis enabled $vorbis"
5c5dea3f 1191echo "theora enabled $theora"
445ad18d
ZK
1192echo "faad enabled $faad"
1193echo "faadbin enabled $faadbin"
29d48296 1194echo "faac enabled $faac"
1ddadfa9 1195echo "xvid enabled $xvid"
6662ec29 1196echo "x264 enabled $x264"
5cbcf02c 1197echo "a52 support $a52"
57514323 1198echo "a52 dlopened $a52bin"
23c99253 1199echo "dts support $dts"
bba9b16c 1200echo "pp support $pp"
cddf3f45 1201echo "debug symbols $debug"
65d1bea2 1202echo "strip symbols $dostrip"
cddf3f45 1203echo "optimize $optimize"
bba9b16c 1204echo "shared pp $shared_pp"
47930f09 1205echo "Video hooking $vhook"
a86b921c
FB
1206echo "SDL support $sdl"
1207if test $sdl_too_old = "yes"; then
1208echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1209fi
68892110
PG
1210
1211if test "$vhook" = "yes" ; then
47930f09 1212echo "Imlib2 support $imlib2"
04511d53 1213echo "freetype support $freetype2"
68892110 1214fi
f80f7964 1215echo "Sun medialib support" $sunmlib
9c3d33d6 1216echo "pthreads support" $pthreads
bc634f6f
ZK
1217echo "AMR-NB float support" $amr_nb
1218echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 1219echo "AMR-WB float support" $amr_wb
2a515c08 1220echo "AMR-WB IF2 support" $amr_if2
7a91333f
HZ
1221echo "network support $network"
1222if test "$network" = "yes" ; then
1223echo "IPv6 support $ipv6"
1224fi
b2e3c528
MN
1225if test "$gpl" = "no" ; then
1226echo "License: LGPL"
1227else
1228echo "License: GPL"
1229fi
de6d9b64 1230
980fc7b8 1231echo "Creating config.mak and config.h"
de6d9b64 1232
f255e0ab
MB
1233date >> config.log
1234echo " $0 $FFMPEG_CONFIGURATION" >> config.log
980fc7b8 1235echo "# Automatically generated by configure - do not modify" > config.mak
045ed63f 1236echo "/* Automatically generated by configure - do not modify */" > $TMPH
f255e0ab 1237echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
de6d9b64 1238
980fc7b8 1239echo "prefix=$prefix" >> config.mak
cc973ecb 1240echo "libdir=$libdir" >> config.mak
951bf3e6 1241echo "bindir=$bindir" >> config.mak
23a65308 1242echo "mandir=$mandir" >> config.mak
4a908fbc 1243echo "MAKE=$make" >> config.mak
980fc7b8
FB
1244echo "CC=$cc" >> config.mak
1245echo "AR=$ar" >> config.mak
be7109c1 1246echo "RANLIB=$ranlib" >> config.mak
65d1bea2 1247if test "$dostrip" = "yes" ; then
0f3cb305 1248echo "STRIP=$strip" >> config.mak
65d1bea2
MB
1249echo "INSTALLSTRIP=-s" >> config.mak
1250else
1251echo "STRIP=echo ignoring strip" >> config.mak
1252echo "INSTALLSTRIP=" >> config.mak
1253fi
75388c74
MN
1254
1255# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1256# shared modules on OS/X (vhook/Makefile).
1257SHCFLAGS=$CFLAGS
1258if test "$needmdynamicnopic" = yes; then
1259 CFLAGS="$CFLAGS -mdynamic-no-pic"
1260fi
1261
a9b3f630 1262echo "OPTFLAGS=$CFLAGS" >> config.mak
75388c74 1263echo "SHCFLAGS=$SHCFLAGS">>config.mak
0f3cb305 1264echo "LDFLAGS=$LDFLAGS" >> config.mak
f39e56a8 1265echo "LDCONFIG=$LDCONFIG" >> config.mak
4baca069 1266echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 1267echo "SHFLAGS=$SHFLAGS" >> config.mak
80581e98 1268echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
eb94aca9 1269echo "BUILDSUF=$BUILDSUF" >> config.mak
f3ec2d46 1270echo "LIBPREF=$LIBPREF" >> config.mak
eb94aca9 1271echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
f3ec2d46 1272echo "SLIBPREF=$SLIBPREF" >> config.mak
eb94aca9
CY
1273echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1274echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
6852ac95 1275echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 1276if test "$cpu" = "x86" ; then
980fc7b8 1277 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 1278 echo "#define ARCH_X86 1" >> $TMPH
053dea12
AJ
1279elif test "$cpu" = "x86_64" ; then
1280 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1281 echo "#define ARCH_X86_64 1" >> $TMPH
0f3cb305 1282elif test "$cpu" = "armv4l" ; then
6ed7422a 1283 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 1284 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 1285elif test "$cpu" = "alpha" ; then
91d1f1a4 1286 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 1287 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
1288elif test "$cpu" = "sparc64" ; then
1289 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1290 echo "#define ARCH_SPARC64 1" >> $TMPH
bb476ff3
JM
1291 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1292 echo "#define ARCH_SPARC 1" >> $TMPH
1293elif test "$cpu" = "sparc" ; then
1294 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1295 echo "#define ARCH_SPARC 1" >> $TMPH
0f3cb305
FB
1296elif test "$cpu" = "powerpc" ; then
1297 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1298 echo "#define ARCH_POWERPC 1" >> $TMPH
9007f514
RD
1299 if test $POWERPCMODE = "32bits"; then
1300 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1301 else
1302 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1303 fi
e45a2872
RD
1304 if test "$powerpc_perf" = "yes"; then
1305 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1306 fi
d46aba26
LS
1307elif test "$cpu" = "mips" ; then
1308 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1309 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
1310elif test "$cpu" = "sh4" ; then
1311 echo "TARGET_ARCH_SH4=yes" >> config.mak
1312 echo "#define ARCH_SH4 1" >> $TMPH
1313fi
a4adb608 1314echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
1315if test "$bigendian" = "yes" ; then
1316 echo "WORDS_BIGENDIAN=yes" >> config.mak
1317 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 1318fi
d2a9bddd
MN
1319if test "$inttypes" != "yes" ; then
1320 echo "#define EMULATE_INTTYPES 1" >> $TMPH
7f965c1c 1321fi
b5c950c4 1322if test "$emu_fast_int" = "yes" ; then
19d053c5 1323 echo "#define EMULATE_FAST_INT 1" >> $TMPH
b5c950c4 1324fi
57514323 1325if test "$mmx" = "yes" ; then
980fc7b8 1326 echo "TARGET_MMX=yes" >> config.mak
045ed63f 1327 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 1328 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 1329fi
52b41d7f
FB
1330if test "$builtin_vector" = "yes" ; then
1331 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1332 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1333fi
eba9ae3c
GB
1334if test "$iwmmxt" = "yes" ; then
1335 echo "TARGET_IWMMXT=yes" >> config.mak
1336 echo "#define HAVE_IWMMXT 1" >> $TMPH
1337fi
d46aba26
LS
1338if test "$mmi" = "yes" ; then
1339 echo "TARGET_MMI=yes" >> config.mak
1340 echo "#define HAVE_MMI 1" >> $TMPH
1341fi
ab6c65f6
BF
1342if test "$altivec" = "yes" ; then
1343 echo "TARGET_ALTIVEC=yes" >> config.mak
1344 echo "#define HAVE_ALTIVEC 1" >> $TMPH
db40a39a
MN
1345 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1346 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
a9a07762
MN
1347 if test "$_altivec_h" = "yes" ; then
1348 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1349 else
e67e14d5 1350 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
a9a07762 1351 fi
ab6c65f6 1352fi
57514323 1353if test "$gprof" = "yes" ; then
980fc7b8 1354 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 1355 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 1356fi
5e4639e2
GM
1357if test "$localtime_r" = "yes" ; then
1358 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 1359fi
68892110
PG
1360if test "$imlib2" = "yes" ; then
1361 echo "HAVE_IMLIB2=yes" >> config.mak
1362fi
04511d53
PG
1363if test "$freetype2" = "yes" ; then
1364 echo "HAVE_FREETYPE2=yes" >> config.mak
1365fi
f80f7964
RS
1366if test "$sunmlib" = "yes" ; then
1367 echo "HAVE_MLIB=yes" >> config.mak
1368 echo "#define HAVE_MLIB 1" >> $TMPH
1369 extralibs="$extralibs -lmlib"
1370fi
9c3d33d6
MN
1371if test "$pthreads" = "yes" ; then
1372 echo "HAVE_PTHREADS=yes" >> config.mak
1373 echo "#define HAVE_PTHREADS 1" >> $TMPH
2450cff2 1374 echo "#define HAVE_THREADS 1" >> $TMPH
8c802695 1375 if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
12043e1d
SS
1376 extralibs="$extralibs -lpthread"
1377 fi
9c3d33d6 1378fi
a86b921c
FB
1379if test "$sdl" = "yes" ; then
1380 echo "CONFIG_SDL=yes" >> config.mak
1381 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1382 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1383fi
146ea952
NB
1384if test "$texi2html" = "yes"; then
1385 echo "BUILD_DOC=yes" >> config.mak
1386fi
95e2ce4a
MN
1387if test "$have_lrintf" = "yes" ; then
1388 echo "#define HAVE_LRINTF 1" >> $TMPH
1389fi
68892110
PG
1390if test "$vhook" = "yes" ; then
1391 echo "BUILD_VHOOK=yes" >> config.mak
1392 echo "#define HAVE_VHOOK 1" >> $TMPH
68892110 1393fi
57514323 1394if test "$lshared" = "yes" ; then
0319c531 1395 echo "BUILD_SHARED=yes" >> config.mak
97006039 1396 echo "PIC=-fPIC -DPIC" >> config.mak
0319c531 1397fi
ef0bc4c9 1398echo "EXTRALIBS=$extralibs" >> config.mak
281a74da 1399version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
258207b7
FB
1400 cut -d '"' -f 2`
1401echo "VERSION=$version" >>config.mak
d771bcae 1402# if you do not want to use encoders, disable that.
045ed63f 1403echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
1404echo "CONFIG_ENCODERS=yes" >> config.mak
1405
1406# if you do not want to use decoders, disable that.
045ed63f 1407echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
1408echo "CONFIG_DECODERS=yes" >> config.mak
1409
a9e35095
DB
1410# muxers
1411if test "$muxers" = "yes" ; then
1412 echo "#define CONFIG_MUXERS 1" >> $TMPH
1413 echo "CONFIG_MUXERS=yes" >> config.mak
1414fi
1415
1416# demuxers
1417if test "$demuxers" = "yes" ; then
1418 echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1419 echo "CONFIG_DEMUXERS=yes" >> config.mak
1420fi
1421
5cbcf02c
FB
1422# AC3
1423if test "$a52" = "yes" ; then
1424 echo "#define CONFIG_AC3 1" >> $TMPH
1425 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 1426
5cbcf02c
FB
1427 if test "$a52bin" = "yes" ; then
1428 echo "#define CONFIG_A52BIN 1" >> $TMPH
1429 echo "CONFIG_A52BIN=yes" >> config.mak
1430 fi
1431fi
1432
23c99253
MN
1433# DTS
1434if test "$dts" = "yes" ; then
1435 echo "#define CONFIG_DTS 1" >> $TMPH
1436 echo "CONFIG_DTS=yes" >> config.mak
1437fi
1438
bba9b16c
MN
1439# PP
1440if test "$pp" = "yes" ; then
1441 echo "#define CONFIG_PP 1" >> $TMPH
1442 echo "CONFIG_PP=yes" >> config.mak
1443
1444 if test "$shared_pp" = "yes" ; then
1445 echo "#define SHARED_PP 1" >> $TMPH
1446 echo "SHARED_PP=yes" >> config.mak
1447 fi
1448fi
1449
1eb2212e
FB
1450# mpeg audio high precision mode
1451if test "$mpegaudio_hp" = "yes" ; then
1452 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1453fi
1454
5cbcf02c
FB
1455if test "$v4l" = "yes" ; then
1456 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1457 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1458fi
1459
6beefa40
MN
1460if test "$bktr" = "yes" ; then
1461 echo "#define CONFIG_BKTR 1" >> $TMPH
1462 echo "CONFIG_BKTR=yes" >> config.mak
1463fi
1464
8aa3ee32
MK
1465if test "$dv1394" = "yes" ; then
1466 echo "#define CONFIG_DV1394 1" >> $TMPH
1467 echo "CONFIG_DV1394=yes" >> config.mak
1468fi
1469
f02be79d
RS
1470if test "$dc1394" = "yes" ; then
1471 echo "#define CONFIG_DC1394 1" >> $TMPH
1472 echo "CONFIG_DC1394=yes" >> config.mak
1473fi
1474
adbc0510
PG
1475if test "$dlopen" = "yes" ; then
1476 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1477fi
1478
1479if test "$dlfcn" = "yes" ; then
1480 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1481fi
1482
5cbcf02c
FB
1483if test "$audio_oss" = "yes" ; then
1484 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1485 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1486fi
1487
dfdfa47c
FR
1488if test "$audio_beos" = "yes" ; then
1489 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1490 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1491fi
1492
5cbcf02c
FB
1493if test "$network" = "yes" ; then
1494 echo "#define CONFIG_NETWORK 1" >> $TMPH
1495 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1496fi
daf8e955 1497
7a91333f
HZ
1498if test "$ipv6" = "yes" ; then
1499 echo "#define CONFIG_IPV6 1" >> $TMPH
1500fi
1501
0147f198
FR
1502if test "$zlib" = "yes" ; then
1503 echo "#define CONFIG_ZLIB 1" >> $TMPH
1504 echo "CONFIG_ZLIB=yes" >> config.mak
1505fi
1506
bb4c2140
MN
1507if test "$libgsm" = "yes" ; then
1508 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1509 echo "CONFIG_LIBGSM=yes" >> config.mak
1510fi
1511
57514323 1512if test "$mp3lame" = "yes" ; then
045ed63f 1513 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1514 echo "CONFIG_MP3LAME=yes" >> config.mak
1515fi
1516
9146ca37 1517if test "$libogg" = "yes" ; then
5c5dea3f
NB
1518 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1519 echo "CONFIG_LIBOGG=yes" >> config.mak
1520fi
1521
81e0d0b4 1522if test "$vorbis" = "yes" ; then
5c5dea3f
NB
1523 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1524 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1525fi
1526
1527if test "$theora" = "yes" ; then
1528 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1529 echo "CONFIG_LIBTHEORA=yes" >> config.mak
81e0d0b4
MH
1530fi
1531
0fc50e58
ZK
1532if test "$faad" = "yes" ; then
1533 echo "#define CONFIG_FAAD 1" >> $TMPH
1534 echo "CONFIG_FAAD=yes" >> config.mak
1535fi
1536
1537if test "$faadbin" = "yes" ; then
1538 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1539 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1540fi
1541
29d48296
MN
1542if test "$faac" = "yes" ; then
1543 echo "#define CONFIG_FAAC 1" >> $TMPH
1544 echo "CONFIG_FAAC=yes" >> config.mak
1545fi
1546
1ddadfa9
AT
1547if test "$xvid" = "yes" ; then
1548 echo "#define CONFIG_XVID 1" >> $TMPH
1549 echo "CONFIG_XVID=yes" >> config.mak
1550fi
1551
6662ec29
MN
1552if test "$x264" = "yes" ; then
1553 echo "#define CONFIG_X264 1" >> $TMPH
1554 echo "CONFIG_X264=yes" >> config.mak
1555fi
1556
732d9245
BE
1557if test "$mingw32" = "yes" ; then
1558 echo "#define CONFIG_WIN32 1" >> $TMPH
1559 echo "CONFIG_WIN32=yes" >> config.mak
16806499
MN
1560 echo "HAVE_W32THREADS=yes" >> config.mak
1561 echo "#define HAVE_W32THREADS 1" >> $TMPH
2450cff2 1562 echo "#define HAVE_THREADS 1" >> $TMPH
7eea5766 1563 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1564 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1565 echo "#endif" >> $TMPH
3f027ca7
FB
1566fi
1567
f3ec2d46
SG
1568if test "$os2" = "yes" ; then
1569 echo "#define CONFIG_OS2 1" >> $TMPH
1570 echo "CONFIG_OS2=yes" >> config.mak
1571fi
1572
6e023978
RS
1573if test "$TARGET_OS" = "SunOS" ; then
1574 echo "#define CONFIG_SUNOS 1" >> $TMPH
1575fi
1576
2450cff2
FR
1577if test "$TARGET_OS" = "BeOS" ; then
1578 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1579 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1580 echo "#define HAVE_THREADS 1" >> $TMPH
1581fi
1582
90cee0c3
MN
1583if test "$darwin" = "yes"; then
1584 echo "#define CONFIG_DARWIN 1" >> $TMPH
1585 echo "CONFIG_DARWIN=yes" >> config.mak
1586fi
1587
57514323 1588if test "$_malloc_h" = "yes" ; then
045ed63f 1589 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1590else
045ed63f 1591 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1592fi
1593
57514323 1594if test "$_memalign" = "yes" ; then
045ed63f
ZK
1595 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1596else
1597 echo "#undef HAVE_MEMALIGN" >> $TMPH
1598fi
1599
da9b170c
MN
1600if test "$memalignhack" = "yes" ; then
1601 echo "#define MEMALIGN_HACK 1" >> $TMPH
1602fi
1603
1604
26b35efb
FR
1605if test "$netserver" = "yes" ; then
1606 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1607 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1608fi
1609
4baca069
PG
1610if test "$need_inet_aton" = "yes" ; then
1611 echo "NEED_INET_ATON=yes" >> config.mak
1612fi
1613
57514323 1614if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1615 echo "#define SIMPLE_IDCT 1" >> $TMPH
1616fi
1617
8154d2e0
FB
1618if test "$ffserver" = "yes" ; then
1619 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1620 echo "CONFIG_FFSERVER=yes" >> config.mak
1621fi
1622
a86b921c
FB
1623if test "$ffplay" = "yes" ; then
1624 echo "CONFIG_FFPLAY=yes" >> config.mak
1625fi
1626
b2e3c528
MN
1627if test "$gpl" = "yes" ; then
1628 echo "#define CONFIG_GPL 1" >> $TMPH
1629 echo "CONFIG_GPL=yes" >> config.mak
1630fi
1631
c13e1abd
FH
1632echo "#define restrict $_restrict" >> $TMPH
1633
bb801c97
MN
1634if test "$optimize" = "small"; then
1635 echo "#define always_inline" >> $TMPH
1636fi
1637
0f3cb305
FB
1638# build tree in object directory if source path is different from current one
1639if test "$source_path_used" = "yes" ; then
2a4e872b
AS
1640 DIRS="\
1641 doc \
1642 libavformat \
1643 libavcodec \
1644 libavcodec/alpha \
1645 libavcodec/armv4l \
1646 libavcodec/i386 \
1647 libavcodec/sparc \
1648 libavcodec/mlib \
1649 libavcodec/ppc \
1650 libavcodec/liba52 \
1651 libavcodec/libpostproc \
1652 libavutil \
1653 tests \
1654 vhook \
1655 "
1656 FILES="\
1657 Makefile \
1658 libavformat/Makefile \
1659 libavcodec/Makefile \
1660 libavcodec/libpostproc/Makefile \
1661 libavutil/Makefile \
1662 tests/Makefile \
1663 vhook/Makefile \
1664 doc/Makefile \
1665 doc/texi2pod.pl \
1666 "
0f3cb305
FB
1667 for dir in $DIRS ; do
1668 mkdir -p $dir
1669 done
1670 for f in $FILES ; do
281a74da 1671 ln -sf "$source_path/$f" $f
0f3cb305 1672 done
8b8e1c55
PMH
1673 echo "SRC_PATH=$source_path" >> config.mak
1674else
1675 echo "SRC_PATH='$source_path'" >> config.mak
0f3cb305 1676fi
0f3cb305 1677
d663a1fd
MN
1678if test "$amr_wb" = "yes" ; then
1679 echo "#define AMR_WB 1" >> $TMPH
1680 echo "AMR_WB=yes" >> config.mak
1681 echo
1682 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1683 echo "V5.1.0 from "
1684 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1685 echo "and extracted the source to libavcodec/amrwb_float"
1686 echo
1687fi
1688
891f64b3 1689if test "$amr_nb" = "yes" ; then
1690 echo "#define AMR_NB 1" >> $TMPH
1691 echo "AMR_NB=yes" >> config.mak
1692 echo
bc634f6f
ZK
1693if test "$amr_nb_fixed" = "yes" ; then
1694 echo "AMR_NB_FIXED=yes" >> config.mak
1695 echo "#define AMR_NB_FIXED 1" >> $TMPH
1696 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1697 echo "REL-5 version 5.1.0 from "
184582de 1698 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
891f64b3 1699 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
1700 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1701 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1702 echo
1703else
1704 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1705 echo "REL-5 V5.1.0 from "
184582de 1706 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
bc634f6f 1707 echo "and extracted the source to libavcodec/amr_float"
821e46f4 1708 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
891f64b3 1709 echo
1710fi
1711
2a515c08
TM
1712if test "$amr_if2" = "yes" ; then
1713 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1714fi
1715
bc634f6f
ZK
1716fi
1717
009cf97d 1718for codec in $CODEC_LIST ; do
ce869f59
MN
1719 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1720 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
009cf97d
MN
1721done
1722
a7c02e25 1723diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
1724if test $? -ne 0 ; then
1725 mv -f $TMPH config.h
3d204385 1726else
045ed63f 1727 echo "config.h is unchanged"
3d204385
NK
1728fi
1729
f3ec2d46 1730rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
def4272a
AJ
1731
1732
1733# build pkg-config files libavcodec.pc, libavformat.pc and libpostproc.pc
31abdc45 1734lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1735lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1736lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
def4272a
AJ
1737
1738requires=
1739test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
1740test "$vorbis" = "yes" && requires="$requires vorbis"
1741test "$theora" = "yes" && requires="$requires theora"
31abdc45 1742test "$faad" = "yes" && test "$faadbin" = "no" && extralibs="$extralibs -lfaad"
1743
1744# libavutil.pc
1745cat <<EOF >libavutil.pc
1746prefix=$prefix
1747exec_prefix=\${prefix}
1748libdir=\${exec_prefix}/lib
1749includedir=\${prefix}/include
1750
1751Name: libavutil
1752Description: FFmpeg utility library
1753Version: $lavu_version
1754Requires:
1755Conflicts:
1756Libs: -L\${libdir} -lavutil
1757Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1758EOF
1759
1760cat <<EOF >libavutil-uninstalled.pc
1761prefix=
1762exec_prefix=
1763libdir=\${pcfiledir}/libavutil
1764includedir=\${pcfiledir}/libavutil
1765
1766Name: libavutil
1767Description: FFmpeg utility library
1768Version: $lavu_version
1769Requires:
1770Conflicts:
1771Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1772Cflags: -I\${includedir}
1773EOF
def4272a
AJ
1774
1775# libavcodec.pc
1776cat <<EOF >libavcodec.pc
1777prefix=$prefix
1778exec_prefix=\${prefix}
1779libdir=\${exec_prefix}/lib
1780includedir=\${prefix}/include
1781
1782Name: libavcodec
1783Description: FFmpeg codec library
31abdc45 1784Version: $lavc_version
1785Requires: $requires libavutil = $lavu_version
def4272a
AJ
1786Conflicts:
1787Libs: -L\${libdir} -lavcodec $extralibs
1788Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1789EOF
1790
1791cat <<EOF >libavcodec-uninstalled.pc
1792prefix=
1793exec_prefix=
1794libdir=\${pcfiledir}/libavcodec
1795includedir=\${pcfiledir}/libavcodec
1796
1797Name: libavcodec
1798Description: FFmpeg codec library
31abdc45 1799Version: $lavc_version
1800Requires: $requires libavutil = $lavu_version
def4272a
AJ
1801Conflicts:
1802Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1803Cflags: -I\${includedir}
1804EOF
1805
1806# libavformat.pc
1807cat <<EOF >libavformat.pc
1808prefix=$prefix
1809exec_prefix=\${prefix}
1810libdir=\${exec_prefix}/lib
1811includedir=\${prefix}/include
1812
1813Name: libavformat
1814Description: FFmpeg container format library
31abdc45 1815Version: $lavf_version
1816Requires: $requires libavcodec = $lavc_version
def4272a
AJ
1817Conflicts:
1818Libs: -L\${libdir} -lavformat $extralibs
1819Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1820EOF
1821
1822cat <<EOF >libavformat-uninstalled.pc
1823prefix=
1824exec_prefix=
1825libdir=\${pcfiledir}/libavformat
1826includedir=\${pcfiledir}/libavformat
1827
1828Name: libavformat
1829Description: FFmpeg container format library
31abdc45 1830Version: $lavf_version
1831Requires: $requires libavcodec = $lavc_version
def4272a
AJ
1832Conflicts:
1833Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1834Cflags: -I\${includedir}
1835EOF
1836
1837
1838# libpostproc.pc
1839cat <<EOF >libpostproc.pc
1840prefix=$prefix
1841exec_prefix=\${prefix}
1842libdir=\${exec_prefix}/lib
1843includedir=\${prefix}/include
1844
1845Name: libpostproc
1846Description: FFmpeg post processing library
31abdc45 1847Version: $lavc_version
def4272a
AJ
1848Requires:
1849Conflicts:
1850Libs: -L\${libdir} -lpostproc
1851Cflags: -I\${includedir} -I\${includedir}/postproc
1852EOF
1853
1854cat <<EOF >libpostproc-uninstalled.pc
1855prefix=
1856exec_prefix=
1857libdir=\${pcfiledir}/libavcodec/libpostproc
1858includedir=\${pcfiledir}/libavcodec/libpostproc
1859
1860Name: libpostproc
1861Description: FFmpeg post processing library
31abdc45 1862Version: $lavc_version
def4272a
AJ
1863Requires:
1864Conflicts:
1865Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1866Cflags: -I\${includedir}
1867EOF