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