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