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