I suppose I can add myself, at least for my vorbis encoder...
[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
424 x264
425 xvid
426 zlib
427'
428
429HAVE_LIST='
430 altivec_h
b265431e 431 beosthreads
c88f5d72
MR
432 byteswap_h
433 dcbzl
18b67ae5 434 dlfcn_h
c88f5d72
MR
435 dlopen
436 freetype2
437 gprof
438 imlib2
2e1913b1 439 inet_aton
c88f5d72
MR
440 localtime_r
441 lrintf
442 malloc_h
443 memalign
444 mlib
b265431e
MR
445 os2threads
446 pthreads
c88f5d72
MR
447 sdl
448 sdl_video_size
b265431e
MR
449 threads
450 w32threads
c88f5d72 451'
44161118 452
0f3cb305 453# set temporary file name
57514323 454if test ! -z "$TMPDIR" ; then
0f3cb305 455 TMPDIR1="${TMPDIR}"
57514323 456elif test ! -z "$TEMPDIR" ; then
0f3cb305 457 TMPDIR1="${TEMPDIR}"
3d204385 458else
0f3cb305 459 TMPDIR1="/tmp"
3d204385
NK
460fi
461
0f3cb305
FB
462TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
463TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
f3ec2d46 464TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
0f3cb305
FB
465TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
466TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
467
de6d9b64 468# default parameters
720c69da 469logging="yes"
2ba042a7 470logfile="config.err"
2266e085
DB
471PREFIX="/usr/local"
472libdir='${PREFIX}/lib'
84c22efd 473shlibdir="$libdir"
2266e085
DB
474incdir='${PREFIX}/include/ffmpeg'
475mandir='${PREFIX}/man'
476bindir='${PREFIX}/bin'
0f3cb305 477cross_prefix=""
fac252f9 478cross_compile="no"
de6d9b64
FB
479cc="gcc"
480ar="ar"
be7109c1 481ranlib="ranlib"
4a908fbc 482make="make"
0f3cb305 483strip="strip"
cc6a90dd 484arch=`uname -m`
38d0a8aa 485cpu="generic"
e45a2872 486powerpc_perf="no"
0f3cb305 487mmx="default"
e7768fc5 488cmov="no"
94e4c3a3 489cmov_is_fast="no"
1839e854 490armv5te="default"
eba9ae3c 491iwmmxt="default"
ab6c65f6 492altivec="default"
87ea51e0 493dcbzl="no"
d46aba26 494mmi="default"
cc6a90dd 495case "$arch" in
ef0bc4c9 496 i386|i486|i586|i686|i86pc|BePC)
419b8784 497 arch="x86_32"
de6d9b64 498 ;;
7bf9648e 499 x86_64|amd64)
a63e5f1c 500 arch="x86_32"
32255f6c 501 canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
7bf9648e
JM
502 if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
503 if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
cc6a90dd 504 arch="x86_64"
7bf9648e 505 fi
053dea12
AJ
506 fi
507 ;;
6dc7b6b3
DB
508 # armv4l is a subset of armv[567]*l
509 arm|armv[4567]*l)
cc6a90dd 510 arch="armv4l"
6ed7422a 511 ;;
91d1f1a4 512 alpha)
cc6a90dd 513 arch="alpha"
91d1f1a4 514 ;;
2645e80f 515 "Power Macintosh"|ppc|ppc64|powerpc)
cc6a90dd 516 arch="powerpc"
90cee0c3 517 ;;
b028a866 518 mips|mipsel|IP*)
cc6a90dd 519 arch="mips"
d46aba26 520 ;;
bb476ff3 521 sun4u|sparc64)
cc6a90dd 522 arch="sparc64"
a7beab73 523 ;;
bb476ff3 524 sparc)
cc6a90dd 525 arch="sparc"
bb476ff3 526 ;;
bdb2e37c 527 sh4)
cc6a90dd 528 arch="sh4"
bdb2e37c 529 ;;
67860b26 530 parisc|parisc64)
cc6a90dd 531 arch="parisc"
67860b26
SH
532 ;;
533 s390|s390x)
cc6a90dd 534 arch="s390"
67860b26
SH
535 ;;
536 m68k)
cc6a90dd 537 arch="m68k"
67860b26
SH
538 ;;
539 ia64)
cc6a90dd 540 arch="ia64"
67860b26 541 ;;
81a9b052 542 bfin)
cc6a90dd 543 arch="bfin"
81a9b052 544 ;;
de6d9b64 545 *)
cc6a90dd 546 arch="unknown"
de6d9b64
FB
547 ;;
548esac
549gprof="no"
9d2a0f1c
MR
550video4linux="yes"
551video4linux2="yes"
6beefa40 552bktr="no"
5cbcf02c 553audio_oss="yes"
dfdfa47c 554audio_beos="no"
8aa3ee32 555dv1394="yes"
f02be79d 556dc1394="no"
5cbcf02c 557network="yes"
0c7bb0e5 558ipv6="yes"
0147f198 559zlib="yes"
bb4c2140 560libgsm="no"
a6741398 561mp3lame="no"
f956e129 562libnut="no"
9146ca37 563libogg="no"
be74741c 564libvorbis="no"
0fc50e58
ZK
565faad="no"
566faadbin="no"
29d48296 567faac="no"
1ddadfa9 568xvid="no"
6662ec29 569x264="no"
ba9261e5 570a52="no"
57514323 571a52bin="no"
23c99253 572dts="no"
ba9261e5 573pp="no"
732d9245 574mingw32="no"
ac44871c 575mingwce="no"
f3ec2d46 576os2="no"
320d060a 577lstatic="yes"
83286d2a 578lshared="no"
cddf3f45
GM
579optimize="yes"
580debug="yes"
78fcba8f 581extrawarnings="no"
65d1bea2 582dostrip="yes"
da186ae2 583installstrip="-s"
ef0bc4c9 584extralibs="-lm"
0f3cb305 585bigendian="no"
a8721c09 586vhook="default"
8ac17293 587avisynth="no"
18b67ae5 588dlfcn_h="no"
adbc0510 589dlopen="no"
1eb2212e 590mpegaudio_hp="yes"
baa3a937 591SHFLAGS='-shared -Wl,-soname,$@'
cab3ef82 592VHOOKSHFLAGS='$(SHFLAGS)'
8e72b130 593beos_netserver="no"
04f46ced 594protocols="yes"
786b30af 595ffmpeg="yes"
8154d2e0 596ffserver="yes"
a86b921c 597ffplay="yes"
80581e98 598LIBOBJFLAGS=""
e89b8b0a 599FFLDFLAGS=-Wl,--warn-common
e240ee67 600LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
c536cb09 601FFSERVERLDFLAGS=-Wl,-E
f39e56a8 602LDCONFIG="ldconfig"
f3ec2d46
SG
603LIBPREF="lib"
604LIBSUF=".a"
4bdd05e7 605LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
f3ec2d46
SG
606SLIBPREF="lib"
607SLIBSUF=".so"
4bdd05e7 608SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
b29bddab
DB
609SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
610SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
951bf3e6 611EXESUF=""
eb94aca9 612BUILDSUF=""
891f64b3 613amr_nb="no"
d663a1fd 614amr_wb="no"
bc634f6f 615amr_nb_fixed="no"
2a515c08 616amr_if2="no"
bde24d6e 617mlib="no"
9c3d33d6 618pthreads="no"
790c9ca7 619swscaler="no"
b2e3c528 620gpl="no"
9ddbcae6 621memalign_hack="no"
4454dc1b 622asmalign_pot="unknown"
d4596ae3 623LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
ef0bc4c9
FR
624
625# OS specific
626targetos=`uname -s`
627case $targetos in
628BeOS)
2266e085 629PREFIX="/boot/home/config"
ef0bc4c9 630# helps building libavcodec
30a3e5d4 631add_cflags "-DPIC -fomit-frame-pointer"
31ba0b4d 632# 3 gcc releases known for BeOS, each with ugly bugs
b2924696 633gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
31ba0b4d
FR
634case "$gcc_version" in
6352.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
636mmx="no"
637;;
638*20010315*) echo "BeBits gcc"
30a3e5d4 639add_cflags "-fno-expensive-optimizations"
31ba0b4d
FR
640;;
641esac
e1707f52 642SHFLAGS=-nostart
29799f8b 643# disable Linux things
e1707f52 644audio_oss="no"
9d2a0f1c
MR
645video4linux="no"
646video4linux2="no"
8aa3ee32 647dv1394="no"
29799f8b 648# enable BeOS things
dfdfa47c 649audio_beos="yes"
b265431e 650beosthreads="yes"
ef0bc4c9
FR
651# no need for libm, but the inet stuff
652# Check for BONE
653if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
654extralibs="-lbind -lsocket"
655else
8e72b130 656beos_netserver="yes"
26b35efb 657extralibs="-lnet"
ef0bc4c9 658fi ;;
4baca069 659SunOS)
9d2a0f1c
MR
660video4linux="no"
661video4linux2="no"
4baca069 662audio_oss="no"
8aa3ee32 663dv1394="no"
4baca069 664make="gmake"
e89b8b0a 665FFLDFLAGS=""
c536cb09 666FFSERVERLDFLAGS=""
813457e5 667SHFLAGS="-shared -Wl,-h,\$@"
30a3e5d4 668add_extralibs "-lsocket -lnsl"
4baca069 669;;
b7aa4a59 670NetBSD)
9d2a0f1c
MR
671video4linux="no"
672video4linux2="no"
6beefa40 673bktr="yes"
b7aa4a59
SS
674audio_oss="yes"
675dv1394="no"
676make="gmake"
30a3e5d4 677add_extralibs "-lossaudio"
b7aa4a59 678;;
8c802695 679OpenBSD)
9d2a0f1c
MR
680video4linux="no"
681video4linux2="no"
6beefa40 682bktr="yes"
8c802695
JM
683audio_oss="yes"
684dv1394="no"
685make="gmake"
80581e98 686LIBOBJFLAGS="\$(PIC)"
a1309f8f 687LDCONFIG="ldconfig -m \$(shlibdir)"
30a3e5d4 688add_extralibs "-lossaudio"
8c802695 689;;
9c938e77 690FreeBSD)
9d2a0f1c
MR
691video4linux="no"
692video4linux2="no"
6beefa40 693bktr="yes"
9c938e77 694audio_oss="yes"
8aa3ee32 695dv1394="no"
9c938e77 696make="gmake"
30a3e5d4 697add_cflags "-pthread"
9c938e77 698;;
38f0d3ce 699GNU/kFreeBSD)
9d2a0f1c
MR
700video4linux="no"
701video4linux2="no"
38f0d3ce
DB
702bktr="yes"
703audio_oss="yes"
704dv1394="no"
30a3e5d4 705add_cflags "-pthread"
38f0d3ce 706;;
4a908fbc 707BSD/OS)
9d2a0f1c
MR
708video4linux="no"
709video4linux2="no"
6beefa40 710bktr="yes"
6063bce7 711audio_oss="yes"
8aa3ee32 712dv1394="no"
4a908fbc
AB
713extralibs="-lpoll -lgnugetopt -lm"
714make="gmake"
1db68540
SS
715strip="strip -d"
716installstrip=""
4a908fbc 717;;
90cee0c3 718Darwin)
a43bd1d7 719cc="cc"
9d2a0f1c
MR
720video4linux="no"
721video4linux2="no"
90cee0c3 722audio_oss="no"
8aa3ee32 723dv1394="no"
a1309f8f 724SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
408382a4 725VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
90cee0c3 726extralibs=""
47930f09 727strip="strip -x"
da186ae2 728installstrip=""
e89b8b0a 729FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
4e159595 730SLIBSUF=".dylib"
f3b60109
DB
731SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
732SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
c536cb09 733FFSERVERLDFLAGS=-Wl,-bind_at_load
d4596ae3 734LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
90cee0c3 735;;
732d9245 736MINGW32*)
951bf3e6 737# Note: the rest of the mingw32 config is done afterwards as mingw32
29799f8b 738# can be forced on the command line for Linux cross compilation.
732d9245
BE
739mingw32="yes"
740;;
3f027ca7 741CYGWIN*)
b2828252 742targetos=CYGWIN
4581fdff 743shlibdir='${PREFIX}/bin'
9d2a0f1c
MR
744video4linux="no"
745video4linux2="no"
3f027ca7 746audio_oss="yes"
8aa3ee32 747dv1394="no"
07a1b05e 748VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
fbb9d104 749VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
3f027ca7 750extralibs=""
487c2fad 751EXESUF=".exe"
4581fdff
VP
752SLIBPREF="cyg"
753SLIBSUF=".dll"
754SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
755SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
756SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a'
3f027ca7 757;;
b55e4ef4 758Linux)
e240ee67 759LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
b55e4ef4 760;;
99614dd4 761IRIX*)
b2828252 762targetos=IRIX
99614dd4 763ranlib="echo ignoring ranlib"
9d2a0f1c
MR
764video4linux="no"
765video4linux2="no"
99614dd4
MB
766audio_oss="no"
767make="gmake"
768;;
f3ec2d46
SG
769OS/2)
770TMPE=$TMPE".exe"
3ca4b654 771ar="emxomfar -p128"
69db4e10
SG
772ranlib="echo ignoring ranlib"
773strip="echo ignoring strip"
30a3e5d4 774add_cflags "-Zomf"
e89b8b0a 775FFLDFLAGS="-Zomf -Zstack 16384 -s"
3ca4b654 776SHFLAGS="-Zdll -Zomf"
c536cb09 777FFSERVERLDFLAGS=""
f3ec2d46
SG
778LIBPREF=""
779LIBSUF=".lib"
780SLIBPREF=""
781SLIBSUF=".dll"
951bf3e6 782EXESUF=".exe"
f3ec2d46 783extralibs=""
c99dd233 784pkg_requires=""
9d2a0f1c
MR
785video4linux="no"
786video4linux2="no"
f3ec2d46 787audio_oss="no"
8aa3ee32 788dv1394="no"
f3ec2d46 789ffserver="no"
3ca4b654 790vhook="no"
f3ec2d46 791os2="yes"
b265431e 792os2threads="yes"
f3ec2d46 793;;
b2828252
DB
794*)
795targetos="${targetos}-UNKNOWN"
796;;
ef0bc4c9 797esac
de6d9b64 798
0f3cb305 799# find source path
997baf01 800source_path="`dirname \"$0\"`"
0f3cb305
FB
801source_path_used="yes"
802if test -z "$source_path" -o "$source_path" = "." ; then
997baf01 803 source_path="`pwd`"
0f3cb305 804 source_path_used="no"
e7a4dafb
MR
805else
806 source_path="`cd \"$source_path\"; pwd`"
997baf01
MR
807 echo "$source_path" | grep -q '[[:blank:]]' &&
808 die "Out of tree builds are impossible with whitespace in source path."
de6d9b64
FB
809fi
810
7d6ed4aa
MR
811if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
812 show_help
813fi
814
f255e0ab
MB
815FFMPEG_CONFIGURATION=" "
816for opt do
817 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
818done
819
13638ea9
SH
820ENCODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'`
821DECODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'`
822PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'`
823MUXER_LIST=`grep 'av_register_output_format(&[a-z]' "$source_path/libavformat/allformats.c" | sed 's/.*&\(.*\)).*/\1/'`
824DEMUXER_LIST=`grep 'av_register_input_format(&[a-z]' "$source_path/libavformat/allformats.c" | sed 's/.*&\(.*\)).*/\1/'`
009cf97d 825
a8d04fba
MR
826enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST
827
de6d9b64 828for opt do
fce53524 829 optval="${opt#*=}"
de6d9b64 830 case "$opt" in
2ba042a7
MR
831 --log)
832 ;;
fce53524 833 --log=*) logging="$optval"
57bd82d4 834 ;;
2266e085 835 --prefix=*) PREFIX="$optval"; force_prefix=yes
de6d9b64 836 ;;
fce53524 837 --libdir=*) libdir="$optval"; force_libdir=yes
cc973ecb 838 ;;
84c22efd
DB
839 --shlibdir=*) shlibdir="$optval"
840 ;;
fce53524 841 --incdir=*) incdir="$optval"
1d67a1d4 842 ;;
fce53524 843 --mandir=*) mandir="$optval"
23a65308 844 ;;
fce53524 845 --source-path=*) source_path="$optval"
0f3cb305 846 ;;
fce53524 847 --cross-prefix=*) cross_prefix="$optval"
0f3cb305 848 ;;
fac252f9
MR
849 --cross-compile) cross_compile=yes
850 ;;
fce53524 851 --cc=*) cc="$optval"
de6d9b64 852 ;;
fce53524 853 --make=*) make="$optval"
4a908fbc 854 ;;
30a3e5d4 855 --extra-cflags=*) add_cflags "$optval"
0f3cb305 856 ;;
28d8e661 857 --extra-ldflags=*) add_ldflags "$optval"
0f3cb305 858 ;;
28d8e661 859 --extra-libs=*) add_extralibs "$optval"
0f3cb305 860 ;;
fce53524 861 --build-suffix=*) BUILDSUF="$optval"
eb94aca9 862 ;;
cc6a90dd 863 --arch=*) arch="$optval"
de6d9b64 864 ;;
38d0a8aa 865 --cpu=*) cpu="$optval"
a4adb608 866 ;;
e45a2872
RD
867 --powerpc-perf-enable) powerpc_perf="yes"
868 ;;
de6d9b64
FB
869 --disable-mmx) mmx="no"
870 ;;
1839e854
SS
871 --disable-armv5te) armv5te="no"
872 ;;
eba9ae3c
GB
873 --disable-iwmmxt) iwmmxt="no"
874 ;;
ab6c65f6
BF
875 --disable-altivec) altivec="no"
876 ;;
de6d9b64
FB
877 --enable-gprof) gprof="yes"
878 ;;
9d2a0f1c 879 --disable-v4l) video4linux="no"
5cbcf02c 880 ;;
9d2a0f1c 881 --disable-v4l2) video4linux2="no"
0a7b514f 882 ;;
6beefa40
MN
883 --disable-bktr) bktr="no"
884 ;;
5cbcf02c
FB
885 --disable-audio-oss) audio_oss="no"
886 ;;
dfdfa47c
FR
887 --disable-audio-beos) audio_beos="no"
888 ;;
8aa3ee32
MK
889 --disable-dv1394) dv1394="no"
890 ;;
ffc0ef96 891 --disable-network) network="no"; ffserver="no"
5cbcf02c 892 ;;
0c7bb0e5
LB
893 --disable-ipv6) ipv6="no";
894 ;;
0147f198
FR
895 --disable-zlib) zlib="no"
896 ;;
ba9261e5 897 --enable-a52) a52="yes"
6ed7422a 898 ;;
bfd2edeb 899 --enable-a52bin) a52bin="yes"
57514323 900 ;;
c99dd233 901 --enable-dts) dts="yes"
23c99253 902 ;;
ba9261e5 903 --enable-pp) pp="yes"
bba9b16c 904 ;;
bb4c2140
MN
905 --enable-libgsm) libgsm="yes"
906 ;;
c99dd233 907 --enable-mp3lame) mp3lame="yes"
a6741398 908 ;;
f956e129
OS
909 --enable-libnut) libnut="yes"
910 ;;
9146ca37 911 --enable-libogg) libogg="yes"
c99dd233 912 pkg_requires="$pkg_requires ogg >= 1.1"
5c5dea3f 913 ;;
be74741c 914 --enable-vorbis) libvorbis="yes"
c99dd233 915 pkg_requires="$pkg_requires vorbis vorbisenc"
81e0d0b4 916 ;;
445ad18d
ZK
917 --enable-faad) faad="yes"
918 ;;
919 --enable-faadbin) faadbin="yes"
920 ;;
c99dd233 921 --enable-faac) faac="yes"
29d48296 922 ;;
1ddadfa9
AT
923 --enable-xvid) xvid="yes"
924 ;;
c99dd233 925 --enable-x264) x264="yes"
6662ec29 926 ;;
8ac17293
SH
927 --enable-avisynth) avisynth="yes";
928 ;;
f02be79d 929 --enable-dc1394) dc1394="yes"
c99dd233 930 pkg_requires="$pkg_requires libraw1394"
f02be79d 931 ;;
68892110
PG
932 --disable-vhook) vhook="no"
933 ;;
732d9245
BE
934 --enable-mingw32) mingw32="yes"
935 ;;
ac44871c
GB
936 --enable-mingwce) mingwce="yes"
937 ;;
320d060a
DB
938 --enable-static) lstatic="yes"
939 ;;
940 --disable-static) lstatic="no"
941 ;;
83286d2a 942 --enable-shared) lshared="yes"
0319c531 943 ;;
320d060a
DB
944 --disable-shared) lshared="no"
945 ;;
cddf3f45
GM
946 --disable-debug) debug="no"
947 ;;
948 --disable-opts) optimize="no"
949 ;;
78fcba8f
MR
950 --enable-extra-warnings) extrawarnings="yes"
951 ;;
1eb2212e
FB
952 --disable-mpegaudio-hp) mpegaudio_hp="no"
953 ;;
04f46ced
GB
954 --disable-protocols) protocols="no"; network="no"; ffserver="no"
955 ;;
786b30af
DB
956 --disable-ffmpeg) ffmpeg="no"
957 ;;
8154d2e0
FB
958 --disable-ffserver) ffserver="no"
959 ;;
a86b921c
FB
960 --disable-ffplay) ffplay="no"
961 ;;
cddf3f45 962 --enable-small) optimize="small"
553a6284 963 ;;
60827a1a 964 --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
891f64b3 965 ;;
60827a1a 966 --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
bc634f6f 967 ;;
60827a1a 968 --enable-amr_wb) amr="yes"; amr_wb="yes"
115329f1 969 ;;
60827a1a 970 --enable-amr_if2) amr="yes"; amr_if2="yes"
2a515c08 971 ;;
bde24d6e 972 --enable-sunmlib) mlib="yes"
f80f7964 973 ;;
9c3d33d6
MN
974 --enable-pthreads) pthreads="yes"
975 ;;
790c9ca7
LA
976 --enable-swscaler) swscaler="yes"
977 ;;
b2e3c528
MN
978 --enable-gpl) gpl="yes"
979 ;;
9ddbcae6 980 --enable-memalign-hack) memalign_hack="yes"
da9b170c 981 ;;
65d1bea2
MB
982 --disable-strip) dostrip="no"
983 ;;
a8d04fba 984 --enable-encoder=*) enable ${optval}_encoder
009cf97d 985 ;;
a8d04fba 986 --enable-decoder=*) enable ${optval}_decoder
f593b273 987 ;;
a8d04fba 988 --disable-encoder=*) disable ${optval}_encoder
f593b273 989 ;;
a8d04fba 990 --disable-decoder=*) disable ${optval}_decoder
009cf97d 991 ;;
a8d04fba 992 --disable-encoders) disable $ENCODER_LIST
009cf97d 993 ;;
a8d04fba 994 --disable-decoders) disable $DECODER_LIST
b4cad537 995 ;;
a8d04fba 996 --enable-muxer=*) enable ${optval}_muxer
a9e35095 997 ;;
a8d04fba 998 --disable-muxer=*) disable ${optval}_muxer
ff70e601 999 ;;
a8d04fba 1000 --disable-muxers) disable $MUXER_LIST; ffserver="no"
ff70e601 1001 ;;
a8d04fba 1002 --enable-demuxer=*) enable ${optval}_demuxer
ff70e601 1003 ;;
a8d04fba 1004 --disable-demuxer=*) disable ${optval}_demuxer
ff70e601 1005 ;;
a8d04fba 1006 --disable-demuxers) disable $DEMUXER_LIST
a9e35095 1007 ;;
a8d04fba 1008 --enable-parser=*) enable ${optval}_parser
af9e7d18 1009 ;;
a8d04fba 1010 --disable-parser=*) disable ${optval}_parser
af9e7d18 1011 ;;
a8d04fba 1012 --disable-parsers) disable $PARSER_LIST
af9e7d18 1013 ;;
74c53c2d
MR
1014 --help) show_help
1015 ;;
b34c63f7
DB
1016 *)
1017 echo "Unknown option \"$opt\"."
1018 echo "See $0 --help for available options."
1019 exit 1
1020 ;;
de6d9b64
FB
1021 esac
1022done
1023
720c69da
MR
1024if test "$logging" != no; then
1025 test "$logging" = yes || logfile="$logging"
57bd82d4
MR
1026 echo "# $0 $@" >$logfile
1027 set >>$logfile
2ba042a7
MR
1028else
1029 logfile=/dev/null
57bd82d4 1030fi
e89b8b0a 1031
e67bcdd9
DB
1032if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
1033 if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
1034 cat <<EOF
1035You can only build one library type at once on MinGW.
1036Specify --disable-static --enable-shared to only build
1037the shared libraries. To build only the static libraries
1038you do not need to pass additional options.
1039EOF
1040 exit 1
1041 fi
9d2a0f1c
MR
1042 video4linux="no"
1043 video4linux2="no"
e67bcdd9
DB
1044 bktr="no"
1045 audio_oss="no"
1046 dv1394="no"
1047 dc1394="no"
1048 ffserver="no"
1049 network="no"
b265431e
MR
1050 if enabled mingw32; then
1051 w32threads="yes"
1052 fi
e67bcdd9
DB
1053 if test "$mingwce" = "yes"; then
1054 protocols="no"
1055 fi
e67bcdd9
DB
1056 SLIBPREF=""
1057 SLIBSUF=".dll"
1058 EXESUF=".exe"
d6a07a13
DB
1059 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
1060 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
dfeb80a5 1061 SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
b89c8f58 1062 SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a)"
2266e085 1063 if test "$force_prefix" != yes; then PREFIX="$PROGRAMFILES/FFmpeg"; fi
1066a995
DB
1064 if test "$force_libdir" != yes; then bindir='${PREFIX}'; fi
1065 shlibdir='${PREFIX}'
e67bcdd9
DB
1066fi
1067
28d8e661
DB
1068# Combine FFLDFLAGS and the LDFLAGS environment variable.
1069LDFLAGS="$FFLDFLAGS $LDFLAGS"
e89b8b0a 1070
fac252f9 1071test -n "$cross_prefix" && cross_compile=yes
1ea46bed
MR
1072cc="${cross_prefix}${cc}"
1073ar="${cross_prefix}${ar}"
1074ranlib="${cross_prefix}${ranlib}"
1075strip="${cross_prefix}${strip}"
1076
320d060a
DB
1077# we need to build at least one lib type
1078if test "$lstatic" = "no" && test "$lshared" = "no" ; then
1079 cat <<EOF
1080At least one library type must be built.
1081Specify --enable-static to build the static libraries or --enable-shared to
1082build the shared libraries as well. To only build the shared libraries specify
1083--disable-static in addition to --enable-shared.
1084EOF
1085 exit 1;
1086fi
1087
be74741c 1088if test "$libvorbis" = "yes" ; then
9146ca37 1089 if test "$libogg" = "no"; then
29799f8b 1090 echo "libogg must be enabled to enable Vorbis."
5c5dea3f 1091 fail="yes"
5c5dea3f
NB
1092 fi
1093fi
1094
b2e3c528 1095if test "$gpl" != "yes"; then
ba64106a 1096 if test "$pp" != "no"; then
29799f8b 1097 echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
b2e3c528
MN
1098 fail="yes"
1099 fi
1100
1101 if test "$a52" != "no" -o "$a52bin" != "no"; then
29799f8b 1102 echo "liba52 is under GPL and --enable-gpl is not specified."
b2e3c528
MN
1103 fail="yes"
1104 fi
23c99253 1105
1ddadfa9 1106 if test "$xvid" != "no"; then
29799f8b 1107 echo "libxvidcore is under GPL and --enable-gpl is not specified."
1ddadfa9
AT
1108 fail="yes"
1109 fi
1110
6662ec29 1111 if test "$x264" != "no"; then
29799f8b 1112 echo "x264 is under GPL and --enable-gpl is not specified."
6662ec29
MN
1113 fail="yes"
1114 fi
1115
23c99253 1116 if test "$dts" != "no"; then
29799f8b 1117 echo "libdts is under GPL and --enable-gpl is not specified."
23c99253
MN
1118 fail="yes"
1119 fi
115329f1 1120
b2e3c528 1121 if test "$faad" != "no" -o "$faadbin" != "no"; then
dcd479c0
MR
1122 if check_header faad.h; then
1123 check_cc << EOF
b2e3c528
MN
1124 #include <faad.h>
1125 #ifndef FAAD2_VERSION
1126 ok faad1
1127 #endif
1128 int main( void ) { return 0; }
1129EOF
dcd479c0 1130 if test $? = 0 ; then
29799f8b 1131 echo "FAAD2 is under GPL and --enable-gpl is not specified."
b2e3c528
MN
1132 fail="yes"
1133 fi
1134 else
1135 faad="no"
1136 faadbin="no"
29799f8b 1137 echo "FAAD test failed."
b2e3c528
MN
1138 fi
1139 fi
115329f1 1140
790c9ca7
LA
1141 if test "$swscaler" != "no"; then
1142 echo "The software scaler is under GPL and --enable-gpl is not specified."
1143 fail="yes"
1144 fi
ebb810d9 1145fi
b2e3c528 1146
ebb810d9
RP
1147if test "$fail" = "yes"; then
1148 exit 1
b2e3c528
MN
1149fi
1150
29799f8b 1151# compute MMX state
0f3cb305 1152if test $mmx = "default"; then
419b8784 1153 if test $arch = "x86_32" -o $arch = "x86_64"; then
0f3cb305
FB
1154 mmx="yes"
1155 else
1156 mmx="no"
1157 fi
1158fi
1159
cf9d24ad 1160#Darwin CC versions
75388c74 1161needmdynamicnopic="no"
cf9d24ad 1162if test $targetos = Darwin; then
b2924696 1163 if test -n "`$cc -v 2>&1 | grep xlc`"; then
30a3e5d4 1164 add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
cf9d24ad 1165 else
bb270c08
DB
1166 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
1167 case "$gcc_version" in
1168 *2.95*)
30a3e5d4 1169 add_cflags "-no-cpp-precomp -pipe"
bb270c08
DB
1170 ;;
1171 *[34].*)
30a3e5d4 1172 add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare"
bb270c08
DB
1173 if test "$lshared" = no; then
1174 needmdynamicnopic="yes"
1175 fi
1176 ;;
1177 *)
30a3e5d4 1178 add_cflags "-no-cpp-precomp -pipe"
bb270c08
DB
1179 if test "$lshared" = no; then
1180 needmdynamicnopic="yes"
1181 fi
1182 ;;
1183 esac
cf9d24ad 1184 fi
2a1a6b64
MN
1185fi
1186
1187if test $optimize != "no"; then
1188 add_cflags "-fomit-frame-pointer"
cf9d24ad
DC
1189fi
1190
ab6c65f6
BF
1191# Can only do AltiVec on PowerPC
1192if test $altivec = "default"; then
cc6a90dd 1193 if test $arch = "powerpc"; then
ab6c65f6
BF
1194 altivec="yes"
1195 else
1196 altivec="no"
1197 fi
1198fi
1199
a4adb608
MN
1200# Add processor-specific flags
1201TUNECPU="generic"
9007f514 1202POWERPCMODE="32bits"
38d0a8aa
GP
1203if test $cpu != "generic"; then
1204 case $cpu in
bb270c08 1205 601|ppc601|PowerPC601)
1c5d830c 1206 add_cflags "-mcpu=601"
bb270c08
DB
1207 if test $altivec = "yes"; then
1208 echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
1209 fi
1210 TUNECPU=ppc601
1211 ;;
1212 603*|ppc603*|PowerPC603*)
1c5d830c 1213 add_cflags "-mcpu=603"
bb270c08
DB
1214 if test $altivec = "yes"; then
1215 echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
1216 fi
1217 TUNECPU=ppc603
1218 ;;
1219 604*|ppc604*|PowerPC604*)
1c5d830c 1220 add_cflags "-mcpu=604"
bb270c08
DB
1221 if test $altivec = "yes"; then
1222 echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
1223 fi
1224 TUNECPU=ppc604
1225 ;;
1226 G3|g3|75*|ppc75*|PowerPC75*)
1c5d830c 1227 add_cflags "-mcpu=750 -mpowerpc-gfxopt"
bb270c08
DB
1228 if test $altivec = "yes"; then
1229 echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
1230 fi
1231 TUNECPU=ppc750
1232 ;;
1233 G4|g4|745*|ppc745*|PowerPC745*)
1c5d830c 1234 add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
bb270c08
DB
1235 if test $altivec = "no"; then
1236 echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
1237 fi
1238 TUNECPU=ppc7450
1239 ;;
1240 74*|ppc74*|PowerPC74*)
1c5d830c 1241 add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
bb270c08
DB
1242 if test $altivec = "no"; then
1243 echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
1244 fi
1245 TUNECPU=ppc7400
1246 ;;
1247 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
1c5d830c 1248 add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
bb270c08
DB
1249 if test $altivec = "no"; then
1250 echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
1251 fi
1252 TUNECPU=ppc970
9007f514 1253 POWERPCMODE="64bits"
bb270c08 1254 ;;
e7768fc5
GP
1255 # targets that do NOT support conditional mov (cmov)
1256 i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
38d0a8aa 1257 add_cflags "-march=$cpu"
e7768fc5
GP
1258 cmov="no"
1259 ;;
1260 # targets that do support conditional mov (cmov)
94e4c3a3 1261 i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx)
e7768fc5 1262 add_cflags "-march=$cpu"
4c8d81fa 1263 cmov="yes"
94e4c3a3
GP
1264 cmov_is_fast="yes"
1265 ;;
1266 # targets that do support conditional mov but on which it's slow
1267 pentium4|prescott|nocona)
1268 add_cflags "-march=$cpu"
1269 cmov="yes"
1270 cmov_is_fast="no"
bb270c08 1271 ;;
d7b34d08 1272 sparc64)
1c5d830c 1273 add_cflags "-mcpu=v9"
d7b34d08 1274 ;;
bb270c08 1275 *)
38d0a8aa 1276 echo "WARNING: Unknown CPU \"$cpu\", ignored."
bb270c08 1277 ;;
a4adb608
MN
1278 esac
1279fi
1280
be0d52ab
MR
1281# make sure we can execute files in $TMPDIR
1282cat >$TMPE 2>>$logfile <<EOF
1283#! /bin/sh
1284EOF
1285chmod +x $TMPE >>$logfile 2>&1
1286if ! $TMPE >>$logfile 2>&1; then
1287 cat <<EOF
1288Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment
68300911
DB
1289variable to another directory and make sure that $TMPDIR1 is not mounted
1290noexec.
be0d52ab
MR
1291EOF
1292 die "Sanity test failed."
1293fi
0244f743 1294rm $TMPE
be0d52ab 1295
1a268acc
MR
1296# compiler sanity check
1297check_exec <<EOF
1298int main(){
1299 return 0;
1300}
1301EOF
1302if test "$?" != 0; then
1303 echo "$cc is unable to create an executable file."
1304 if test -z "$cross_prefix" -a "$cross_compile" = no; then
1305 echo "If $cc is a cross-compiler, use the --cross-compile option."
c7ae6345 1306 echo "Only do this if you know what cross compiling means."
1a268acc
MR
1307 fi
1308 die "C compiler test failed."
1309fi
1310
87ea51e0
LB
1311# check for assembler specific support
1312
cc6a90dd 1313if test $arch = "powerpc"; then
87ea51e0
LB
1314check_cc <<EOF && dcbzl=yes
1315int main(void) {
1316 register long zero = 0;
1317 char data[1024];
1318 asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
1319return 0;
1320}
1321EOF
1322fi
1323
57bd82d4
MR
1324# check for SIMD availability
1325
115329f1 1326# AltiVec flags: The FSF version of GCC differs from the Apple version
cc6a90dd 1327if test $arch = "powerpc"; then
b6e52719 1328 if test $altivec = "yes"; then
b2924696 1329 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
30a3e5d4 1330 add_cflags "-faltivec"
b6e52719 1331 else
30a3e5d4 1332 add_cflags "-maltivec -mabi=altivec"
b6e52719
MD
1333 fi
1334 fi
1335fi
1336
0701ca7f 1337check_header altivec.h
a9a07762 1338
29799f8b 1339# check if our compiler supports Motorola AltiVec C API
ab6c65f6 1340if test $altivec = "yes"; then
6e7a01e4 1341 if test $altivec_h = "yes"; then
f25fc9b1
MR
1342 inc_altivec_h="#include <altivec.h>"
1343 else
1344 inc_altivec_h=
1345 fi
1346 check_cc <<EOF || altivec=no
dcd479c0 1347$inc_altivec_h
a9a07762
MN
1348int main(void) {
1349 vector signed int v1, v2, v3;
1350 v1 = vec_add(v2,v3);
1351 return 0;
1352}
1353EOF
1354fi
ab6c65f6 1355
854fdb51 1356# check armv5te instructions support
cc6a90dd 1357if test $armv5te = "default" -a $arch = "armv4l"; then
854fdb51
MR
1358 armv5te=no
1359 check_cc <<EOF && armv5te=yes
1360 int main(void) {
1361 __asm__ __volatile__ ("qadd r0, r0, r0");
1362 }
1363EOF
1364fi
1365
1366# check iwmmxt support
cc6a90dd 1367if test $iwmmxt = "default" -a $arch = "armv4l"; then
854fdb51
MR
1368 iwmmxt=no
1369 check_cc <<EOF && iwmmxt=yes
1370 int main(void) {
1371 __asm__ __volatile__ ("wunpckelub wr6, wr4");
1372 }
1373EOF
1374fi
1375
29799f8b 1376# mmi only available on mips
d46aba26 1377if test $mmi = "default"; then
cc6a90dd 1378 if test $arch = "mips"; then
d46aba26
LS
1379 mmi="yes"
1380 else
1381 mmi="no"
1382 fi
1383fi
1384
29799f8b 1385# check if our compiler supports mmi
57bd82d4 1386enabled mmi && check_cc <<EOF || mmi="no"
d46aba26
LS
1387int main(void) {
1388 __asm__ ("lq \$2, 0(\$2)");
1389 return 0;
1390}
1391EOF
57bd82d4 1392
57bd82d4
MR
1393# ---
1394# big/little-endian test
fac252f9 1395if test "$cross_compile" = "no"; then
57bd82d4 1396 check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
a3999908
MN
1397#include <inttypes.h>
1398int main(int argc, char ** argv){
bb270c08
DB
1399 volatile uint32_t i=0x01234567;
1400 return (*((uint8_t*)(&i))) == 0x67;
a3999908
MN
1401}
1402EOF
487a54d7 1403else
f25fc9b1 1404 # programs cannot be launched if cross compiling, so make a static guess
cc6a90dd 1405 if test "$arch" = "powerpc" -o "$arch" = "mips" ; then
f25fc9b1
MR
1406 bigendian="yes"
1407 fi
487a54d7
FB
1408fi
1409
a3999908 1410# ---
3d204385
NK
1411# check availability of some header files
1412
0701ca7f
MR
1413check_header malloc.h
1414check_func memalign
3d204385 1415
1981aafc 1416if test "$memalign" = "no" -a "$mmx" = "yes" -a \
9ddbcae6 1417 "$memalign_hack" != "yes" -a "$targetos" != "Darwin" -a \
a9907393 1418 "$targetos" != "FreeBSD" ; then
57bd82d4 1419 die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
8bf5d58f
MN
1420fi
1421
0701ca7f 1422check_header byteswap.h
47d23bbf 1423
0701ca7f
MR
1424check_func inet_aton
1425check_func localtime_r
57bd82d4 1426enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
57bd82d4
MR
1427
1428# check for some common methods of building with pthread support
1429# do this before the optional library checks as some of them require pthreads
1430if enabled pthreads; then
1431 { check_cflags -pthread && check_ldflags -pthread; } ||
1432 { check_cflags -pthreads && check_ldflags -pthreads; } ||
1433 check_lib pthread.h pthread_create -lpthread ||
1434 check_func pthread_create ||
1435 die "ERROR: can't find pthreads library"
1436fi
1437
1438# these are off by default, so fail if requested and not available
4cbed916 1439enabled dts && require libdts dts.h dts_init -ldts -lm
57bd82d4 1440enabled libgsm && require libgsm gsm.h gsm_create -lgsm
4cbed916 1441enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
be74741c 1442enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg
aedf11f8 1443enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
4d8aa1c3 1444enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
57bd82d4
MR
1445enabled xvid && require XviD xvid.h xvid_global -lxvidcore
1446enabled x264 && require x264 x264.h x264_encoder_open -lx264
1447enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
bde24d6e 1448enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
e0f80bd7 1449
3b9bee88
MR
1450# Ugh, faac uses stdcall calling convention on win32 so we can't use
1451# the generic test functions
1452if enabled faac; then
1453 save_flags
1454 temp_extralibs -lfaac
1455 check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found"
1456#include <stdint.h>
1457#include <faac.h>
1458int main(){
1459 char *id, *cpr;
1460 faacEncGetVersion(&id, &cpr);
1461 return 0;
1462}
1463EOF
1464 restore_flags
1465fi
1466
87f1c97e
MR
1467# Ugh, recent faad2 versions have renamed all functions and #define the
1468# old names in faad.h. Generic tests won't work.
1469if enabled faad; then
1470 save_flags
1471 temp_extralibs -lfaad
1472 check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found"
1473#include <faad.h>
1474int main(){
1475 faacDecOpen();
1476 return 0;
1477}
1478EOF
1479 restore_flags
1480fi
1481
8ac17293
SH
1482# Ugh, avisynth uses WINAPI calls. Generic tests won't work.
1483if enabled avisynth; then
1484 save_flags
1485 temp_extralibs -lvfw32
1486 check_ld <<EOF && add_extralibs -lvfw32 || die "ERROR: vfw32 not found"
1487#include <windows.h>
1488#include <vfw.h>
1489int main(){
1490 AVIFileInit();
1491 return 0;
1492}
1493EOF
1494 restore_flags
1495fi
1496
1497
95e2ce4a 1498# test for lrintf in math.h
fc2b267f 1499check_exec <<EOF && lrintf=yes || lrintf=no
95e2ce4a
MN
1500#define _ISOC9X_SOURCE 1
1501#include <math.h>
1502int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1503EOF
1504
c13e1abd
FH
1505_restrict=
1506for restrict_keyword in restrict __restrict__ __restrict; do
57bd82d4 1507 check_cc <<EOF && _restrict=$restrict_keyword && break
dcd479c0
MR
1508void foo(char * $restrict_keyword p);
1509EOF
c13e1abd
FH
1510done
1511
a8721c09
FB
1512# dlopen/dlfcn.h probing
1513
0701ca7f 1514check_header dlfcn.h
a8721c09 1515
dcd479c0 1516if check_func dlopen; then
dcd479c0 1517 ldl=
0701ca7f
MR
1518elif check_func dlopen -ldl; then
1519 ldl=-ldl
a8721c09
FB
1520fi
1521
f25fc9b1
MR
1522if test "$vhook" = "default"; then
1523 vhook="$dlopen"
a8721c09
FB
1524fi
1525
22df6d18 1526if enabled_any vhook a52bin faadbin; then
57bd82d4 1527 add_extralibs $ldl
bfd2edeb
MN
1528fi
1529
fbb9d104
VP
1530if test "$targetos" = "CYGWIN" -a "$lstatic" = "yes" ; then
1531 vhook="no"
1532 echo
1533 echo "At the moment vhooks don't work on Cygwin static builds."
1534 echo "Patches welcome."
1535 echo
1536fi
1537
8d923001
MR
1538if enabled vhook; then
1539 check_ldflags -rdynamic
1540 check_ldflags -export-dynamic
1541fi
bfd2edeb 1542
9464f2b8
DB
1543if enabled audio_beos; then
1544 add_extralibs "-lmedia -lbe"
1545fi
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