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