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