fix 24bit flac support, revised from Thibaut Mattern <thibaut.mattern@gmail.com>
[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 faad && require libfaad faad.h faacDecOpen -lfaad
1182enabled xvid && require XviD xvid.h xvid_global -lxvidcore
1183enabled x264 && require x264 x264.h x264_encoder_open -lx264
1184enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
1185enabled sunmlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
e0f80bd7 1186
3b9bee88
MR
1187# Ugh, faac uses stdcall calling convention on win32 so we can't use
1188# the generic test functions
1189if enabled faac; then
1190 save_flags
1191 temp_extralibs -lfaac
1192 check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found"
1193#include <stdint.h>
1194#include <faac.h>
1195int main(){
1196 char *id, *cpr;
1197 faacEncGetVersion(&id, &cpr);
1198 return 0;
1199}
1200EOF
1201 restore_flags
1202fi
1203
95e2ce4a 1204# test for lrintf in math.h
dcd479c0 1205check_exec <<EOF && have_lrintf=yes || have_lrintf=no
95e2ce4a
MN
1206#define _ISOC9X_SOURCE 1
1207#include <math.h>
1208int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1209EOF
1210
c13e1abd
FH
1211_restrict=
1212for restrict_keyword in restrict __restrict__ __restrict; do
57bd82d4 1213 check_cc <<EOF && _restrict=$restrict_keyword && break
dcd479c0
MR
1214void foo(char * $restrict_keyword p);
1215EOF
c13e1abd
FH
1216done
1217
a8721c09
FB
1218# dlopen/dlfcn.h probing
1219
dcd479c0 1220check_header dlfcn.h && dlfcn=yes
a8721c09 1221
dcd479c0
MR
1222temp_extralibs -ldl
1223if check_func dlopen; then
1224 dlopen=yes
1225 ldl=-ldl
a8721c09 1226fi
dcd479c0 1227restore_flags
a8721c09 1228
dcd479c0
MR
1229if check_func dlopen; then
1230 dlopen=yes
1231 ldl=
a8721c09
FB
1232fi
1233
f25fc9b1
MR
1234if test "$vhook" = "default"; then
1235 vhook="$dlopen"
a8721c09
FB
1236fi
1237
bfd2edeb 1238if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
57bd82d4 1239 add_extralibs $ldl
bfd2edeb
MN
1240fi
1241
1242
a86b921c 1243##########################################
29799f8b 1244# imlib check
a86b921c 1245
dcd479c0
MR
1246temp_extralibs -lImlib2
1247check_ld <<EOF && imlib2=yes || imlib2=no
a8721c09
FB
1248#include <X11/Xlib.h>
1249#include <Imlib2.h>
1250int main( void ) { return (int) imlib_load_font("foo"); }
1251EOF
dcd479c0 1252restore_flags
52b41d7f 1253
a86b921c 1254##########################################
29799f8b 1255# FreeType check
a86b921c 1256
04511d53 1257freetype2=no
e2a5fd20 1258if test "x$targetos" != "xBeOS"; then
e2a3cd59 1259 if (freetype-config --version) >/dev/null 2>&1 ; then
dcd479c0
MR
1260 temp_cflags `freetype-config --cflags`
1261 temp_extralibs `freetype-config --libs`
1262 check_ld <<EOF && freetype2=yes
1263#include <ft2build.h>
1264int main( void ) { return (int) FT_Init_FreeType(0); }
1265EOF
1266 restore_flags
dee076fc 1267 fi
04511d53
PG
1268fi
1269
a86b921c 1270##########################################
29799f8b 1271# SDL check
a86b921c 1272
a86b921c
FB
1273sdl_too_old=no
1274sdl=no
6a1a892f
FD
1275SDL_CONFIG="${cross_prefix}sdl-config"
1276if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
dcd479c0
MR
1277 temp_cflags `"${SDL_CONFIG}" --cflags`
1278 temp_extralibs `"${SDL_CONFIG}" --libs`
1279 check_ld <<EOF
1280#include <SDL.h>
1281#undef main /* We don't want SDL to override our main() */
1282int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1283EOF
dcd479c0
MR
1284 if test $? = 0; then
1285 _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
29f3b38a 1286 if test "$_sdlversion" -lt 121 ; then
dcd479c0
MR
1287 sdl_too_old=yes
1288 else
1289 sdl=yes
29f3b38a
MR
1290 check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
1291#include <SDL.h>
1292int main(void){
1293 const SDL_VideoInfo *vi = SDL_GetVideoInfo();
1294 int w = vi->current_w;
1295 return 0;
1296}
1297EOF
dcd479c0
MR
1298 fi
1299 fi
29f3b38a 1300 restore_flags
c3f6b472 1301fi
a86b921c 1302
57bd82d4
MR
1303enabled sdl || ffplay=no
1304
146ea952 1305##########################################
29799f8b 1306# texi2html check
146ea952
NB
1307
1308texi2html=no
e2a3cd59 1309if (texi2html -version) >/dev/null 2>&1; then
146ea952
NB
1310texi2html=yes
1311fi
1312
7a91333f 1313##########################################
29799f8b 1314# IPv6 check
7a91333f 1315
57bd82d4 1316enabled network && check_ld <<EOF && ipv6=yes || ipv6=no
7a91333f
HZ
1317#include <sys/types.h>
1318#include <sys/socket.h>
1319#include <netinet/in.h>
1320#include <netdb.h>
1321int main( void ) {
1322 struct sockaddr_storage saddr;
1323 struct ipv6_mreq mreq6;
1324 getaddrinfo(0,0,0,0);
1325 getnameinfo(0,0,0,0,0,0,0);
12fe88b4 1326 IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
7a91333f
HZ
1327}
1328EOF
1329
47f38850 1330# check for video4linux2 --- V4L2_PIX_FMT_YUV420
57bd82d4 1331enabled v4l2 && check_cc <<EOF || v4l2="no"
84fe9963 1332#include <sys/time.h>
f743a062
LA
1333#include <asm/types.h>
1334#include <linux/videodev2.h>
47f38850 1335int dummy = V4L2_PIX_FMT_YUV420;
490c189b 1336struct v4l2_buffer dummy1;
47f38850 1337EOF
47f38850 1338
57bd82d4
MR
1339enabled debug && add_cflags -g
1340
1341# add some useful compiler flags if supported
1342check_cflags -Wdeclaration-after-statement
dcd479c0
MR
1343check_cflags -Wall
1344check_cflags -Wno-switch
cf9d24ad 1345
57bd82d4
MR
1346# add some linker flags
1347check_ldflags '-Wl,--as-needed' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavformat' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
94a3401e 1348
57bd82d4
MR
1349# not all compilers support -Os
1350test "$optimize" = "small" && check_cflags -Os
cddf3f45 1351
57bd82d4 1352if enabled optimize; then
b2924696 1353 if test -n "`$cc -v 2>&1 | grep xlc`"; then
bb270c08
DB
1354 CFLAGS="$CFLAGS -O5"
1355 LDFLAGS="$LDFLAGS -O5"
cf9d24ad 1356 else
bb270c08 1357 CFLAGS="-O3 $CFLAGS"
cf9d24ad 1358 fi
cddf3f45
GM
1359fi
1360
80581e98
MN
1361# PIC flags for shared library objects where they are needed
1362if test "$lshared" = "yes" ; then
f25fc9b1
MR
1363 # LIBOBJFLAGS may have already been set in the OS configuration
1364 if test -z "$LIBOBJFLAGS" ; then
1365 if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
1366 LIBOBJFLAGS="\$(PIC)"
1367 fi
80581e98 1368 fi
80581e98
MN
1369fi
1370
951bf3e6 1371if test x"$bindir" = x""; then
f25fc9b1 1372 bindir="${prefix}/bin"
951bf3e6
FB
1373fi
1374
cc973ecb 1375if test x"$libdir" = x""; then
f25fc9b1 1376 libdir="${prefix}/lib"
cc973ecb
LB
1377fi
1378
1d67a1d4 1379if test x"$incdir" = x""; then
f25fc9b1 1380 incdir="${prefix}/include/ffmpeg"
1d67a1d4
DB
1381fi
1382
23a65308 1383if test x"$mandir" = x""; then
f25fc9b1 1384 mandir="${prefix}/man"
23a65308
FB
1385fi
1386
29799f8b
DB
1387echo "install prefix $prefix"
1388echo "source path $source_path"
de6d9b64 1389echo "C compiler $cc"
4a908fbc 1390echo "make $make"
a4adb608 1391echo "CPU $cpu ($tune)"
eb94aca9 1392if test "$BUILDSUF" != ""; then
f25fc9b1 1393 echo "build suffix $BUILDSUF"
eb94aca9 1394fi
29799f8b 1395echo "big-endian $bigendian"
7f965c1c 1396echo "inttypes.h $inttypes"
b5c950c4 1397echo "broken inttypes.h $emu_fast_int"
053dea12 1398if test $cpu = "x86" -o $cpu = "x86_64"; then
f25fc9b1
MR
1399 echo "MMX enabled $mmx"
1400 echo "Vector Builtins $builtin_vector"
1401 echo "3DNow! Builtins $mm3dnow"
e41e8342 1402fi
eba9ae3c 1403if test $cpu = "armv4l"; then
f25fc9b1 1404 echo "IWMMXT enabled $iwmmxt"
eba9ae3c 1405fi
e41e8342 1406if test $cpu = "mips"; then
f25fc9b1 1407 echo "MMI enabled $mmi"
e41e8342
FB
1408fi
1409if test $cpu = "powerpc"; then
f25fc9b1 1410 echo "AltiVec enabled $altivec"
e41e8342 1411fi
de6d9b64 1412echo "gprof enabled $gprof"
0147f198 1413echo "zlib enabled $zlib"
e0f80bd7 1414echo "lzo enabled $lzo"
bb4c2140 1415echo "libgsm enabled $libgsm"
a6741398 1416echo "mp3lame enabled $mp3lame"
9146ca37 1417echo "libogg enabled $libogg"
29799f8b
DB
1418echo "Vorbis enabled $vorbis"
1419echo "Theora enabled $theora"
1420echo "FAAD enabled $faad"
445ad18d 1421echo "faadbin enabled $faadbin"
29799f8b
DB
1422echo "FAAC enabled $faac"
1423echo "XviD enabled $xvid"
6662ec29 1424echo "x264 enabled $x264"
5cbcf02c 1425echo "a52 support $a52"
57514323 1426echo "a52 dlopened $a52bin"
29799f8b 1427echo "DTS support $dts"
bba9b16c 1428echo "pp support $pp"
cddf3f45 1429echo "debug symbols $debug"
65d1bea2 1430echo "strip symbols $dostrip"
cddf3f45 1431echo "optimize $optimize"
320d060a 1432echo "static $lstatic"
1ddf5ba1 1433echo "shared $lshared"
29799f8b 1434echo "video hooking $vhook"
a86b921c
FB
1435echo "SDL support $sdl"
1436if test $sdl_too_old = "yes"; then
f25fc9b1 1437 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
a86b921c 1438fi
68892110 1439
f25fc9b1
MR
1440if test "$vhook" = "yes"; then
1441 echo "Imlib2 support $imlib2"
1442 echo "FreeType support $freetype2"
68892110 1443fi
f80f7964 1444echo "Sun medialib support" $sunmlib
9c3d33d6 1445echo "pthreads support" $pthreads
bc634f6f
ZK
1446echo "AMR-NB float support" $amr_nb
1447echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 1448echo "AMR-WB float support" $amr_wb
2a515c08 1449echo "AMR-WB IF2 support" $amr_if2
7a91333f
HZ
1450echo "network support $network"
1451if test "$network" = "yes" ; then
f25fc9b1 1452 echo "IPv6 support $ipv6"
7a91333f 1453fi
b2e3c528 1454if test "$gpl" = "no" ; then
f25fc9b1 1455 echo "License: LGPL"
b2e3c528 1456else
f25fc9b1 1457 echo "License: GPL"
b2e3c528 1458fi
de6d9b64 1459
29799f8b 1460echo "Creating config.mak and config.h..."
de6d9b64 1461
f255e0ab
MB
1462date >> config.log
1463echo " $0 $FFMPEG_CONFIGURATION" >> config.log
29799f8b
DB
1464echo "# Automatically generated by configure - do not modify!" > config.mak
1465echo "/* Automatically generated by configure - do not modify! */" > $TMPH
f255e0ab 1466echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
de6d9b64 1467
9a695e98
DB
1468echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1469echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1d67a1d4 1470echo "incdir=\$(DESTDIR)$incdir" >> config.mak
9a695e98
DB
1471echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1472echo "mandir=\$(DESTDIR)$mandir" >> config.mak
4a908fbc 1473echo "MAKE=$make" >> config.mak
980fc7b8
FB
1474echo "CC=$cc" >> config.mak
1475echo "AR=$ar" >> config.mak
be7109c1 1476echo "RANLIB=$ranlib" >> config.mak
65d1bea2 1477if test "$dostrip" = "yes" ; then
f25fc9b1
MR
1478 echo "STRIP=$strip" >> config.mak
1479 echo "INSTALLSTRIP=$installstrip" >> config.mak
65d1bea2 1480else
f25fc9b1
MR
1481 echo "STRIP=echo ignoring strip" >> config.mak
1482 echo "INSTALLSTRIP=" >> config.mak
65d1bea2 1483fi
75388c74 1484
29799f8b 1485# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
75388c74 1486# shared modules on OS/X (vhook/Makefile).
57bd82d4
MR
1487SHCFLAGS="$CFLAGS"
1488test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
75388c74 1489
a9b3f630 1490echo "OPTFLAGS=$CFLAGS" >> config.mak
75388c74 1491echo "SHCFLAGS=$SHCFLAGS">>config.mak
0f3cb305 1492echo "LDFLAGS=$LDFLAGS" >> config.mak
f39e56a8 1493echo "LDCONFIG=$LDCONFIG" >> config.mak
4baca069 1494echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 1495echo "SHFLAGS=$SHFLAGS" >> config.mak
80581e98 1496echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
b12f8273 1497echo "BUILD_STATIC=$lstatic" >> config.mak
eb94aca9 1498echo "BUILDSUF=$BUILDSUF" >> config.mak
f3ec2d46 1499echo "LIBPREF=$LIBPREF" >> config.mak
eb94aca9 1500echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
320d060a
DB
1501if test "$lstatic" = "yes" ; then
1502 echo "LIB=$LIB" >> config.mak
1a44a8b6
AS
1503else # Some Make complain if this variable does not exist.
1504 echo "LIB=" >> config.mak
320d060a 1505fi
f3ec2d46 1506echo "SLIBPREF=$SLIBPREF" >> config.mak
eb94aca9
CY
1507echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1508echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
6852ac95 1509echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 1510if test "$cpu" = "x86" ; then
980fc7b8 1511 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 1512 echo "#define ARCH_X86 1" >> $TMPH
053dea12
AJ
1513elif test "$cpu" = "x86_64" ; then
1514 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1515 echo "#define ARCH_X86_64 1" >> $TMPH
0f3cb305 1516elif test "$cpu" = "armv4l" ; then
6ed7422a 1517 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 1518 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 1519elif test "$cpu" = "alpha" ; then
91d1f1a4 1520 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 1521 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
1522elif test "$cpu" = "sparc64" ; then
1523 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1524 echo "#define ARCH_SPARC64 1" >> $TMPH
bb476ff3
JM
1525 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1526 echo "#define ARCH_SPARC 1" >> $TMPH
1527elif test "$cpu" = "sparc" ; then
1528 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1529 echo "#define ARCH_SPARC 1" >> $TMPH
0f3cb305
FB
1530elif test "$cpu" = "powerpc" ; then
1531 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1532 echo "#define ARCH_POWERPC 1" >> $TMPH
9007f514
RD
1533 if test $POWERPCMODE = "32bits"; then
1534 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1535 else
1536 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1537 fi
e45a2872
RD
1538 if test "$powerpc_perf" = "yes"; then
1539 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1540 fi
d46aba26
LS
1541elif test "$cpu" = "mips" ; then
1542 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1543 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
1544elif test "$cpu" = "sh4" ; then
1545 echo "TARGET_ARCH_SH4=yes" >> config.mak
1546 echo "#define ARCH_SH4 1" >> $TMPH
67860b26
SH
1547elif test "$cpu" = "parisc" ; then
1548 echo "TARGET_ARCH_PARISC=yes" >> config.mak
1549 echo "#define ARCH_PARISC 1" >> $TMPH
1550elif test "$cpu" = "s390" ; then
1551 echo "TARGET_ARCH_S390=yes" >> config.mak
1552 echo "#define ARCH_S390 1" >> $TMPH
1553elif test "$cpu" = "m68k" ; then
1554 echo "TARGET_ARCH_M68K=yes" >> config.mak
1555 echo "#define ARCH_M68K 1" >> $TMPH
1556elif test "$cpu" = "ia64" ; then
1557 echo "TARGET_ARCH_IA64=yes" >> config.mak
1558 echo "#define ARCH_IA64 1" >> $TMPH
bdb2e37c 1559fi
a4adb608 1560echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
1561if test "$bigendian" = "yes" ; then
1562 echo "WORDS_BIGENDIAN=yes" >> config.mak
1563 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 1564fi
d2a9bddd
MN
1565if test "$inttypes" != "yes" ; then
1566 echo "#define EMULATE_INTTYPES 1" >> $TMPH
7f965c1c 1567fi
b5c950c4 1568if test "$emu_fast_int" = "yes" ; then
19d053c5 1569 echo "#define EMULATE_FAST_INT 1" >> $TMPH
b5c950c4 1570fi
57514323 1571if test "$mmx" = "yes" ; then
980fc7b8 1572 echo "TARGET_MMX=yes" >> config.mak
045ed63f 1573 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 1574 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 1575fi
52b41d7f
FB
1576if test "$builtin_vector" = "yes" ; then
1577 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1578 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1579fi
82eb4b0f
ZM
1580if test "$mm3dnow" = "yes" ; then
1581 echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
1582 echo "#define HAVE_MM3DNOW 1" >> $TMPH
1583fi
eba9ae3c
GB
1584if test "$iwmmxt" = "yes" ; then
1585 echo "TARGET_IWMMXT=yes" >> config.mak
1586 echo "#define HAVE_IWMMXT 1" >> $TMPH
1587fi
d46aba26
LS
1588if test "$mmi" = "yes" ; then
1589 echo "TARGET_MMI=yes" >> config.mak
1590 echo "#define HAVE_MMI 1" >> $TMPH
1591fi
ab6c65f6
BF
1592if test "$altivec" = "yes" ; then
1593 echo "TARGET_ALTIVEC=yes" >> config.mak
1594 echo "#define HAVE_ALTIVEC 1" >> $TMPH
db40a39a
MN
1595 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1596 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
a9a07762
MN
1597 if test "$_altivec_h" = "yes" ; then
1598 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1599 else
e67e14d5 1600 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
a9a07762 1601 fi
ab6c65f6 1602fi
57514323 1603if test "$gprof" = "yes" ; then
980fc7b8 1604 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 1605 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 1606fi
5e4639e2
GM
1607if test "$localtime_r" = "yes" ; then
1608 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 1609fi
68892110
PG
1610if test "$imlib2" = "yes" ; then
1611 echo "HAVE_IMLIB2=yes" >> config.mak
1612fi
04511d53
PG
1613if test "$freetype2" = "yes" ; then
1614 echo "HAVE_FREETYPE2=yes" >> config.mak
1615fi
f80f7964
RS
1616if test "$sunmlib" = "yes" ; then
1617 echo "HAVE_MLIB=yes" >> config.mak
1618 echo "#define HAVE_MLIB 1" >> $TMPH
f80f7964 1619fi
9c3d33d6
MN
1620if test "$pthreads" = "yes" ; then
1621 echo "HAVE_PTHREADS=yes" >> config.mak
1622 echo "#define HAVE_PTHREADS 1" >> $TMPH
2450cff2 1623 echo "#define HAVE_THREADS 1" >> $TMPH
9c3d33d6 1624fi
a86b921c
FB
1625if test "$sdl" = "yes" ; then
1626 echo "CONFIG_SDL=yes" >> config.mak
6a1a892f
FD
1627 echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
1628 echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
29f3b38a
MR
1629 if test "$sdl_video_size" = "yes"; then
1630 echo "#define HAVE_SDL_VIDEO_SIZE 1" >> $TMPH
1631 fi
a86b921c 1632fi
146ea952
NB
1633if test "$texi2html" = "yes"; then
1634 echo "BUILD_DOC=yes" >> config.mak
1635fi
95e2ce4a
MN
1636if test "$have_lrintf" = "yes" ; then
1637 echo "#define HAVE_LRINTF 1" >> $TMPH
1638fi
68892110
PG
1639if test "$vhook" = "yes" ; then
1640 echo "BUILD_VHOOK=yes" >> config.mak
1641 echo "#define HAVE_VHOOK 1" >> $TMPH
68892110 1642fi
5a872801 1643
6d9a2421 1644pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
5a872801
LB
1645lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1646lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1647lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1648
1649
1650
57514323 1651if test "$lshared" = "yes" ; then
320d060a 1652 echo "#define BUILD_SHARED_AV 1" >> $TMPH
0319c531 1653 echo "BUILD_SHARED=yes" >> config.mak
97006039 1654 echo "PIC=-fPIC -DPIC" >> config.mak
39503a27 1655 echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
5a872801 1656 echo "SPPVERSION=$lavc_version" >> config.mak
39503a27 1657 echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
5a872801 1658 echo "LAVCVERSION=$lavc_version" >> config.mak
39503a27 1659 echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
5a872801 1660 echo "LAVFVERSION=$lavf_version" >> config.mak
39503a27 1661 echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
5a872801 1662 echo "LAVUVERSION=$lavu_version" >> config.mak
4bdd05e7 1663 echo "SLIBNAME=${SLIBNAME}" >> config.mak
f3b60109
DB
1664 echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1665 echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
0319c531 1666fi
ef0bc4c9 1667echo "EXTRALIBS=$extralibs" >> config.mak
d2845d68 1668
29799f8b 1669# If you do not want to use encoders, disable them.
045ed63f 1670echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
1671echo "CONFIG_ENCODERS=yes" >> config.mak
1672
29799f8b 1673# If you do not want to use decoders, disable them.
045ed63f 1674echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
1675echo "CONFIG_DECODERS=yes" >> config.mak
1676
a9e35095
DB
1677# muxers
1678if test "$muxers" = "yes" ; then
1679 echo "#define CONFIG_MUXERS 1" >> $TMPH
1680 echo "CONFIG_MUXERS=yes" >> config.mak
1681fi
1682
1683# demuxers
1684if test "$demuxers" = "yes" ; then
1685 echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1686 echo "CONFIG_DEMUXERS=yes" >> config.mak
1687fi
1688
5cbcf02c
FB
1689# AC3
1690if test "$a52" = "yes" ; then
1691 echo "#define CONFIG_AC3 1" >> $TMPH
1692 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 1693
5cbcf02c
FB
1694 if test "$a52bin" = "yes" ; then
1695 echo "#define CONFIG_A52BIN 1" >> $TMPH
1696 echo "CONFIG_A52BIN=yes" >> config.mak
1697 fi
1698fi
1699
23c99253
MN
1700# DTS
1701if test "$dts" = "yes" ; then
1702 echo "#define CONFIG_DTS 1" >> $TMPH
1703 echo "CONFIG_DTS=yes" >> config.mak
1704fi
1705
bba9b16c
MN
1706# PP
1707if test "$pp" = "yes" ; then
1708 echo "#define CONFIG_PP 1" >> $TMPH
1709 echo "CONFIG_PP=yes" >> config.mak
bba9b16c
MN
1710fi
1711
29799f8b 1712# MPEG audio high precision mode
1eb2212e
FB
1713if test "$mpegaudio_hp" = "yes" ; then
1714 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1715fi
1716
5cbcf02c
FB
1717if test "$v4l" = "yes" ; then
1718 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1719 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1720fi
1721
0a7b514f
LA
1722if test "$v4l2" = "yes" ; then
1723 echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
1724 echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
1725fi
1726
6beefa40
MN
1727if test "$bktr" = "yes" ; then
1728 echo "#define CONFIG_BKTR 1" >> $TMPH
1729 echo "CONFIG_BKTR=yes" >> config.mak
1730fi
1731
8aa3ee32
MK
1732if test "$dv1394" = "yes" ; then
1733 echo "#define CONFIG_DV1394 1" >> $TMPH
1734 echo "CONFIG_DV1394=yes" >> config.mak
1735fi
1736
f02be79d
RS
1737if test "$dc1394" = "yes" ; then
1738 echo "#define CONFIG_DC1394 1" >> $TMPH
1739 echo "CONFIG_DC1394=yes" >> config.mak
1740fi
1741
adbc0510
PG
1742if test "$dlopen" = "yes" ; then
1743 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1744fi
1745
1746if test "$dlfcn" = "yes" ; then
1747 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1748fi
1749
5cbcf02c
FB
1750if test "$audio_oss" = "yes" ; then
1751 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1752 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1753fi
1754
dfdfa47c
FR
1755if test "$audio_beos" = "yes" ; then
1756 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1757 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1758fi
1759
5cbcf02c
FB
1760if test "$network" = "yes" ; then
1761 echo "#define CONFIG_NETWORK 1" >> $TMPH
1762 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1763fi
daf8e955 1764
7a91333f
HZ
1765if test "$ipv6" = "yes" ; then
1766 echo "#define CONFIG_IPV6 1" >> $TMPH
1767fi
1768
0147f198
FR
1769if test "$zlib" = "yes" ; then
1770 echo "#define CONFIG_ZLIB 1" >> $TMPH
1771 echo "CONFIG_ZLIB=yes" >> config.mak
1772fi
1773
e0f80bd7
RD
1774if test "$lzo" = "yes" ; then
1775 echo "#define CONFIG_LZO 1" >> $TMPH
1776 echo "CONFIG_LZO=yes" >> config.mak
1777fi
1778
bb4c2140
MN
1779if test "$libgsm" = "yes" ; then
1780 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1781 echo "CONFIG_LIBGSM=yes" >> config.mak
1782fi
1783
57514323 1784if test "$mp3lame" = "yes" ; then
045ed63f 1785 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1786 echo "CONFIG_MP3LAME=yes" >> config.mak
1787fi
1788
9146ca37 1789if test "$libogg" = "yes" ; then
5c5dea3f
NB
1790 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1791 echo "CONFIG_LIBOGG=yes" >> config.mak
1792fi
1793
81e0d0b4 1794if test "$vorbis" = "yes" ; then
5c5dea3f
NB
1795 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1796 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1797fi
1798
1799if test "$theora" = "yes" ; then
1800 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1801 echo "CONFIG_LIBTHEORA=yes" >> config.mak
81e0d0b4
MH
1802fi
1803
0fc50e58
ZK
1804if test "$faad" = "yes" ; then
1805 echo "#define CONFIG_FAAD 1" >> $TMPH
1806 echo "CONFIG_FAAD=yes" >> config.mak
1807fi
1808
1809if test "$faadbin" = "yes" ; then
1810 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1811 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1812fi
1813
29d48296
MN
1814if test "$faac" = "yes" ; then
1815 echo "#define CONFIG_FAAC 1" >> $TMPH
1816 echo "CONFIG_FAAC=yes" >> config.mak
1817fi
1818
1ddadfa9
AT
1819if test "$xvid" = "yes" ; then
1820 echo "#define CONFIG_XVID 1" >> $TMPH
1821 echo "CONFIG_XVID=yes" >> config.mak
1822fi
1823
6662ec29
MN
1824if test "$x264" = "yes" ; then
1825 echo "#define CONFIG_X264 1" >> $TMPH
1826 echo "CONFIG_X264=yes" >> config.mak
1827fi
1828
732d9245
BE
1829if test "$mingw32" = "yes" ; then
1830 echo "#define CONFIG_WIN32 1" >> $TMPH
1831 echo "CONFIG_WIN32=yes" >> config.mak
16806499
MN
1832 echo "HAVE_W32THREADS=yes" >> config.mak
1833 echo "#define HAVE_W32THREADS 1" >> $TMPH
2450cff2 1834 echo "#define HAVE_THREADS 1" >> $TMPH
7eea5766 1835 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1836 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1837 echo "#endif" >> $TMPH
3f027ca7
FB
1838fi
1839
ac44871c
GB
1840if test "$mingwce" = "yes" ; then
1841 echo "#define CONFIG_WIN32 1" >> $TMPH
1842 echo "CONFIG_WIN32=yes" >> config.mak
1843 echo "#define CONFIG_WINCE 1" >> $TMPH
1844 echo "CONFIG_WINCE=yes" >> config.mak
1845 echo "#ifndef __MINGW32__" >> $TMPH
1846 echo "#define __MINGW32__ 1" >> $TMPH
1847 echo "#endif" >> $TMPH
1848fi
1849
f3ec2d46
SG
1850if test "$os2" = "yes" ; then
1851 echo "#define CONFIG_OS2 1" >> $TMPH
1852 echo "CONFIG_OS2=yes" >> config.mak
e2a5fd20
MN
1853 echo "HAVE_OS2THREADS=yes" >> config.mak
1854 echo "#define HAVE_OS2THREADS 1" >> $TMPH
1855 echo "#define HAVE_THREADS 1" >> $TMPH
f3ec2d46
SG
1856fi
1857
6e023978
RS
1858if test "$TARGET_OS" = "SunOS" ; then
1859 echo "#define CONFIG_SUNOS 1" >> $TMPH
1860fi
1861
2450cff2
FR
1862if test "$TARGET_OS" = "BeOS" ; then
1863 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1864 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1865 echo "#define HAVE_THREADS 1" >> $TMPH
1866fi
1867
90cee0c3
MN
1868if test "$darwin" = "yes"; then
1869 echo "#define CONFIG_DARWIN 1" >> $TMPH
1870 echo "CONFIG_DARWIN=yes" >> config.mak
1871fi
1872
57514323 1873if test "$_malloc_h" = "yes" ; then
045ed63f 1874 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1875else
045ed63f 1876 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1877fi
1878
57514323 1879if test "$_memalign" = "yes" ; then
045ed63f
ZK
1880 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1881else
1882 echo "#undef HAVE_MEMALIGN" >> $TMPH
1883fi
1884
da9b170c
MN
1885if test "$memalignhack" = "yes" ; then
1886 echo "#define MEMALIGN_HACK 1" >> $TMPH
1887fi
1888
1889
26b35efb
FR
1890if test "$netserver" = "yes" ; then
1891 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1892 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1893fi
1894
4baca069
PG
1895if test "$need_inet_aton" = "yes" ; then
1896 echo "NEED_INET_ATON=yes" >> config.mak
1897fi
1898
57514323 1899if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1900 echo "#define SIMPLE_IDCT 1" >> $TMPH
1901fi
1902
04f46ced
GB
1903if test "$protocols" = "yes" ; then
1904 echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
1905 echo "CONFIG_PROTOCOLS=yes" >> config.mak
1906fi
1907
8154d2e0
FB
1908if test "$ffserver" = "yes" ; then
1909 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1910 echo "CONFIG_FFSERVER=yes" >> config.mak
1911fi
1912
a86b921c
FB
1913if test "$ffplay" = "yes" ; then
1914 echo "CONFIG_FFPLAY=yes" >> config.mak
1915fi
1916
b2e3c528
MN
1917if test "$gpl" = "yes" ; then
1918 echo "#define CONFIG_GPL 1" >> $TMPH
1919 echo "CONFIG_GPL=yes" >> config.mak
1920fi
1921
c13e1abd
FH
1922echo "#define restrict $_restrict" >> $TMPH
1923
bb801c97
MN
1924if test "$optimize" = "small"; then
1925 echo "#define always_inline" >> $TMPH
1926fi
1927
0f3cb305
FB
1928# build tree in object directory if source path is different from current one
1929if test "$source_path_used" = "yes" ; then
2a4e872b
AS
1930 DIRS="\
1931 doc \
1932 libavformat \
1933 libavcodec \
1934 libavcodec/alpha \
1935 libavcodec/armv4l \
1936 libavcodec/i386 \
1937 libavcodec/sparc \
1938 libavcodec/mlib \
1939 libavcodec/ppc \
1940 libavcodec/liba52 \
6d9a2421 1941 libpostproc \
2a4e872b
AS
1942 libavutil \
1943 tests \
1944 vhook \
1945 "
1946 FILES="\
1947 Makefile \
1948 libavformat/Makefile \
1949 libavcodec/Makefile \
6d9a2421 1950 libpostproc/Makefile \
2a4e872b
AS
1951 libavutil/Makefile \
1952 tests/Makefile \
1953 vhook/Makefile \
1954 doc/Makefile \
1955 doc/texi2pod.pl \
1956 "
0f3cb305
FB
1957 for dir in $DIRS ; do
1958 mkdir -p $dir
1959 done
1960 for f in $FILES ; do
281a74da 1961 ln -sf "$source_path/$f" $f
0f3cb305
FB
1962 done
1963fi
8e955b13 1964echo "SRC_PATH=$source_path" >> config.mak
8b2121e3 1965echo "BUILD_ROOT=$PWD" >> config.mak
0f3cb305 1966
60827a1a
DB
1967if test "$amr" = "yes" ; then
1968 echo "#define AMR 1" >> $TMPH
1969 echo "AMR=yes" >> config.mak
1970fi
1971
d663a1fd
MN
1972if test "$amr_wb" = "yes" ; then
1973 echo "#define AMR_WB 1" >> $TMPH
1974 echo "AMR_WB=yes" >> config.mak
1975 echo
1976 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1977 echo "V5.1.0 from "
1978 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1979 echo "and extracted the source to libavcodec/amrwb_float"
d663a1fd
MN
1980fi
1981
891f64b3 1982if test "$amr_nb" = "yes" ; then
1983 echo "#define AMR_NB 1" >> $TMPH
1984 echo "AMR_NB=yes" >> config.mak
1985 echo
6eb07e73
DB
1986 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1987 echo "REL-5 V5.1.0 from "
c51c4fa0 1988 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
6eb07e73
DB
1989 echo "and extracted the source to libavcodec/amr_float"
1990 echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
1991fi
1992
bc634f6f 1993if test "$amr_nb_fixed" = "yes" ; then
bc634f6f 1994 echo "#define AMR_NB_FIXED 1" >> $TMPH
28fff4c8 1995 echo "AMR_NB_FIXED=yes" >> config.mak
b9ca6d47 1996 echo
bc634f6f
ZK
1997 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1998 echo "REL-5 version 5.1.0 from "
c51c4fa0 1999 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
891f64b3 2000 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
2001 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
2002 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
891f64b3 2003fi
2004
2a515c08
TM
2005if test "$amr_if2" = "yes" ; then
2006 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
2007fi
2008
bc634f6f 2009
009cf97d 2010for codec in $CODEC_LIST ; do
ce869f59
MN
2011 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
2012 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
009cf97d
MN
2013done
2014
9cb2cf10
DB
2015# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
2016diff $TMPH config.h >/dev/null 2>&1
214c5f26 2017if test "$?" != "0" ; then
9cb2cf10
DB
2018 mv -f $TMPH config.h
2019else
2020 echo "config.h is unchanged"
2021fi
3d204385 2022
f3ec2d46 2023rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
def4272a
AJ
2024
2025
29799f8b 2026# build pkg-config files libav*.pc and libpostproc.pc
31abdc45 2027# libavutil.pc
2028cat <<EOF >libavutil.pc
2029prefix=$prefix
2030exec_prefix=\${prefix}
2031libdir=\${exec_prefix}/lib
2032includedir=\${prefix}/include
2033
2034Name: libavutil
2035Description: FFmpeg utility library
2036Version: $lavu_version
115329f1 2037Requires:
31abdc45 2038Conflicts:
2039Libs: -L\${libdir} -lavutil
2040Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2041EOF
2042
2043cat <<EOF >libavutil-uninstalled.pc
2044prefix=
2045exec_prefix=
2046libdir=\${pcfiledir}/libavutil
2047includedir=\${pcfiledir}/libavutil
2048
2049Name: libavutil
2050Description: FFmpeg utility library
2051Version: $lavu_version
115329f1 2052Requires:
31abdc45 2053Conflicts:
2054Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
2055Cflags: -I\${includedir}
2056EOF
def4272a
AJ
2057
2058# libavcodec.pc
2059cat <<EOF >libavcodec.pc
2060prefix=$prefix
2061exec_prefix=\${prefix}
2062libdir=\${exec_prefix}/lib
2063includedir=\${prefix}/include
2064
2065Name: libavcodec
2066Description: FFmpeg codec library
31abdc45 2067Version: $lavc_version
c99dd233 2068Requires: $pkg_requires libavutil = $lavu_version
def4272a
AJ
2069Conflicts:
2070Libs: -L\${libdir} -lavcodec $extralibs
2071Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2072EOF
2073
2074cat <<EOF >libavcodec-uninstalled.pc
2075prefix=
2076exec_prefix=
2077libdir=\${pcfiledir}/libavcodec
2078includedir=\${pcfiledir}/libavcodec
2079
2080Name: libavcodec
2081Description: FFmpeg codec library
31abdc45 2082Version: $lavc_version
c99dd233 2083Requires: $pkg_requires libavutil = $lavu_version
def4272a
AJ
2084Conflicts:
2085Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
2086Cflags: -I\${includedir}
2087EOF
2088
2089# libavformat.pc
2090cat <<EOF >libavformat.pc
2091prefix=$prefix
2092exec_prefix=\${prefix}
2093libdir=\${exec_prefix}/lib
2094includedir=\${prefix}/include
2095
2096Name: libavformat
2097Description: FFmpeg container format library
31abdc45 2098Version: $lavf_version
c99dd233 2099Requires: $pkg_requires libavcodec = $lavc_version
def4272a
AJ
2100Conflicts:
2101Libs: -L\${libdir} -lavformat $extralibs
2102Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2103EOF
2104
2105cat <<EOF >libavformat-uninstalled.pc
2106prefix=
2107exec_prefix=
2108libdir=\${pcfiledir}/libavformat
2109includedir=\${pcfiledir}/libavformat
2110
2111Name: libavformat
2112Description: FFmpeg container format library
31abdc45 2113Version: $lavf_version
c99dd233 2114Requires: $pkg_requires libavcodec = $lavc_version
def4272a
AJ
2115Conflicts:
2116Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
2117Cflags: -I\${includedir}
2118EOF
2119
2120
2121# libpostproc.pc
2122cat <<EOF >libpostproc.pc
2123prefix=$prefix
2124exec_prefix=\${prefix}
2125libdir=\${exec_prefix}/lib
2126includedir=\${prefix}/include
2127
2128Name: libpostproc
2129Description: FFmpeg post processing library
31abdc45 2130Version: $lavc_version
115329f1 2131Requires:
def4272a
AJ
2132Conflicts:
2133Libs: -L\${libdir} -lpostproc
2134Cflags: -I\${includedir} -I\${includedir}/postproc
2135EOF
2136
2137cat <<EOF >libpostproc-uninstalled.pc
2138prefix=
2139exec_prefix=
6d9a2421
DB
2140libdir=\${pcfiledir}/libpostproc
2141includedir=\${pcfiledir}/libpostproc
def4272a
AJ
2142
2143Name: libpostproc
2144Description: FFmpeg post processing library
31abdc45 2145Version: $lavc_version
115329f1 2146Requires:
def4272a
AJ
2147Conflicts:
2148Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
2149Cflags: -I\${includedir}
2150EOF