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