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