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