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