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