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