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