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