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