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