MinGW compilation fix, inet_aton and #includes depend on networking support.
[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
a86b921c 1543##########################################
29799f8b 1544# imlib check
a86b921c 1545
dcd479c0
MR
1546temp_extralibs -lImlib2
1547check_ld <<EOF && imlib2=yes || imlib2=no
a8721c09
FB
1548#include <X11/Xlib.h>
1549#include <Imlib2.h>
1550int main( void ) { return (int) imlib_load_font("foo"); }
1551EOF
dcd479c0 1552restore_flags
52b41d7f 1553
a86b921c 1554##########################################
29799f8b 1555# FreeType check
a86b921c 1556
04511d53 1557freetype2=no
e2a5fd20 1558if test "x$targetos" != "xBeOS"; then
e2a3cd59 1559 if (freetype-config --version) >/dev/null 2>&1 ; then
dcd479c0
MR
1560 temp_cflags `freetype-config --cflags`
1561 temp_extralibs `freetype-config --libs`
1562 check_ld <<EOF && freetype2=yes
1563#include <ft2build.h>
1564int main( void ) { return (int) FT_Init_FreeType(0); }
1565EOF
1566 restore_flags
dee076fc 1567 fi
04511d53
PG
1568fi
1569
a86b921c 1570##########################################
29799f8b 1571# SDL check
a86b921c 1572
a86b921c
FB
1573sdl_too_old=no
1574sdl=no
6a1a892f
FD
1575SDL_CONFIG="${cross_prefix}sdl-config"
1576if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
dcd479c0
MR
1577 temp_cflags `"${SDL_CONFIG}" --cflags`
1578 temp_extralibs `"${SDL_CONFIG}" --libs`
1579 check_ld <<EOF
1580#include <SDL.h>
1581#undef main /* We don't want SDL to override our main() */
1582int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1583EOF
dcd479c0
MR
1584 if test $? = 0; then
1585 _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
29f3b38a 1586 if test "$_sdlversion" -lt 121 ; then
dcd479c0
MR
1587 sdl_too_old=yes
1588 else
1589 sdl=yes
29f3b38a
MR
1590 check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
1591#include <SDL.h>
1592int main(void){
1593 const SDL_VideoInfo *vi = SDL_GetVideoInfo();
1594 int w = vi->current_w;
1595 return 0;
1596}
1597EOF
dcd479c0
MR
1598 fi
1599 fi
29f3b38a 1600 restore_flags
c3f6b472 1601fi
a86b921c 1602
57bd82d4
MR
1603enabled sdl || ffplay=no
1604
146ea952 1605##########################################
29799f8b 1606# texi2html check
146ea952
NB
1607
1608texi2html=no
e2a3cd59 1609if (texi2html -version) >/dev/null 2>&1; then
146ea952
NB
1610texi2html=yes
1611fi
1612
7a91333f 1613##########################################
29799f8b 1614# IPv6 check
7a91333f 1615
0c7bb0e5 1616enabled network && enabled ipv6 && check_ld <<EOF && ipv6=yes || ipv6=no
7a91333f
HZ
1617#include <sys/types.h>
1618#include <sys/socket.h>
1619#include <netinet/in.h>
1620#include <netdb.h>
1621int main( void ) {
1622 struct sockaddr_storage saddr;
1623 struct ipv6_mreq mreq6;
1624 getaddrinfo(0,0,0,0);
1625 getnameinfo(0,0,0,0,0,0,0);
12fe88b4 1626 IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
7a91333f
HZ
1627}
1628EOF
1629
47f38850 1630# check for video4linux2 --- V4L2_PIX_FMT_YUV420
9d2a0f1c 1631enabled video4linux2 && check_cc <<EOF || video4linux2="no"
84fe9963 1632#include <sys/time.h>
f743a062
LA
1633#include <asm/types.h>
1634#include <linux/videodev2.h>
47f38850 1635int dummy = V4L2_PIX_FMT_YUV420;
490c189b 1636struct v4l2_buffer dummy1;
47f38850 1637EOF
47f38850 1638
57bd82d4
MR
1639enabled debug && add_cflags -g
1640
1641# add some useful compiler flags if supported
1642check_cflags -Wdeclaration-after-statement
dcd479c0
MR
1643check_cflags -Wall
1644check_cflags -Wno-switch
c07bd6a9
MN
1645check_cflags -Wdisabled-optimization
1646check_cflags -Wpointer-arith
1647check_cflags -Wredundant-decls
78fcba8f 1648enabled extrawarnings && check_cflags -Winline
cf9d24ad 1649
57bd82d4 1650# add some linker flags
e240ee67 1651check_ldflags $LDLATEFLAGS
94a3401e 1652
57bd82d4
MR
1653# not all compilers support -Os
1654test "$optimize" = "small" && check_cflags -Os
cddf3f45 1655
57bd82d4 1656if enabled optimize; then
b2924696 1657 if test -n "`$cc -v 2>&1 | grep xlc`"; then
30a3e5d4
NP
1658 add_cflags "-O5"
1659 add_ldflags "-O5"
cf9d24ad 1660 else
30a3e5d4 1661 add_cflags "-O3"
cf9d24ad 1662 fi
cddf3f45
GM
1663fi
1664
80581e98
MN
1665# PIC flags for shared library objects where they are needed
1666if test "$lshared" = "yes" ; then
f25fc9b1
MR
1667 # LIBOBJFLAGS may have already been set in the OS configuration
1668 if test -z "$LIBOBJFLAGS" ; then
cc6a90dd 1669 case "$arch" in
813457e5
MR
1670 x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
1671 esac
80581e98 1672 fi
80581e98
MN
1673fi
1674
1db54e20 1675if test "$gprof" = "yes" ; then
30a3e5d4
NP
1676 add_cflags "-p"
1677 add_ldflags "-p"
1db54e20
DB
1678fi
1679
18451f7d
MR
1680VHOOKCFLAGS="-fPIC $CFLAGS"
1681test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
1682
4454dc1b
JD
1683# find if .align arg is power-of-two or not
1684if test $asmalign_pot = "unknown"; then
1685 asmalign_pot="no"
1686 echo 'asm (".align 3");' | check_cc && asmalign_pot="yes"
1687fi
1688
2266e085 1689echo "install prefix $PREFIX"
29799f8b 1690echo "source path $source_path"
de6d9b64 1691echo "C compiler $cc"
4a908fbc 1692echo "make $make"
38d0a8aa 1693echo "ARCH $arch ($cpu)"
eb94aca9 1694if test "$BUILDSUF" != ""; then
f25fc9b1 1695 echo "build suffix $BUILDSUF"
eb94aca9 1696fi
29799f8b 1697echo "big-endian $bigendian"
419b8784 1698if test $arch = "x86_32" -o $arch = "x86_64"; then
f25fc9b1 1699 echo "MMX enabled $mmx"
e7768fc5 1700 echo "CMOV enabled $cmov"
94e4c3a3 1701 echo "CMOV is fast $cmov_is_fast"
e41e8342 1702fi
cc6a90dd 1703if test $arch = "armv4l"; then
1839e854 1704 echo "ARMv5TE enabled $armv5te"
f25fc9b1 1705 echo "IWMMXT enabled $iwmmxt"
eba9ae3c 1706fi
cc6a90dd 1707if test $arch = "mips"; then
f25fc9b1 1708 echo "MMI enabled $mmi"
e41e8342 1709fi
cc6a90dd 1710if test $arch = "powerpc"; then
f25fc9b1 1711 echo "AltiVec enabled $altivec"
87ea51e0 1712 echo "dcbzl available $dcbzl"
e41e8342 1713fi
de6d9b64 1714echo "gprof enabled $gprof"
0147f198 1715echo "zlib enabled $zlib"
bb4c2140 1716echo "libgsm enabled $libgsm"
a6741398 1717echo "mp3lame enabled $mp3lame"
f956e129 1718echo "libnut enabled $libnut"
9146ca37 1719echo "libogg enabled $libogg"
be74741c 1720echo "Vorbis enabled $libvorbis"
29799f8b 1721echo "FAAD enabled $faad"
445ad18d 1722echo "faadbin enabled $faadbin"
29799f8b
DB
1723echo "FAAC enabled $faac"
1724echo "XviD enabled $xvid"
6662ec29 1725echo "x264 enabled $x264"
5cbcf02c 1726echo "a52 support $a52"
57514323 1727echo "a52 dlopened $a52bin"
29799f8b 1728echo "DTS support $dts"
bba9b16c 1729echo "pp support $pp"
790c9ca7 1730echo "Software Scaler enabled $swscaler"
8ac17293 1731echo "AVISynth enabled $avisynth"
cddf3f45 1732echo "debug symbols $debug"
65d1bea2 1733echo "strip symbols $dostrip"
cddf3f45 1734echo "optimize $optimize"
320d060a 1735echo "static $lstatic"
1ddf5ba1 1736echo "shared $lshared"
29799f8b 1737echo "video hooking $vhook"
a86b921c
FB
1738echo "SDL support $sdl"
1739if test $sdl_too_old = "yes"; then
f25fc9b1 1740 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
a86b921c 1741fi
68892110 1742
f25fc9b1
MR
1743if test "$vhook" = "yes"; then
1744 echo "Imlib2 support $imlib2"
1745 echo "FreeType support $freetype2"
68892110 1746fi
bde24d6e 1747echo "Sun medialib support" $mlib
9c3d33d6 1748echo "pthreads support" $pthreads
bc634f6f
ZK
1749echo "AMR-NB float support" $amr_nb
1750echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 1751echo "AMR-WB float support" $amr_wb
2a515c08 1752echo "AMR-WB IF2 support" $amr_if2
7a91333f
HZ
1753echo "network support $network"
1754if test "$network" = "yes" ; then
f25fc9b1 1755 echo "IPv6 support $ipv6"
7a91333f 1756fi
4454dc1b 1757echo ".align is power-of-two" $asmalign_pot
b2e3c528 1758if test "$gpl" = "no" ; then
f25fc9b1 1759 echo "License: LGPL"
b2e3c528 1760else
f25fc9b1 1761 echo "License: GPL"
b2e3c528 1762fi
de6d9b64 1763
29799f8b 1764echo "Creating config.mak and config.h..."
de6d9b64 1765
f255e0ab
MB
1766date >> config.log
1767echo " $0 $FFMPEG_CONFIGURATION" >> config.log
29799f8b
DB
1768echo "# Automatically generated by configure - do not modify!" > config.mak
1769echo "/* Automatically generated by configure - do not modify! */" > $TMPH
f255e0ab 1770echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
de6d9b64 1771
2266e085
DB
1772echo "PREFIX=$PREFIX" >> config.mak
1773echo "prefix=\$(DESTDIR)\${PREFIX}" >> config.mak
9a695e98 1774echo "libdir=\$(DESTDIR)$libdir" >> config.mak
84c22efd 1775echo "shlibdir=\$(DESTDIR)$shlibdir" >> config.mak
1d67a1d4 1776echo "incdir=\$(DESTDIR)$incdir" >> config.mak
9a695e98
DB
1777echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1778echo "mandir=\$(DESTDIR)$mandir" >> config.mak
4a908fbc 1779echo "MAKE=$make" >> config.mak
980fc7b8
FB
1780echo "CC=$cc" >> config.mak
1781echo "AR=$ar" >> config.mak
be7109c1 1782echo "RANLIB=$ranlib" >> config.mak
65d1bea2 1783if test "$dostrip" = "yes" ; then
f25fc9b1
MR
1784 echo "STRIP=$strip" >> config.mak
1785 echo "INSTALLSTRIP=$installstrip" >> config.mak
65d1bea2 1786else
f25fc9b1
MR
1787 echo "STRIP=echo ignoring strip" >> config.mak
1788 echo "INSTALLSTRIP=" >> config.mak
65d1bea2 1789fi
75388c74 1790
a9b3f630 1791echo "OPTFLAGS=$CFLAGS" >> config.mak
408382a4 1792echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
0f3cb305 1793echo "LDFLAGS=$LDFLAGS" >> config.mak
f39e56a8 1794echo "LDCONFIG=$LDCONFIG" >> config.mak
c536cb09 1795echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
e1707f52 1796echo "SHFLAGS=$SHFLAGS" >> config.mak
408382a4 1797echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
fbb9d104 1798echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
80581e98 1799echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
b12f8273 1800echo "BUILD_STATIC=$lstatic" >> config.mak
eb94aca9 1801echo "BUILDSUF=$BUILDSUF" >> config.mak
f3ec2d46 1802echo "LIBPREF=$LIBPREF" >> config.mak
eb94aca9 1803echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
320d060a
DB
1804if test "$lstatic" = "yes" ; then
1805 echo "LIB=$LIB" >> config.mak
1a44a8b6
AS
1806else # Some Make complain if this variable does not exist.
1807 echo "LIB=" >> config.mak
320d060a 1808fi
f3ec2d46 1809echo "SLIBPREF=$SLIBPREF" >> config.mak
eb94aca9
CY
1810echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1811echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
b2828252 1812echo "TARGET_OS=$targetos" >> config.mak
419b8784 1813if test "$arch" = "x86_32" -o "$arch" = "x86_64" ; then
980fc7b8 1814 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 1815 echo "#define ARCH_X86 1" >> $TMPH
419b8784
DB
1816fi
1817if test "$arch" = "x86_32" ; then
1818 echo "TARGET_ARCH_X86_32=yes" >> config.mak
1819 echo "#define ARCH_X86_32 1" >> $TMPH
cc6a90dd 1820elif test "$arch" = "x86_64" ; then
053dea12
AJ
1821 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1822 echo "#define ARCH_X86_64 1" >> $TMPH
cc6a90dd 1823elif test "$arch" = "armv4l" ; then
6ed7422a 1824 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 1825 echo "#define ARCH_ARMV4L 1" >> $TMPH
cc6a90dd 1826elif test "$arch" = "alpha" ; then
91d1f1a4 1827 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 1828 echo "#define ARCH_ALPHA 1" >> $TMPH
cc6a90dd 1829elif test "$arch" = "sparc64" ; then
35fedfc3
PG
1830 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1831 echo "#define ARCH_SPARC64 1" >> $TMPH
bb476ff3
JM
1832 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1833 echo "#define ARCH_SPARC 1" >> $TMPH
cc6a90dd 1834elif test "$arch" = "sparc" ; then
bb476ff3
JM
1835 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1836 echo "#define ARCH_SPARC 1" >> $TMPH
cc6a90dd 1837elif test "$arch" = "powerpc" ; then
0f3cb305
FB
1838 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1839 echo "#define ARCH_POWERPC 1" >> $TMPH
9007f514
RD
1840 if test $POWERPCMODE = "32bits"; then
1841 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1842 else
1843 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1844 fi
e45a2872
RD
1845 if test "$powerpc_perf" = "yes"; then
1846 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1847 fi
cc6a90dd 1848elif test "$arch" = "mips" ; then
d46aba26
LS
1849 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1850 echo "#define ARCH_MIPS 1" >> $TMPH
cc6a90dd 1851elif test "$arch" = "sh4" ; then
bdb2e37c
AB
1852 echo "TARGET_ARCH_SH4=yes" >> config.mak
1853 echo "#define ARCH_SH4 1" >> $TMPH
cc6a90dd 1854elif test "$arch" = "parisc" ; then
67860b26
SH
1855 echo "TARGET_ARCH_PARISC=yes" >> config.mak
1856 echo "#define ARCH_PARISC 1" >> $TMPH
cc6a90dd 1857elif test "$arch" = "s390" ; then
67860b26
SH
1858 echo "TARGET_ARCH_S390=yes" >> config.mak
1859 echo "#define ARCH_S390 1" >> $TMPH
cc6a90dd 1860elif test "$arch" = "m68k" ; then
67860b26
SH
1861 echo "TARGET_ARCH_M68K=yes" >> config.mak
1862 echo "#define ARCH_M68K 1" >> $TMPH
cc6a90dd 1863elif test "$arch" = "ia64" ; then
67860b26
SH
1864 echo "TARGET_ARCH_IA64=yes" >> config.mak
1865 echo "#define ARCH_IA64 1" >> $TMPH
cc6a90dd 1866elif test "$arch" = "bfin" ; then
81a9b052
MB
1867 echo "TARGET_ARCH_BFIN=yes" >> config.mak
1868 echo "#define ARCH_BFIN 1" >> $TMPH
bdb2e37c 1869fi
a4adb608 1870echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
1871if test "$bigendian" = "yes" ; then
1872 echo "WORDS_BIGENDIAN=yes" >> config.mak
1873 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 1874fi
57514323 1875if test "$mmx" = "yes" ; then
980fc7b8 1876 echo "TARGET_MMX=yes" >> config.mak
045ed63f 1877 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 1878 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 1879fi
e7768fc5
GP
1880if test "$cmov" = "yes" ; then
1881 echo "TARGET_CMOV=yes" >> config.mak
1882 echo "#define HAVE_CMOV 1" >> $TMPH
1883fi
94e4c3a3
GP
1884if test "$cmov_is_fast" = "yes" ; then
1885 echo "TARGET_CMOV_IS_FAST=yes" >> config.mak
1886 echo "#define CMOV_IS_FAST 1" >> $TMPH
1887fi
1839e854
SS
1888if test "$armv5te" = "yes" ; then
1889 echo "TARGET_ARMV5TE=yes" >> config.mak
1890 echo "#define HAVE_ARMV5TE 1" >> $TMPH
1891fi
eba9ae3c
GB
1892if test "$iwmmxt" = "yes" ; then
1893 echo "TARGET_IWMMXT=yes" >> config.mak
1894 echo "#define HAVE_IWMMXT 1" >> $TMPH
1895fi
d46aba26
LS
1896if test "$mmi" = "yes" ; then
1897 echo "TARGET_MMI=yes" >> config.mak
1898 echo "#define HAVE_MMI 1" >> $TMPH
1899fi
87ea51e0 1900
ab6c65f6
BF
1901if test "$altivec" = "yes" ; then
1902 echo "TARGET_ALTIVEC=yes" >> config.mak
1903 echo "#define HAVE_ALTIVEC 1" >> $TMPH
f80f7964 1904fi
44161118 1905
a86b921c 1906if test "$sdl" = "yes" ; then
6a1a892f
FD
1907 echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
1908 echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
a86b921c 1909fi
146ea952
NB
1910if test "$texi2html" = "yes"; then
1911 echo "BUILD_DOC=yes" >> config.mak
1912fi
5a872801 1913
790c9ca7 1914sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
6d9a2421 1915pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
5a872801
LB
1916lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1917lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1918lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1919
1920
1921
57514323 1922if test "$lshared" = "yes" ; then
320d060a 1923 echo "#define BUILD_SHARED_AV 1" >> $TMPH
0319c531 1924 echo "BUILD_SHARED=yes" >> config.mak
97006039 1925 echo "PIC=-fPIC -DPIC" >> config.mak
39503a27 1926 echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
5a872801 1927 echo "SPPVERSION=$lavc_version" >> config.mak
39503a27 1928 echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
5a872801 1929 echo "LAVCVERSION=$lavc_version" >> config.mak
39503a27 1930 echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
5a872801 1931 echo "LAVFVERSION=$lavf_version" >> config.mak
39503a27 1932 echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
5a872801 1933 echo "LAVUVERSION=$lavu_version" >> config.mak
790c9ca7
LA
1934 echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
1935 echo "SWSVERSION=$sws_version" >> config.mak
4bdd05e7 1936 echo "SLIBNAME=${SLIBNAME}" >> config.mak
f3b60109
DB
1937 echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1938 echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
5cb854e1 1939 echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
0319c531 1940fi
d7e27559 1941echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
ef0bc4c9 1942echo "EXTRALIBS=$extralibs" >> config.mak
d2845d68 1943
44161118
MR
1944enabled_any $ENCODER_LIST && enable encoders
1945enabled_any $DECODER_LIST && enable decoders
1946enabled_any $MUXER_LIST && enable muxers
1947enabled_any $DEMUXER_LIST && enable demuxers
f956e129 1948
b265431e
MR
1949enabled_any pthreads beosthreads os2threads w32threads && enable threads
1950
44161118
MR
1951print_config HAVE_ $TMPH config.mak $HAVE_LIST
1952print_config CONFIG_ $TMPH config.mak $CONFIG_LIST
8ac17293 1953
732d9245 1954if test "$mingw32" = "yes" ; then
7eea5766 1955 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1956 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1957 echo "#endif" >> $TMPH
3f027ca7
FB
1958fi
1959
ac44871c 1960if test "$mingwce" = "yes" ; then
ac44871c 1961 echo "#define CONFIG_WINCE 1" >> $TMPH
ac44871c
GB
1962 echo "#ifndef __MINGW32__" >> $TMPH
1963 echo "#define __MINGW32__ 1" >> $TMPH
1964 echo "#endif" >> $TMPH
1965fi
1966
f3ec2d46
SG
1967if test "$os2" = "yes" ; then
1968 echo "#define CONFIG_OS2 1" >> $TMPH
2450cff2
FR
1969fi
1970
b2828252 1971if test "$targetos" = "Darwin"; then
90cee0c3 1972 echo "#define CONFIG_DARWIN 1" >> $TMPH
90cee0c3
MN
1973fi
1974
c13e1abd
FH
1975echo "#define restrict $_restrict" >> $TMPH
1976
bb801c97
MN
1977if test "$optimize" = "small"; then
1978 echo "#define always_inline" >> $TMPH
e5f28e8f 1979 echo "#define CONFIG_SMALL 1" >> $TMPH
bb801c97
MN
1980fi
1981
997baf01
MR
1982echo "SRC_PATH=\"$source_path\"" >> config.mak
1983echo "SRC_PATH_BARE=$source_path" >> config.mak
1984echo "BUILD_ROOT=\"$PWD\"" >> config.mak
0f3cb305 1985
2a515c08
TM
1986if test "$amr_if2" = "yes" ; then
1987 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1988fi
1989
8156056e 1990# Apparently it's not possible to portably echo a backslash.
4454dc1b 1991if test "$asmalign_pot" = "yes" ; then
8156056e 1992 printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH
4454dc1b 1993else
8156056e 1994 printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
4454dc1b
JD
1995fi
1996
bc634f6f 1997
55006fc0 1998for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do
44161118 1999 ucname="`toupper $codec`"
a8d04fba
MR
2000 config_name="CONFIG_$ucname"
2001 enabled_name="ENABLE_$ucname"
2002 if enabled $codec; then
2003 echo "#define $config_name 1" >> $TMPH
2004 echo "#define $enabled_name 1" >> $TMPH
2005 echo "$config_name=yes" >> config.mak
2006 else
2007 echo "#define $enabled_name 0" >> $TMPH
2008 fi
009cf97d
MN
2009done
2010
9cb2cf10 2011# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
c683a5d1 2012if ! cmp -s $TMPH config.h; then
9cb2cf10
DB
2013 mv -f $TMPH config.h
2014else
2015 echo "config.h is unchanged"
2016fi
3d204385 2017
f3ec2d46 2018rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
def4272a 2019
165af439
MR
2020# build tree in object directory if source path is different from current one
2021if test "$source_path_used" = "yes" ; then
2022 DIRS="\
2023 doc \
2024 libavformat \
2025 libavcodec \
2026 libavcodec/alpha \
2027 libavcodec/armv4l \
2028 libavcodec/bfin \
2029 libavcodec/i386 \
2030 libavcodec/sparc \
2031 libavcodec/mlib \
2032 libavcodec/ppc \
2033 libavcodec/liba52 \
2034 libpostproc \
2035 libavutil \
2036 libswscale \
2037 tests \
2038 vhook \
2039 "
2040 FILES="\
2041 Makefile \
2042 common.mak \
2043 libavformat/Makefile \
2044 libavcodec/Makefile \
2045 libpostproc/Makefile \
2046 libavutil/Makefile \
2047 libswscale/Makefile \
2048 tests/Makefile \
2049 vhook/Makefile \
2050 doc/Makefile \
2051 doc/texi2pod.pl \
2052 "
2053 for dir in $DIRS ; do
2054 mkdir -p $dir
2055 done
2056 for f in $FILES ; do
2057 ln -sf "$source_path/$f" $f
2058 done
2059fi
def4272a 2060
29799f8b 2061# build pkg-config files libav*.pc and libpostproc.pc
31abdc45 2062# libavutil.pc
2063cat <<EOF >libavutil.pc
2266e085 2064prefix=$PREFIX
a94e666c 2065exec_prefix=\${prefix}
31abdc45 2066libdir=\${exec_prefix}/lib
a94e666c 2067includedir=\${prefix}/include
31abdc45 2068
2069Name: libavutil
2070Description: FFmpeg utility library
2071Version: $lavu_version
115329f1 2072Requires:
31abdc45 2073Conflicts:
2074Libs: -L\${libdir} -lavutil
2075Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2076EOF
2077
2078cat <<EOF >libavutil-uninstalled.pc
2079prefix=
2080exec_prefix=
2081libdir=\${pcfiledir}/libavutil
2082includedir=\${pcfiledir}/libavutil
2083
2084Name: libavutil
2085Description: FFmpeg utility library
2086Version: $lavu_version
115329f1 2087Requires:
31abdc45 2088Conflicts:
2089Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
2090Cflags: -I\${includedir}
2091EOF
def4272a
AJ
2092
2093# libavcodec.pc
2094cat <<EOF >libavcodec.pc
2266e085 2095prefix=$PREFIX
a94e666c 2096exec_prefix=\${prefix}
def4272a 2097libdir=\${exec_prefix}/lib
a94e666c 2098includedir=\${prefix}/include
def4272a
AJ
2099
2100Name: libavcodec
2101Description: FFmpeg codec library
31abdc45 2102Version: $lavc_version
c99dd233 2103Requires: $pkg_requires libavutil = $lavu_version
def4272a
AJ
2104Conflicts:
2105Libs: -L\${libdir} -lavcodec $extralibs
2106Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2107EOF
2108
2109cat <<EOF >libavcodec-uninstalled.pc
2110prefix=
2111exec_prefix=
2112libdir=\${pcfiledir}/libavcodec
2113includedir=\${pcfiledir}/libavcodec
2114
2115Name: libavcodec
2116Description: FFmpeg codec library
31abdc45 2117Version: $lavc_version
c99dd233 2118Requires: $pkg_requires libavutil = $lavu_version
def4272a
AJ
2119Conflicts:
2120Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
2121Cflags: -I\${includedir}
2122EOF
2123
2124# libavformat.pc
2125cat <<EOF >libavformat.pc
2266e085 2126prefix=$PREFIX
a94e666c 2127exec_prefix=\${prefix}
def4272a 2128libdir=\${exec_prefix}/lib
a94e666c 2129includedir=\${prefix}/include
def4272a
AJ
2130
2131Name: libavformat
2132Description: FFmpeg container format library
31abdc45 2133Version: $lavf_version
c99dd233 2134Requires: $pkg_requires libavcodec = $lavc_version
def4272a
AJ
2135Conflicts:
2136Libs: -L\${libdir} -lavformat $extralibs
2137Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2138EOF
2139
2140cat <<EOF >libavformat-uninstalled.pc
2141prefix=
2142exec_prefix=
2143libdir=\${pcfiledir}/libavformat
2144includedir=\${pcfiledir}/libavformat
2145
2146Name: libavformat
2147Description: FFmpeg container format library
31abdc45 2148Version: $lavf_version
c99dd233 2149Requires: $pkg_requires libavcodec = $lavc_version
def4272a
AJ
2150Conflicts:
2151Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
2152Cflags: -I\${includedir}
2153EOF
2154
2155
2156# libpostproc.pc
2157cat <<EOF >libpostproc.pc
2266e085 2158prefix=$PREFIX
a94e666c 2159exec_prefix=\${prefix}
def4272a 2160libdir=\${exec_prefix}/lib
a94e666c 2161includedir=\${prefix}/include
def4272a
AJ
2162
2163Name: libpostproc
2164Description: FFmpeg post processing library
31abdc45 2165Version: $lavc_version
115329f1 2166Requires:
def4272a
AJ
2167Conflicts:
2168Libs: -L\${libdir} -lpostproc
2169Cflags: -I\${includedir} -I\${includedir}/postproc
2170EOF
2171
2172cat <<EOF >libpostproc-uninstalled.pc
2173prefix=
2174exec_prefix=
6d9a2421
DB
2175libdir=\${pcfiledir}/libpostproc
2176includedir=\${pcfiledir}/libpostproc
def4272a
AJ
2177
2178Name: libpostproc
2179Description: FFmpeg post processing library
31abdc45 2180Version: $lavc_version
115329f1 2181Requires:
def4272a
AJ
2182Conflicts:
2183Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
2184Cflags: -I\${includedir}
2185EOF
790c9ca7 2186
6c0d0413 2187if test "$swscaler" != "no"; then
2188 sws_pc_libs="-L\${libdir} -lswscale"
2189 sws_pc_uninstalled_libs="\${libdir}/${LIBPREF}swscale${LIBSUF}"
2190 sws_pc_requires="$pkg_requires libavutil = $lavu_version"
2191else
2192 sws_pc_libs=""
2193 sws_pc_uninstalled_libs=""
2194 sws_pc_requires="$pkg_requires libavcodec = $lavc_version"
2195fi
790c9ca7
LA
2196# libswscale.pc
2197cat <<EOF >libswscale.pc
2198prefix=$PREFIX
2199exec_prefix=\${prefix}
2200libdir=\${exec_prefix}/lib
2201includedir=\${prefix}/include
2202
2203Name: libswscale
2204Description: FFmpeg image rescaling library
2205Version: $sws_version
6c0d0413 2206Requires: $sws_pc_requires
790c9ca7 2207Conflicts:
6c0d0413 2208Libs: $sws_pc_libs
790c9ca7
LA
2209Cflags: -I\${includedir} -I\${includedir}/swscale
2210EOF
2211
2212cat <<EOF >libswscale-uninstalled.pc
2213prefix=
2214exec_prefix=
2215libdir=\${pcfiledir}/libswscale
2216includedir=\${pcfiledir}/libswscale
2217
2218Name: libswscale
2219Description: FFmpeg image rescaling library
2220Version: $sws_version
6c0d0413 2221Requires: $sws_pc_requires
790c9ca7 2222Conflicts:
6c0d0413 2223Libs: $sws_pc_uninstalled_libs
790c9ca7
LA
2224Cflags: -I\${includedir}
2225EOF