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