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