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