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