Add input and output devices to configure output.
[libav.git] / configure
CommitLineData
aeb29222 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 63 echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]"
4ca5ece5 64 echo " --mandir=DIR install man page in DIR [PREFIX/share/man]"
74c53c2d
MR
65 echo " --enable-static build static libraries [default=yes]"
66 echo " --disable-static do not build static libraries [default=no]"
67 echo " --enable-shared build shared libraries [default=no]"
68 echo " --disable-shared do not build shared libraries [default=yes]"
0a622b98
MR
69 echo " --enable-gpl allow use of GPL code, the resulting libav*"
70 echo " and ffmpeg will be under GPL [default=no]"
dc922953
DB
71 echo " --enable-pp enable GPLed postprocessing support [default=no]"
72 echo " --enable-swscaler software scaler support [default=no]"
e5f94c2b 73 echo " --enable-beosthreads use BeOS threads [default=no]"
d22e8442 74 echo " --enable-os2threads use OS/2 threads [default=no]"
74c53c2d 75 echo " --enable-pthreads use pthreads [default=no]"
eb113804 76 echo " --enable-w32threads use Win32 threads [default=no]"
56a059ac 77 echo " --enable-x11grab enable X11 grabbing [default=no]"
0a622b98
MR
78 echo
79 echo "External library support:"
80 echo " --enable-sunmlib use Sun medialib [default=no]"
e2745046
MR
81 echo " --enable-liba52 enable GPLed liba52 support [default=no]"
82 echo " --enable-liba52bin open liba52.so.0 at runtime [default=no]"
8ac17293 83 echo " --enable-avisynth allow reading AVISynth script files [default=no]"
f5a756ef
DB
84 echo " --enable-libamr-nb enable libamr-nb floating point audio codec"
85 echo " --enable-libamr-wb enable libamr-wb floating point audio codec"
f7b8bffe
RP
86 echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394"
87 echo " and libraw1394 [default=no]"
e2745046
MR
88 echo " --enable-libfaac enable FAAC support via libfaac [default=no]"
89 echo " --enable-libfaad enable FAAD support via libfaad [default=no]"
06f32b26 90 echo " --enable-libfaadbin open libfaad.so.0 at runtime [default=no]"
dc922953 91 echo " --enable-libgsm enable GSM support via libgsm [default=no]"
e2745046 92 echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [default=no]"
31235134
DB
93 echo " --enable-libnut enable NUT (de)muxing via libnut,"
94 echo " native demuxer exists [default=no]"
71757822 95 echo " --enable-libtheora enable Theora encoding via libtheora [default=no]"
f9def9cc
DB
96 echo " --enable-libvorbis enable Vorbis encoding via libvorbis,"
97 echo " native implementation exists [default=no]"
1cc60c47
DB
98 echo " --enable-libx264 enable H.264 encoding via x264 [default=no]"
99 echo " --enable-libxvid enable Xvid encoding via xvidcore,"
31235134 100 echo " native MPEG-4/Xvid encoder exists [default=no]"
74c53c2d
MR
101 echo ""
102 echo "Advanced options (experts only):"
103 echo " --source-path=PATH path to source code [$source_path]"
104 echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
fac252f9 105 echo " --cross-compile assume a cross-compiler is used"
abcd6d60 106 echo " --target-os=OS compiler targets OS [$targetos]"
74c53c2d
MR
107 echo " --cc=CC use C compiler CC [$cc]"
108 echo " --make=MAKE use specified make [$make]"
109 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
110 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
111 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
112 echo " --build-suffix=SUFFIX suffix for application specific build []"
cc6a90dd 113 echo " --arch=ARCH select architecture [$arch]"
7c758d33
DB
114 echo " --cpu=CPU selects the minimum cpu required (affects"
115 echo " instruction selection, may crash on older CPUs)"
2b4c3615 116 echo " --enable-powerpc-perf enable performance report on PPC"
74c53c2d
MR
117 echo " (requires enabling PMC)"
118 echo " --disable-mmx disable MMX usage"
1839e854 119 echo " --disable-armv5te disable armv5te usage"
edab3048 120 echo " --disable-armv6 disable armv6 usage"
74c53c2d
MR
121 echo " --disable-iwmmxt disable iwmmxt usage"
122 echo " --disable-altivec disable AltiVec usage"
74c53c2d 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 126 echo " --disable-vhook disable video hooking support"
74c53c2d 127 echo " --disable-debug disable debugging symbols"
74c53c2d
MR
128 echo " --disable-mpegaudio-hp faster (but less accurate)"
129 echo " MPEG audio decoding [default=no]"
cde9e780 130 echo " --enable-gray enable full grayscale support (slower color)"
786b30af 131 echo " --disable-ffmpeg disable ffmpeg build"
74c53c2d
MR
132 echo " --disable-ffserver disable ffserver build"
133 echo " --disable-ffplay disable ffplay build"
134 echo " --enable-small optimize for size instead of speed"
135 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
74c53c2d
MR
136 echo " --disable-encoder=NAME disables encoder NAME"
137 echo " --enable-encoder=NAME enables encoder NAME"
138 echo " --disable-decoder=NAME disables decoder NAME"
139 echo " --enable-decoder=NAME enables decoder NAME"
140 echo " --disable-encoders disables all encoders"
141 echo " --disable-decoders disables all decoders"
ff70e601
MR
142 echo " --disable-muxer=NAME disables muxer NAME"
143 echo " --enable-muxer=NAME enables muxer NAME"
74c53c2d 144 echo " --disable-muxers disables all muxers"
ff70e601
MR
145 echo " --disable-demuxer=NAME disables demuxer NAME"
146 echo " --enable-demuxer=NAME enables demuxer NAME"
74c53c2d 147 echo " --disable-demuxers disables all demuxers"
af9e7d18
MR
148 echo " --enable-parser=NAME enables parser NAME"
149 echo " --disable-parser=NAME disables parser NAME"
150 echo " --disable-parsers disables all parsers"
cd61e407
JM
151 echo " --enable-bsf=NAME enables bitstream filter NAME"
152 echo " --disable-bsf=NAME disables bitstream filter NAME"
153 echo " --disable-bsfs disables all bitstream filters"
c08fb000
AB
154 echo " --enable-protocol=NAME enables protocol NAME"
155 echo " --disable-protocol=NAME disables protocol NAME"
156 echo " --disable-protocols disables all protocols"
794f8e97
PI
157 echo " --list-decoders show all available decoders"
158 echo " --list-encoders show all available encoders"
159 echo " --list-muxers show all available muxers"
160 echo " --list-demuxers show all available demuxers"
161 echo " --list-parsers show all available parsers"
162 echo " --list-protocols show all available protocols"
163 echo " --list-bsfs show all available bitstream filters"
0a622b98
MR
164 echo
165 echo "Developer options (useful when working on FFmpeg itself):"
166 echo " --enable-gprof enable profiling with gprof [$gprof]"
d2bbb2f7 167 echo " --disable-optimizations disable compiler optimizations"
0a622b98
MR
168 echo " --enable-extra-warnings enable more compiler warnings"
169 echo " --disable-strip disable stripping of executables and shared libraries"
74c53c2d
MR
170 echo ""
171 echo "NOTE: Object files are built at the place where configure is launched."
172 exit 1
173}
cf9d24ad 174
57bd82d4
MR
175log(){
176 echo "$@" >>$logfile
177}
178
720c69da 179log_file(){
c8e9f801 180 log BEGIN $1
6b324648 181 pr -n -t $1 >>$logfile
c8e9f801
MR
182 log END $1
183}
184
2ba042a7 185echolog(){
c8e9f801 186 log "$@"
57bd82d4 187 echo "$@"
2ba042a7
MR
188}
189
190die(){
191 echolog "$@"
192 cat <<EOF
193If you think configure made a mistake, make sure you are using the latest
194version from SVN. If the latest version fails, report the problem to the
195ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
196EOF
720c69da 197 if enabled logging; then
2ba042a7
MR
198 cat <<EOF
199Include the log file "$logfile" produced by configure as this will help
200solving the problem.
201EOF
202 else
203cat <<EOF
204Rerun configure with logging enabled (do not use --log=no), and include the
205log this produces with your report.
206EOF
207 fi
57bd82d4
MR
208 rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
209 exit 1
210}
211
904e48f1 212# "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
44161118
MR
213toupper(){
214 echo "$@" | tr '[a-z]' '[A-Z]'
215}
216
4a5444db
MR
217tolower(){
218 echo "$@" | tr '[A-Z]' '[a-z]'
219}
220
a8d04fba
MR
221set_all(){
222 value=$1
223 shift
224 for var in $*; do
225 eval $var=$value
226 done
227}
228
799c9e9b
MR
229pushvar(){
230 for var in $*; do
231 eval level=\${${var}_level:=0}
232 eval ${var}_${level}="\$$var"
233 eval ${var}_level=$(($level+1))
234 done
235}
236
237popvar(){
238 for var in $*; do
239 eval level=\${${var}_level:-0}
240 test $level = 0 && continue
241 eval level=$(($level-1))
242 eval $var="\${${var}_${level}}"
243 eval ${var}_level=$level
244 eval unset ${var}_${level}
245 done
246}
247
a8d04fba
MR
248enable(){
249 set_all yes $*
250}
251
252disable(){
253 set_all no $*
254}
255
57bd82d4 256enabled(){
44161118
MR
257 eval test "x\$$1" = "xyes"
258}
259
37970ebf
RP
260disabled(){
261 eval test "x\$$1" = "xno"
262}
263
44161118
MR
264enabled_all(){
265 for opt; do
266 enabled $opt || return 1
267 done
268}
269
85bca2c5
DB
270disabled_all(){
271 for opt; do
272 disabled $opt || return 1
273 done
274}
275
44161118
MR
276enabled_any(){
277 for opt; do
278 enabled $opt && return 0
279 done
280}
281
85bca2c5
DB
282disabled_any(){
283 for opt; do
284 disabled $opt && return 0
285 done
286}
287
4a0d6686
AJ
288is_in(){
289 value=$1
290 shift
291 for var in $*; do
292 [ $var = $value ] && return 0
293 done
294 return 1
295}
296
30fd06be
MR
297check_deps(){
298 for cfg; do
799c9e9b
MR
299 enabled ${cfg}_checking && die "Circular dependency for $cfg."
300 disabled ${cfg}_checking && continue
301 enable ${cfg}_checking
302
30fd06be
MR
303 eval dep_all="\$${cfg}_deps"
304 eval dep_any="\$${cfg}_deps_any"
799c9e9b
MR
305
306 pushvar cfg dep_all dep_any
307 check_deps $dep_all $dep_any
308 popvar cfg dep_all dep_any
309
30fd06be
MR
310 enabled_all $dep_all || disable $cfg
311 enabled_any $dep_any || disable $cfg
799c9e9b 312
4ec45764
RP
313 if enabled $cfg; then
314 eval dep_extralibs="\$${cfg}_extralibs"
315 test -n "$dep_extralibs" && add_extralibs $dep_extralibs
316 fi
317
799c9e9b 318 disable ${cfg}_checking
30fd06be
MR
319 done
320}
321
44161118
MR
322print_config(){
323 pfx=$1
324 header=$2
325 makefile=$3
326 shift 3
327 for cfg; do
3d907e22 328 ucname="`toupper $cfg`"
44161118 329 if enabled $cfg; then
3d907e22
MR
330 echo "#define ${pfx}${ucname} 1" >> $header
331 echo "#define ENABLE_${ucname} 1" >> $header
332 echo "${pfx}${ucname}=yes" >> $makefile
333 else
334 echo "#define ENABLE_${ucname} 0" >> $header
44161118
MR
335 fi
336 done
57bd82d4
MR
337}
338
339flags_saved(){
340 (: ${SAVE_CFLAGS?}) 2>/dev/null
341}
342
dcd479c0 343save_flags(){
57bd82d4 344 flags_saved && return
dcd479c0
MR
345 SAVE_CFLAGS="$CFLAGS"
346 SAVE_LDFLAGS="$LDFLAGS"
347 SAVE_extralibs="$extralibs"
348}
349
350restore_flags(){
f5d28d10 351 flags_saved || return
dcd479c0
MR
352 CFLAGS="$SAVE_CFLAGS"
353 LDFLAGS="$SAVE_LDFLAGS"
354 extralibs="$SAVE_extralibs"
355 unset SAVE_CFLAGS
356 unset SAVE_LDFLAGS
357 unset SAVE_extralibs
358}
359
360temp_cflags(){
361 save_flags
362 CFLAGS="$CFLAGS $*"
363}
364
365temp_ldflags(){
366 save_flags
367 LDFLAGS="$LDFLAGS $*"
368}
369
370temp_extralibs(){
371 save_flags
372 extralibs="$extralibs $*"
373}
374
57bd82d4
MR
375append(){
376 var=$1
377 shift
378 flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
379 eval "$var=\"\$$var $*\""
380}
381
382add_cflags(){
383 append CFLAGS "$@"
384}
385
386add_ldflags(){
387 append LDFLAGS "$@"
388}
389
390add_extralibs(){
391 append extralibs "$@"
392}
393
b0cfb663 394check_cmd(){
b3cb5d51 395 log "$@"
9b4f605c 396 "$@" >>$logfile 2>&1
b0cfb663
MR
397}
398
dcd479c0 399check_cc(){
57bd82d4
MR
400 log check_cc "$@"
401 cat >$TMPC
720c69da 402 log_file $TMPC
b0cfb663 403 check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
57bd82d4
MR
404}
405
406check_cpp(){
407 log check_cpp "$@"
dcd479c0 408 cat >$TMPC
720c69da 409 log_file $TMPC
b0cfb663 410 check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
dcd479c0
MR
411}
412
940f335a
MR
413check_asm(){
414 log check_asm "$@"
415 name="$1"
416 asm="$2"
417 shift 2
418 check_cc "$@" <<EOF && enable $name || disable $name
419int foo(void){
420 asm volatile($asm);
421}
422EOF
423}
424
dcd479c0 425check_ld(){
57bd82d4 426 log check_ld "$@"
0607887f 427 check_cc || return
3155a644
MR
428 flags=''
429 libs=''
430 for f; do
431 test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
432 done
433 check_cmd $cc $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
dcd479c0
MR
434}
435
436check_cflags(){
57bd82d4
MR
437 log check_cflags "$@"
438 check_cc "$@" <<EOF && add_cflags "$@"
dcd479c0
MR
439int x;
440EOF
441}
442
443check_ldflags(){
57bd82d4
MR
444 log check_ldflags "$@"
445 check_ld "$@" <<EOF && add_ldflags "$@"
e5af4a11 446int main(void){
57bd82d4
MR
447 return 0;
448}
dcd479c0
MR
449EOF
450}
451
452check_header(){
57bd82d4 453 log check_header "$@"
dcd479c0
MR
454 header=$1
455 shift
d8bc5f06
MR
456 var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
457 disable $var
458 check_cpp "$@" <<EOF && enable $var
dcd479c0
MR
459#include <$header>
460int x;
461EOF
462}
463
464check_func(){
57bd82d4 465 log check_func "$@"
dcd479c0
MR
466 func=$1
467 shift
d8bc5f06
MR
468 disable $func
469 check_ld "$@" <<EOF && enable $func
dcd479c0 470extern int $func();
e5af4a11 471int main(void){
dcd479c0
MR
472 $func();
473}
474EOF
475}
476
f8d7b072
MR
477check_func2(){
478 log check_func2 "$@"
479 headers=$1
480 func=$2
481 shift 2
482 disable $func
483 incs=""
484 for hdr in $headers; do
485 incs="$incs
486#include <$hdr>"
487 done
488 check_ld "$@" <<EOF && enable $func
489$incs
e5af4a11 490int main(void){
f8d7b072
MR
491 (void) $func;
492 return 0;
493}
494EOF
495}
496
57bd82d4
MR
497check_lib(){
498 log check_lib "$@"
499 header="$1"
500 func="$2"
501 shift 2
fcfcde17
MR
502 temp_extralibs "$@"
503 check_header $header && check_func $func && add_extralibs "$@"
504 err=$?
505 restore_flags
506 return $err
57bd82d4
MR
507}
508
f8d7b072
MR
509check_lib2(){
510 log check_lib2 "$@"
511 headers="$1"
512 func="$2"
513 shift 2
514 temp_extralibs "$@"
515 check_func2 "$headers" $func && add_extralibs "$@"
516 err=$?
517 restore_flags
518 return $err
519}
520
dcd479c0 521check_exec(){
90be59ef 522 check_ld "$@" && { enabled cross_compile || $TMPE >>$logfile 2>&1; }
57bd82d4
MR
523}
524
7dfef245
MR
525check_exec_crash(){
526 code=`cat`
527
528 # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
529 # are safe but may not be available everywhere. Thus we use
530 # raise(SIGTERM) instead. The check is run in a subshell so we
531 # can redirect the "Terminated" message from the shell. SIGBUS
532 # is not defined by standard C so it is used conditionally.
533
534 (check_exec "$@") >>$logfile 2>&1 <<EOF
535#include <signal.h>
536static void sighandler(int sig){
537 raise(SIGTERM);
538}
e5af4a11 539int main(void){
7dfef245
MR
540 signal(SIGILL, sighandler);
541 signal(SIGFPE, sighandler);
542 signal(SIGSEGV, sighandler);
543#ifdef SIGBUS
544 signal(SIGBUS, sighandler);
545#endif
546 { $code }
547}
548EOF
549}
550
57bd82d4
MR
551require(){
552 name="$1"
553 header="$2"
554 func="$3"
555 shift 3
556 check_lib $header $func "$@" || die "ERROR: $name not found"
dcd479c0
MR
557}
558
f8d7b072
MR
559require2(){
560 name="$1"
561 headers="$2"
562 func="$3"
563 shift 3
564 check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
565}
566
eea50282
MR
567check_foo_config(){
568 cfg=$1
569 pkg=$2
570 header=$3
571 func=$4
572 shift 4
573 disable $cfg
574 check_cmd ${pkg}-config --version
575 err=$?
576 if test "$err" = 0; then
577 temp_cflags `${pkg}-config --cflags`
578 temp_extralibs `${pkg}-config --libs`
579 check_lib "$@" $header $func && enable $cfg
580 fi
581 return $err
582}
583
c505dd31
MR
584apply(){
585 file=$1
586 shift
587 "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
588}
589
4a0d6686
AJ
590COMPONENT_LIST="
591 bsfs
592 decoders
593 demuxers
594 encoders
595 muxers
596 parsers
597 protocols
598"
599
600CONFIG_LIST="
601 $COMPONENT_LIST
c88f5d72
MR
602 avisynth
603 beos_netserver
c88f5d72
MR
604 ffmpeg
605 ffplay
606 ffserver
607 gpl
ecfc4f44 608 gprof
d8d0d0b2 609 gray
c88f5d72 610 ipv6
7bc5f2a8 611 liba52
f8904fd9 612 liba52bin
f5a756ef
DB
613 libamr
614 libamr_nb
615 libamr_wb
f7b8bffe 616 libdc1394
2eed5a46
DB
617 libfaac
618 libfaad
619 libfaadbin
c88f5d72 620 libgsm
6ebe07fb 621 libmp3lame
c88f5d72 622 libnut
150d2772 623 libtheora
c88f5d72 624 libvorbis
1cc60c47
DB
625 libx264
626 libxvid
c88f5d72 627 memalign_hack
c88f5d72
MR
628 mpegaudio_hp
629 network
2b4c3615 630 powerpc_perf
c88f5d72 631 pp
bd2216e4 632 small
c88f5d72
MR
633 swscaler
634 vhook
56a059ac 635 x11grab
c88f5d72 636 zlib
4a0d6686 637"
c88f5d72 638
8eee7025
DB
639THREADS_LIST='
640 beosthreads
d22e8442 641 os2threads
8eee7025
DB
642 pthreads
643 w32threads
644'
645
3f5b56e5
MR
646ARCH_LIST='
647 alpha
648 armv4l
649 bfin
650 ia64
651 m68k
652 mips
653 parisc
654 powerpc
655 s390
656 sh4
657 sparc
658 sparc64
659 x86
660 x86_32
661 x86_64
662'
663
664ARCH_EXT_LIST='
1ac9331a 665 altivec
1ac9331a 666 armv5te
edab3048 667 armv6
3f5b56e5
MR
668 iwmmxt
669 mmi
670 mmx
9eeed841 671 ssse3
bd9d34a0 672 vis
3f5b56e5
MR
673'
674
675HAVE_LIST="
676 $ARCH_EXT_LIST
677 $THREADS_LIST
678 altivec_h
c9fdab0d 679 arpa_inet_h
c88f5d72 680 byteswap_h
ecf97f22 681 closesocket
1ac9331a 682 cmov
e16e49ac 683 conio_h
c88f5d72 684 dcbzl
f8aa696f
DB
685 dev_bktr_ioctl_bt848_h
686 dev_bktr_ioctl_meteor_h
687 dev_ic_bt8xx_h
688 dev_video_meteor_ioctl_meteor_h
689 dev_video_bktr_ioctl_bt848_h
18b67ae5 690 dlfcn_h
c88f5d72 691 dlopen
245626d0
DB
692 ebp_available
693 ebx_available
c2a29455 694 fast_64bit
7073e9fc 695 fast_cmov
7b829d2a 696 fast_unaligned
9d99cc5a 697 fork
c88f5d72 698 freetype2
da9e86f8 699 gethrtime
4e68cb8a 700 GetProcessTimes
66be5b45 701 getrusage
c88f5d72 702 imlib2
2e1913b1 703 inet_aton
c88f5d72 704 lrintf
f8aa696f
DB
705 machine_ioctl_bt848_h
706 machine_ioctl_meteor_h
c88f5d72
MR
707 malloc_h
708 memalign
6ffa87d3 709 mkstemp
c88f5d72 710 mlib
9cafbd6c 711 ppc64
c88f5d72
MR
712 sdl
713 sdl_video_size
deb29777 714 soundcard_h
b0c858d8 715 sys_poll_h
deb29777 716 sys_soundcard_h
e16e49ac 717 termios_h
b265431e 718 threads
6ff3f3e7 719 winsock2_h
0cb78cef 720"
44161118 721
520cc7f1 722CMDLINE_SELECT="
3f5b56e5 723 $ARCH_EXT_LIST
520cc7f1 724 $CONFIG_LIST
8eee7025 725 $THREADS_LIST
520cc7f1
MR
726 debug
727 extra_warnings
d2bbb2f7 728 optimizations
520cc7f1
MR
729 shared
730 static
731"
732
912f3148
DB
733# code dependency declarations
734
9eeed841
MR
735# architecture extensions
736altivec_deps="powerpc"
737armv5te_deps="armv4l"
738armv6_deps="armv4l"
739iwmmxt_deps="armv4l"
e241ba14 740mmi_deps="mips"
9eeed841
MR
741mmx_deps="x86"
742ssse3_deps="x86"
bd9d34a0 743vis_deps="sparc"
9eeed841 744
912f3148 745# decoders / encoders
6ea67bbb 746ac3_decoder_deps="gpl"
33a0dd37 747dxa_decoder_deps="zlib"
30fd06be 748flashsv_decoder_deps="zlib"
773be23a 749flashsv_encoder_deps="zlib"
4a815a7f 750flv_decoder_deps="h263_decoder"
df495dbd 751h263_decoder_deps="h263_parser mpeg4video_parser"
4a815a7f 752h263i_decoder_deps="h263_decoder"
26b4fe82 753h264_decoder_deps="h264_parser"
30fd06be 754mpeg_xvmc_decoder_deps="xvmc"
4a815a7f
DB
755mpeg4_decoder_deps="h263_decoder"
756msmpeg4v1_decoder_deps="h263_decoder"
757msmpeg4v2_decoder_deps="h263_decoder"
758msmpeg4v3_decoder_deps="h263_decoder"
30fd06be
MR
759png_decoder_deps="zlib"
760png_encoder_deps="zlib"
e2525c6f 761svq3_decoder_deps="h264_parser"
4a815a7f
DB
762vc1_decoder_deps="h263_decoder"
763wmv1_decoder_deps="h263_decoder"
764wmv2_decoder_deps="h263_decoder"
765wmv3_decoder_deps="h263_decoder"
30fd06be
MR
766zmbv_decoder_deps="zlib"
767zmbv_encoder_deps="zlib"
768
912f3148 769# external libraries
7bc5f2a8 770liba52_decoder_deps="liba52"
4ec45764 771liba52bin_decoder_extralibs='$ldl'
f5a756ef
DB
772libamr_nb_decoder_deps="libamr_nb"
773libamr_nb_encoder_deps="libamr_nb"
774libamr_wb_decoder_deps="libamr_wb"
775libamr_wb_encoder_deps="libamr_wb"
c9171a83 776libfaac_encoder_deps="libfaac"
69ddbd1d 777libfaad_decoder_deps="libfaad"
4ec45764 778libfaadbin_decoder_extralibs='$ldl'
299c77d5
MR
779libgsm_decoder_deps="libgsm"
780libgsm_encoder_deps="libgsm"
8ffed8d8
MR
781libgsm_ms_decoder_deps="libgsm"
782libgsm_ms_encoder_deps="libgsm"
1cc60c47 783libmp3lame_encoder_deps="libmp3lame"
150d2772 784libtheora_encoder_deps="libtheora"
b0caf888 785libvorbis_encoder_deps="libvorbis"
1cc60c47
DB
786libx264_encoder_deps="libx264"
787libxvid_encoder_deps="libxvid"
13566c31 788mpeg4aac_decoder_deps="libfaad"
30fd06be 789
912f3148 790# demuxers / muxers
03a76ba9 791ac3_demuxer_deps="ac3_parser"
50383e88 792audio_beos_demuxer_deps="audio_beos"
4ec45764 793audio_beos_demuxer_extralibs="-lmedia -lbe"
50383e88 794audio_beos_muxer_deps="audio_beos"
4ec45764 795audio_beos_muxer_extralibs="-lmedia -lbe"
53b73365 796avisynth_demuxer_deps="avisynth"
73483024 797bktr_demuxer_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
30fd06be 798dv1394_demuxer_deps="dv1394"
f7b8bffe 799libdc1394_demuxer_deps="libdc1394"
d7c59247
DB
800libnut_demuxer_deps="libnut"
801libnut_muxer_deps="libnut"
4bd8e17c 802mp3_demuxer_deps="mpegaudio_parser"
c7682de0
RP
803oss_demuxer_deps_any="soundcard_h sys_soundcard_h"
804oss_muxer_deps_any="soundcard_h sys_soundcard_h"
30fd06be 805redir_demuxer_deps="network"
47b515bf 806rtp_muxer_deps="network mpegts_demuxer"
c08fb000
AB
807rtsp_demuxer_deps="rtp_protocol rtp_muxer"
808sdp_demuxer_deps="rtsp_demuxer"
06e31011
RP
809v4l2_demuxer_deps="linux_videodev2_h"
810v4l_demuxer_deps="linux_videodev_h"
06eab4ba 811x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
4ec45764 812x11_grab_device_demuxer_extralibs="-lX11 -lXext"
30fd06be 813
912f3148 814# protocols
c08fb000
AB
815http_protocol_deps="network"
816rtp_protocol_deps="udp_protocol"
817tcp_protocol_deps="network"
818udp_protocol_deps="network"
819
912f3148 820# programs
fa859b4d 821ffplay_deps="sdl"
6ad42348 822ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
4ec45764
RP
823ffserver_extralibs='$ldl'
824vhook_extralibs='$ldl'
a2830dca 825
912f3148 826
0f3cb305 827# set temporary file name
57514323 828if test ! -z "$TMPDIR" ; then
0f3cb305 829 TMPDIR1="${TMPDIR}"
57514323 830elif test ! -z "$TEMPDIR" ; then
0f3cb305 831 TMPDIR1="${TEMPDIR}"
3d204385 832else
0f3cb305 833 TMPDIR1="/tmp"
3d204385
NK
834fi
835
0f3cb305
FB
836TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
837TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
f3ec2d46 838TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
0f3cb305
FB
839TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
840TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
841
de6d9b64 842# default parameters
8a608357 843
497237c7 844enable logging
2ba042a7 845logfile="config.err"
8a608357
MR
846
847# installation paths
2266e085 848PREFIX="/usr/local"
c75560ae 849libdir='$(PREFIX)/lib'
84c22efd 850shlibdir="$libdir"
c75560ae 851incdir='$(PREFIX)/include/ffmpeg'
4ca5ece5 852mandir='$(PREFIX)/share/man'
c75560ae 853bindir='$(PREFIX)/bin'
8a608357
MR
854
855# toolchain
de6d9b64
FB
856cc="gcc"
857ar="ar"
be7109c1 858ranlib="ranlib"
4a908fbc 859make="make"
0f3cb305 860strip="strip"
8a608357 861asmalign_pot="unknown"
20369773 862ln_s="ln -sf"
8a608357
MR
863
864# machine
cc6a90dd 865arch=`uname -m`
38d0a8aa 866cpu="generic"
8a608357 867
8a608357 868# OS
b9663405 869targetos=$(tolower $(uname -s))
8a608357 870
8a608357 871# libraries
497237c7 872enable zlib
8a608357
MR
873
874# configurable options
497237c7
RP
875enable debug
876enable dostrip
877enable ffmpeg
878enable ffplay
879enable ffserver
880enable ipv6
881enable static
882enable mpegaudio_hp
883enable network
8400d6b8 884enable optimizations
497237c7 885enable protocols
8a608357
MR
886vhook="default"
887
8a608357 888# build settings
baa3a937 889SHFLAGS='-shared -Wl,-soname,$@'
cab3ef82 890VHOOKSHFLAGS='$(SHFLAGS)'
e240ee67 891LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
c536cb09 892FFSERVERLDFLAGS=-Wl,-E
f39e56a8 893LDCONFIG="ldconfig"
f3ec2d46
SG
894LIBPREF="lib"
895LIBSUF=".a"
c5f14466
RP
896FULLNAME='$(NAME)$(BUILDSUF)'
897LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
f3ec2d46
SG
898SLIBPREF="lib"
899SLIBSUF=".so"
c5f14466 900SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
b29bddab
DB
901SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
902SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
24743a76 903LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
ef0bc4c9 904
c597172e
MR
905# find source path
906source_path="`dirname \"$0\"`"
497237c7 907enable source_path_used
c597172e
MR
908if test -z "$source_path" -o "$source_path" = "." ; then
909 source_path="`pwd`"
497237c7 910 disable source_path_used
c597172e
MR
911else
912 source_path="`cd \"$source_path\"; pwd`"
913 echo "$source_path" | grep -q '[[:blank:]]' &&
7483e694 914 die "Out of tree builds are impossible with whitespace in source path."
c597172e
MR
915fi
916
c597172e
MR
917FFMPEG_CONFIGURATION="$@"
918
facbea95
AJ
919ENCODER_LIST=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"`
920DECODER_LIST=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"`
921PARSER_LIST=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"`
922BSF_LIST=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' "$source_path/libavcodec/allcodecs.c"`
923MUXER_LIST=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"`
924DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"`
c4035e5d
LA
925OUTDEV_LIST=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavdevice/alldevices.c"`
926INDEV_LIST=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavdevice/alldevices.c"`
facbea95 927PROTOCOL_LIST=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' "$source_path/libavformat/allformats.c"`
c597172e 928
7483e694
DB
929enable $ARCH_EXT_LIST \
930 $DECODER_LIST \
931 $ENCODER_LIST \
932 $PARSER_LIST \
933 $BSF_LIST \
934 $DEMUXER_LIST \
935 $MUXER_LIST \
936 $PROTOCOL_LIST \
937 $INDEV_LIST \
938 $OUTDEV_LIST \
c597172e
MR
939
940die_unknown(){
941 echo "Unknown option \"$1\"."
942 echo "See $0 --help for available options."
943 exit 1
944}
945
794f8e97 946show_list() {
bf0c4afa
RP
947 suffix=_$1
948 shift
949 echo $* | sed s/$suffix//g | tr ' ' '\n' | sort
794f8e97
PI
950 exit 0
951}
952
c597172e 953for opt do
7483e694
DB
954 optval="${opt#*=}"
955 case "$opt" in
956 --log)
957 ;;
958 --log=*) logging="$optval"
959 ;;
960 --prefix=*) PREFIX="$optval"
961 ;;
962 --libdir=*) libdir="$optval"
963 ;;
964 --shlibdir=*) shlibdir="$optval"
965 ;;
966 --incdir=*) incdir="$optval"
967 ;;
968 --mandir=*) mandir="$optval"
969 ;;
970 --source-path=*) source_path="$optval"
971 ;;
972 --cross-prefix=*) cross_prefix="$optval"
973 ;;
974 --cross-compile) enable cross_compile
975 ;;
976 --target-os=*) targetos="$optval"
977 ;;
978 --cc=*) cc="$optval"
979 ;;
980 --make=*) make="$optval"
981 ;;
982 --extra-cflags=*) add_cflags "$optval"
983 ;;
984 --extra-ldflags=*) add_ldflags "$optval"
985 ;;
986 --extra-libs=*) add_extralibs "$optval"
987 ;;
988 --build-suffix=*) BUILDSUF="$optval"
989 ;;
990 --arch=*) arch="$optval"
991 ;;
992 --cpu=*) cpu="$optval"
993 ;;
994 --enable-sunmlib) enable mlib
995 ;;
996 --disable-strip) disable dostrip
997 ;;
998 --disable-encoders) disable $ENCODER_LIST
999 ;;
1000 --disable-decoders) disable $DECODER_LIST
1001 ;;
1002 --disable-muxers) disable $MUXER_LIST
1003 ;;
1004 --disable-demuxers) disable $DEMUXER_LIST
1005 ;;
1006 --disable-parsers) disable $PARSER_LIST
1007 ;;
1008 --disable-bsfs) disable $BSF_LIST
1009 ;;
1010 --disable-protocols) disable $PROTOCOL_LIST
1011 ;;
8fb1cb58 1012 --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
9aa8ed9d 1013 ;;
7483e694
DB
1014 --enable-*=*|--disable-*=*)
1015 eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
1016 case "$thing" in
1017 encoder|decoder|muxer|demuxer|parser|bsf|protocol) $action ${optval}_${thing} ;;
1018 *) die_unknown "$opt" ;;
1019 esac
1020 ;;
1021 --enable-?*|--disable-?*)
1022 eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
1023 echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
1024 $action $option
1025 ;;
1026 --list-*)
1027 NAME="${opt#--list-}"
1028 is_in $NAME $COMPONENT_LIST || die_unknown $opt
1029 NAME=${NAME%s}
1030 eval show_list $NAME \$$(toupper $NAME)_LIST
1031 ;;
1032 --help|-h) show_help
1033 ;;
1034 *)
1035 die_unknown $opt
1036 ;;
1037 esac
c597172e
MR
1038done
1039
270739bb 1040case "$arch" in
7483e694
DB
1041 i386|i486|i586|i686|i86pc|BePC)
1042 arch="x86_32"
1043 enable fast_unaligned
1044 ;;
1045 x86_64|amd64)
1046 arch="x86_32"
1047 enable fast_unaligned
1048 canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
1049 if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
1050 if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
1051 arch="x86_64"
1052 enable fast_64bit
1053 fi
1054 fi
1055 ;;
1056 # armv4l is a subset of armv[567]*l
1057 arm|armv[4567]*l)
1058 arch="armv4l"
1059 ;;
1060 alpha)
1061 arch="alpha"
1062 enable fast_64bit
1063 ;;
1064 "Power Macintosh"|ppc|powerpc)
1065 arch="powerpc"
1066 ;;
1067 ppc64)
1068 arch="powerpc"
c2a29455 1069 enable fast_64bit
d474299a 1070 ;;
7483e694
DB
1071 mips|mipsel|IP*)
1072 arch="mips"
d474299a 1073 ;;
7483e694
DB
1074 sun4u|sparc64)
1075 arch="sparc64"
1076 enable fast_64bit
d474299a 1077 ;;
7483e694
DB
1078 sparc)
1079 arch="sparc"
d474299a 1080 ;;
7483e694
DB
1081 sh4)
1082 arch="sh4"
d474299a 1083 ;;
7483e694
DB
1084 parisc)
1085 arch="parisc"
d474299a 1086 ;;
7483e694
DB
1087 parisc64)
1088 arch="parisc"
1089 enable fast_64bit
d474299a 1090 ;;
7483e694
DB
1091 s390|s390x)
1092 arch="s390"
d474299a 1093 ;;
7483e694
DB
1094 m68k)
1095 arch="m68k"
d474299a 1096 ;;
7483e694
DB
1097 ia64)
1098 arch="ia64"
1099 enable fast_64bit
d474299a 1100 ;;
7483e694
DB
1101 bfin)
1102 arch="bfin"
1103 ;;
1104 *)
1105 arch="unknown"
d474299a 1106 ;;
ef0bc4c9 1107esac
de6d9b64 1108
7483e694
DB
1109enable $arch
1110enabled_any x86_32 x86_64 && enable x86
1111enabled sparc64 && enable sparc
1112
1113# OS specific
1114case $targetos in
1115 beos|haiku|zeta)
1116 PREFIX="$HOME/config"
1117 # helps building libavcodec
1118 add_cflags "-DPIC -fomit-frame-pointer"
1119 # 3 gcc releases known for BeOS, each with ugly bugs
1120 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
1121 case "$gcc_version" in
1122 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
1123 disable mmx
1124 ;;
1125 *20010315*) echo "BeBits gcc"
1126 add_cflags "-fno-expensive-optimizations"
1127 ;;
1128 esac
1129 LDCONFIG="echo ignoring ldconfig"
1130 SHFLAGS=-nostart
1131 # enable BeOS things
1132 enable audio_beos
1133 # no need for libm, but the inet stuff
1134 # Check for BONE
1135 # XXX: actually should check for NOT net_server
1136 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
1137 network_extralibs="-lbind -lsocket"
1138 else
1139 enable beos_netserver
1140 network_extralibs="-lnet"
1141 fi ;;
1142 sunos)
1143 FFSERVERLDFLAGS=""
1144 SHFLAGS='-shared -Wl,-h,$@'
1145 network_extralibs="-lsocket -lnsl"
1146 ;;
1147 netbsd)
1148 oss_demuxer_extralibs="-lossaudio"
1149 oss_muxer_extralibs="-lossaudio"
1150 ;;
1151 openbsd)
1152 disable need_memalign
1153 LIBOBJFLAGS='$(PIC)'
1154 LDCONFIG='ldconfig -m $(SHLIBDIR)'
1155 SHFLAGS='-shared'
1156 SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF).$(LIBVERSION)'
1157 SLIBNAME_WITH_VERSION='$(SLIBNAME)'
1158 SLIBNAME_WITH_MAJOR='$(SLIBNAME)'
1159 oss_demuxer_extralibs="-lossaudio"
1160 oss_muxer_extralibs="-lossaudio"
1161 ;;
1162 freebsd)
1163 disable need_memalign
1164 ;;
1165 bsd/os)
1166 osextralibs="-lpoll -lgnugetopt"
1167 strip="strip -d"
1168 ;;
1169 darwin)
1170 disable need_memalign
1171 SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION) -Wl,-read_only_relocs,suppress'
1172 VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$@'
1173 strip="strip -x"
1174 FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
1175 SLIBSUF=".dylib"
1176 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
1177 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
1178 FFSERVERLDFLAGS=-Wl,-bind_at_load
1179 ;;
1180 mingw32*)
1181 targetos=mingw32
1182 shlibdir="$bindir"
1183 VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
1184 VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
1185 if enabled swscaler; then
1186 VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
1187 VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
1188 fi
1189 disable ffserver
1190 SLIBPREF=""
1191 SLIBSUF=".dll"
1192 EXESUF=".exe"
1193 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
1194 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
1195 SLIB_EXTRA_CMD='-lib /machine:i386 /def:$(@:$(SLIBSUF)=.def)'
1196 SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
1197 SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
1198 SHFLAGS='-shared -Wl,--output-def,$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
1199 ;;
1200 cygwin*)
1201 targetos=cygwin
1202 shlibdir="$bindir"
1203 VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
1204 VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
1205 if enabled swscaler; then
1206 VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
1207 VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
1208 fi
1209 EXESUF=".exe"
1210 SLIBPREF="cyg"
1211 SLIBSUF=".dll"
1212 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
1213 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
1214 SHFLAGS='-shared -Wl,--enable-auto-image-base'
1215 ;;
1216 linux)
1217 LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
1218 enable dv1394
1219 ;;
1220 irix*)
1221 targetos=irix
1222 ranlib="echo ignoring ranlib"
1223 ;;
d22e8442
DY
1224 os/2*)
1225 ar="emxomfar -p256"
1226 ranlib="echo ignoring ranlib"
1227 strip="lxlite"
1228 ln_s="cp -f"
1229 add_cflags "-Zomf"
1230 EXESUF=".exe"
1231 FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
1232 SHFLAGS='$(NAME).def -Zdll -Zomf'
1233 FFSERVERLDFLAGS=""
1234 LIBSUF="_s.lib"
1235 SLIBPREF=""
1236 SLIBSUF=".dll"
1237 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
1238 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
1239 SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(NAME).def; \
1240 echo PROTMODE >> $(NAME).def; \
1241 echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(NAME).def; \
1242 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(NAME).def; \
1243 echo EXPORTS >> $(NAME).def; \
1244 emxexp -o $(OBJS) >> $(NAME).def'
1245 SLIB_EXTRA_CMD='emximp -o $(LIBPREF)$(NAME)_dll.a $(NAME).def; \
1246 emximp -o $(LIBPREF)$(NAME)_dll.lib $(NAME).def;'
1247 SLIB_INSTALL_EXTRA_CMD='install -m 644 $(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
1248 SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
1249 vhook="no"
1250 ;;
1251
7483e694
DB
1252 *)
1253 targetos="${targetos}-UNKNOWN"
1254 ;;
1255esac
1256
c597172e 1257add_extralibs $osextralibs
de6d9b64 1258
e3c00e34 1259if ! disabled logging ; then
90be59ef 1260 enabled logging || logfile="$logging"
57bd82d4
MR
1261 echo "# $0 $@" >$logfile
1262 set >>$logfile
2ba042a7
MR
1263else
1264 logfile=/dev/null
57bd82d4 1265fi
e89b8b0a 1266
28d8e661
DB
1267# Combine FFLDFLAGS and the LDFLAGS environment variable.
1268LDFLAGS="$FFLDFLAGS $LDFLAGS"
e89b8b0a 1269
497237c7 1270test -n "$cross_prefix" && enable cross_compile
1ea46bed
MR
1271cc="${cross_prefix}${cc}"
1272ar="${cross_prefix}${ar}"
1273ranlib="${cross_prefix}${ranlib}"
1274strip="${cross_prefix}${strip}"
1275
320d060a 1276# we need to build at least one lib type
93b3c083 1277if ! enabled_any static shared; then
320d060a
DB
1278 cat <<EOF
1279At least one library type must be built.
1280Specify --enable-static to build the static libraries or --enable-shared to
1281build the shared libraries as well. To only build the shared libraries specify
1282--disable-static in addition to --enable-shared.
1283EOF
1284 exit 1;
1285fi
1286
abc4e572 1287disabled static && LIBNAME=""
2a320695 1288
a2234ceb
RP
1289if enabled_any libfaad libfaadbin ; then
1290 if check_header faad.h; then
1291 check_cc << EOF
1292#include <faad.h>
1293#ifndef FAAD2_VERSION
1294ok faad1
1295#endif
db817cf3 1296int main(void) { return 0; }
a2234ceb
RP
1297EOF
1298 test $? = 0 && enable libfaad2
1299 else
ff3dac65 1300 die "FAAD test failed."
a2234ceb
RP
1301 fi
1302fi
1303
1304
93b3c083 1305if ! enabled gpl; then
54118497
RP
1306 die_gpl_disabled(){
1307 name=$1
1308 shift
1309 enabled_any $@ && die "$name is under GPL and --enable-gpl is not specified."
1310 }
1311 die_gpl_disabled "The Postprocessing code" pp
7bc5f2a8 1312 die_gpl_disabled "liba52" liba52
1cc60c47
DB
1313 die_gpl_disabled "libx264" libx264
1314 die_gpl_disabled "libxvidcore" libxvid
54118497
RP
1315 die_gpl_disabled "FAAD2" libfaad2
1316 die_gpl_disabled "The X11 grabber" x11grab
1317 die_gpl_disabled "The software scaler" swscaler
ebb810d9 1318fi
b2e3c528 1319
9eeed841 1320check_deps $ARCH_EXT_LIST
0f3cb305 1321
5d323602
MR
1322test -z "$need_memalign" && need_memalign="$mmx"
1323
cf9d24ad 1324#Darwin CC versions
ced75d92 1325if test $targetos = darwin; then
b2924696 1326 if test -n "`$cc -v 2>&1 | grep xlc`"; then
30a3e5d4 1327 add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
cf9d24ad 1328 else
26c1b3be
DB
1329 add_cflags "-no-cpp-precomp -pipe"
1330 check_cflags "-force_cpusubtype_ALL"
1331 check_cflags "-Wno-sign-compare"
7799eeec 1332 disabled shared && add_cflags -mdynamic-no-pic
cf9d24ad 1333 fi
2a1a6b64
MN
1334fi
1335
8400d6b8 1336disabled optimizations || add_cflags -fomit-frame-pointer
cf9d24ad 1337
a4adb608 1338# Add processor-specific flags
38d0a8aa 1339if test $cpu != "generic"; then
bc8ec47b
MR
1340 warn_altivec(){
1341 $1 altivec && echo "WARNING: Tuning for $2 but AltiVec $1.";
1658bc4f 1342 }
38d0a8aa 1343 case $cpu in
bb270c08 1344 601|ppc601|PowerPC601)
1c5d830c 1345 add_cflags "-mcpu=601"
bc8ec47b 1346 warn_altivec enabled PPC601
bb270c08
DB
1347 ;;
1348 603*|ppc603*|PowerPC603*)
1c5d830c 1349 add_cflags "-mcpu=603"
bc8ec47b 1350 warn_altivec enabled PPC603
bb270c08
DB
1351 ;;
1352 604*|ppc604*|PowerPC604*)
1c5d830c 1353 add_cflags "-mcpu=604"
bc8ec47b 1354 warn_altivec enabled PPC604
bb270c08
DB
1355 ;;
1356 G3|g3|75*|ppc75*|PowerPC75*)
1c5d830c 1357 add_cflags "-mcpu=750 -mpowerpc-gfxopt"
bc8ec47b 1358 warn_altivec enabled PPC75x
bb270c08
DB
1359 ;;
1360 G4|g4|745*|ppc745*|PowerPC745*)
1c5d830c 1361 add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
bc8ec47b 1362 warn_altivec disabled PPC745x
bb270c08
DB
1363 ;;
1364 74*|ppc74*|PowerPC74*)
1c5d830c 1365 add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
bc8ec47b 1366 warn_altivec disabled PPC74xx
bb270c08
DB
1367 ;;
1368 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
1c5d830c 1369 add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
bc8ec47b 1370 warn_altivec disabled PPC970
9cafbd6c 1371 enable ppc64
bb270c08 1372 ;;
e07e357d
LB
1373 Cell|CELL|cell)
1374 add_cflags "-mcpu=cell"
1375 warn_altivec disabled Cell
9cafbd6c 1376 enable ppc64
e07e357d 1377 ;;
e7768fc5
GP
1378 # targets that do NOT support conditional mov (cmov)
1379 i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
38d0a8aa 1380 add_cflags "-march=$cpu"
497237c7 1381 disable cmov
e7768fc5
GP
1382 ;;
1383 # targets that do support conditional mov (cmov)
416519dd 1384 i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
e7768fc5 1385 add_cflags "-march=$cpu"
497237c7
RP
1386 enable cmov
1387 enable fast_cmov
94e4c3a3
GP
1388 ;;
1389 # targets that do support conditional mov but on which it's slow
1390 pentium4|prescott|nocona)
1391 add_cflags "-march=$cpu"
497237c7
RP
1392 enable cmov
1393 disable fast_cmov
bb270c08 1394 ;;
d7b34d08 1395 sparc64)
1c5d830c 1396 add_cflags "-mcpu=v9"
d7b34d08 1397 ;;
8684704b
MH
1398 bf*) #bf531 bf532 bf533 bf561 bf5xx all get this config
1399 add_cflags "-mfdpic"
846dffeb 1400 add_ldflags "-mfdpic"
8684704b 1401 ;;
6b19786b
MR
1402 arm*)
1403 add_cflags "-mcpu=$cpu"
1404 ;;
bb270c08 1405 *)
7483e694 1406 echo "WARNING: Unknown CPU \"$cpu\", ignored."
bb270c08 1407 ;;
a4adb608
MN
1408 esac
1409fi
1410
412c1562
MR
1411gnu_make(){
1412 $1 --version 2>&1 | grep -q GNU
1413}
1414
1415if ! gnu_make $make; then
1416 gnu_make gmake && make=gmake || die "GNU make not found."
1417fi
1418
be0d52ab
MR
1419# make sure we can execute files in $TMPDIR
1420cat >$TMPE 2>>$logfile <<EOF
1421#! /bin/sh
1422EOF
1423chmod +x $TMPE >>$logfile 2>&1
1424if ! $TMPE >>$logfile 2>&1; then
1425 cat <<EOF
1426Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment
68300911
DB
1427variable to another directory and make sure that $TMPDIR1 is not mounted
1428noexec.
be0d52ab
MR
1429EOF
1430 die "Sanity test failed."
1431fi
0244f743 1432rm $TMPE
be0d52ab 1433
1a268acc
MR
1434# compiler sanity check
1435check_exec <<EOF
e5af4a11 1436int main(void){
1a268acc
MR
1437 return 0;
1438}
1439EOF
1440if test "$?" != 0; then
1441 echo "$cc is unable to create an executable file."
93b3c083 1442 if test -z "$cross_prefix" && ! enabled cross_compile ; then
1a268acc 1443 echo "If $cc is a cross-compiler, use the --cross-compile option."
c7ae6345 1444 echo "Only do this if you know what cross compiling means."
1a268acc
MR
1445 fi
1446 die "C compiler test failed."
1447fi
1448
9eeed841 1449if enabled x86; then
44965991
PI
1450 # check whether EBP is available on x86
1451 # As 'i' is stored on the stack, this program will crash
1452 # if the base pointer is used to access it because the
1453 # base pointer is cleared in the inline assembly code.
7dfef245 1454 check_exec_crash <<EOF && enable ebp_available
44965991
PI
1455 volatile int i=0;
1456 asm volatile (
1457 "xorl %%ebp, %%ebp"
1458 ::: "%ebp");
1459 return i;
44965991
PI
1460EOF
1461
1462 # check wether EBX is available on x86
940f335a 1463 check_asm ebx_available '"":::"%ebx"'
8e380710
LM
1464
1465 # check whether binutils is new enough to compile SSSE3
940f335a 1466 enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
44965991
PI
1467fi
1468
87ea51e0
LB
1469# check for assembler specific support
1470
cc6a90dd 1471if test $arch = "powerpc"; then
497237c7 1472check_cc <<EOF && enable dcbzl
87ea51e0
LB
1473int main(void) {
1474 register long zero = 0;
1475 char data[1024];
1476 asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
1477return 0;
1478}
1479EOF
1480fi
1481
57bd82d4
MR
1482# check for SIMD availability
1483
115329f1 1484# AltiVec flags: The FSF version of GCC differs from the Apple version
9eeed841 1485if enabled altivec; then
3ae3b721
RP
1486 test -n "`$cc -v 2>&1 | grep version | grep Apple`" &&
1487 add_cflags "-faltivec" ||
0182fee8 1488 add_cflags "-maltivec -mabi=altivec"
b6e52719 1489
0182fee8 1490 check_header altivec.h
a9a07762 1491
0182fee8 1492 # check if our compiler supports Motorola AltiVec C API
3ae3b721
RP
1493 enabled altivec_h &&
1494 inc_altivec_h="#include <altivec.h>" ||
f25fc9b1 1495 inc_altivec_h=
497237c7 1496 check_cc <<EOF || disable altivec
dcd479c0 1497$inc_altivec_h
a9a07762
MN
1498int main(void) {
1499 vector signed int v1, v2, v3;
1500 v1 = vec_add(v2,v3);
1501 return 0;
1502}
1503EOF
1504fi
ab6c65f6 1505
940f335a
MR
1506enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
1507enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
1508enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
1509enabled mmi && check_asm mmi '"lq $2, 0($2)"'
1510enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc
bd9d34a0 1511
8b03def6
DB
1512enabled vis && add_cflags "-mcpu=ultrasparc -mtune=ultrasparc"
1513
57bd82d4
MR
1514# ---
1515# big/little-endian test
9eebe687
MR
1516check_cc <<EOF || die "endian test failed"
1517unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
a3999908 1518EOF
e89d9fd8 1519grep -q BIGE $TMPO && enable bigendian
487a54d7 1520
a3999908 1521# ---
3d204385
NK
1522# check availability of some header files
1523
a98bb16d
RP
1524if check_func dlopen; then
1525 ldl=
1526elif check_func dlopen -ldl; then
1527 ldl=-ldl
8bf5d58f
MN
1528fi
1529
7483e694
DB
1530check_func fork
1531check_func gethrtime
1532check_func getrusage
1533check_func inet_aton
1534check_func memalign
1535check_func mkstemp
a98bb16d 1536check_func2 windows.h GetProcessTimes
6ffa87d3 1537
a98bb16d 1538check_header byteswap.h
e16e49ac 1539check_header conio.h
a98bb16d
RP
1540check_header dlfcn.h
1541check_header malloc.h
1542check_header termios.h
1543
1544if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
1545 die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
1546fi
e16e49ac 1547
497237c7 1548enabled zlib && check_lib zlib.h zlibVersion -lz || disable zlib
57bd82d4 1549
b0c858d8
FR
1550# ffserver uses poll(),
1551# if it's not found we can emulate it using select().
1552if enabled ffserver; then
1553 check_header sys/poll.h
1554fi
1555
57bd82d4
MR
1556# check for some common methods of building with pthread support
1557# do this before the optional library checks as some of them require pthreads
1558if enabled pthreads; then
9e7fd101
MR
1559 if check_func pthread_create; then
1560 :
1561 elif check_func pthread_create -pthread; then
1562 add_cflags -pthread
1563 add_ldflags -pthread
1564 elif check_func pthread_create -pthreads; then
1565 add_cflags -pthreads
1566 add_ldflags -pthreads
1567 elif ! check_lib pthread.h pthread_create -lpthread; then
1568 die "ERROR: can't find pthreads library"
1569 fi
57bd82d4
MR
1570fi
1571
8eee7025 1572for thread in $THREADS_LIST; do
e5f94c2b 1573 if enabled $thread; then
3ae3b721
RP
1574 test -n "$thread_type" &&
1575 die "ERROR: Only one thread type must be selected." ||
e5f94c2b 1576 thread_type="$thread"
e5f94c2b
RP
1577 fi
1578done
1579
fdf88598
MR
1580check_lib math.h sin -lm
1581
f32adb22 1582# test for lrintf in math.h
497237c7 1583check_exec <<EOF && enable lrintf || disable lrintf
f32adb22
MR
1584#define _ISOC9X_SOURCE 1
1585#include <math.h>
db817cf3 1586int main(void) { return (lrintf(3.999f) > 0)?0:1; }
f32adb22
MR
1587EOF
1588
f5a756ef 1589enabled_any libamr_nb libamr_wb && enable libamr
12b61a74 1590
57bd82d4 1591# these are off by default, so fail if requested and not available
79fda097 1592enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
7483e694
DB
1593enabled liba52 && require liba52 a52dec/a52.h a52_init -la52
1594enabled libamr_nb && require libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lm
1595enabled libamr_wb && require libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lm
1596enabled libdc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
79fda097
DB
1597enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
1598enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
7483e694
DB
1599enabled libgsm && require libgsm gsm.h gsm_create -lgsm
1600enabled libmp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
1601enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
1602enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
1603enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
1604enabled libx264 && require x264 x264.h x264_encoder_open -lx264
1605enabled libxvid && require Xvid xvid.h xvid_global -lxvidcore
1606enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
8ac17293 1607
6ea67bbb
JR
1608# disable the native AC-3 decoder if liba52 is enabled
1609enabled liba52 && disable ac3_decoder
1610
c13e1abd
FH
1611_restrict=
1612for restrict_keyword in restrict __restrict__ __restrict; do
57bd82d4 1613 check_cc <<EOF && _restrict=$restrict_keyword && break
dcd479c0
MR
1614void foo(char * $restrict_keyword p);
1615EOF
c13e1abd
FH
1616done
1617
703afd07 1618test "$vhook" = "default" && vhook="$dlopen"
a8721c09 1619
b0268cc0 1620if test "$targetos" = cygwin -o "$targetos" = mingw32 && enabled_all static vhook ; then
497237c7 1621 disable vhook
fbb9d104 1622 echo
b0268cc0 1623 echo "At the moment vhooks don't work on Cygwin or MinGW static builds."
fbb9d104
VP
1624 echo "Patches welcome."
1625 echo
1626fi
1627
8d923001
MR
1628if enabled vhook; then
1629 check_ldflags -rdynamic
1630 check_ldflags -export-dynamic
1631fi
bfd2edeb 1632
eea50282
MR
1633check_foo_config imlib2 imlib2 Imlib2.h imlib_load_font
1634check_foo_config freetype2 freetype ft2build.h FT_Init_FreeType
04511d53 1635
a86b921c 1636##########################################
29799f8b 1637# SDL check
a86b921c 1638
497237c7
RP
1639disable sdl_too_old
1640disable sdl
6a1a892f 1641SDL_CONFIG="${cross_prefix}sdl-config"
225e21ef
MR
1642if "${SDL_CONFIG}" --version >/dev/null 2>&1; then
1643 sdl_cflags=`"${SDL_CONFIG}" --cflags`
1644 temp_cflags $sdl_cflags
dcd479c0 1645 temp_extralibs `"${SDL_CONFIG}" --libs`
225e21ef 1646 if check_lib SDL.h SDL_Init; then
dcd479c0 1647 _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
29f3b38a 1648 if test "$_sdlversion" -lt 121 ; then
497237c7 1649 enable sdl_too_old
dcd479c0 1650 else
497237c7 1651 enable sdl
225e21ef 1652 check_cc $sdl_cflags <<EOF && enable sdl_video_size
29f3b38a
MR
1653#include <SDL.h>
1654int main(void){
1655 const SDL_VideoInfo *vi = SDL_GetVideoInfo();
1656 int w = vi->current_w;
1657 return 0;
1658}
1659EOF
dcd479c0
MR
1660 fi
1661 fi
29f3b38a 1662 restore_flags
c3f6b472 1663fi
57bd82d4 1664
d5697779 1665texi2html -version >/dev/null 2>&1 && enable texi2html || disable texi2html
146ea952 1666
7a91333f 1667##########################################
73b46a95
RP
1668# Network check
1669
1670if enabled network; then
1671 # Prefer arpa/inet.h over winsock2
1672 if check_header arpa/inet.h ; then
1673 check_func closesocket
1674 elif check_header winsock2.h ; then
ea10ddde 1675 network_extralibs="-lws2_32"
73b46a95
RP
1676 check_func2 winsock2.h closesocket
1677 fi
1678fi
1679
1680##########################################
29799f8b 1681# IPv6 check
7a91333f 1682
497237c7 1683enabled network && enabled ipv6 && check_ld <<EOF && enable ipv6 || disable ipv6
7a91333f
HZ
1684#include <sys/types.h>
1685#include <sys/socket.h>
1686#include <netinet/in.h>
1687#include <netdb.h>
db817cf3 1688int main(void) {
7483e694
DB
1689 struct sockaddr_storage saddr;
1690 struct ipv6_mreq mreq6;
1691 getaddrinfo(0,0,0,0);
1692 getnameinfo(0,0,0,0,0,0,0);
1693 IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
7a91333f
HZ
1694}
1695EOF
1696
06e31011
RP
1697check_header linux/videodev.h
1698check_header linux/videodev2.h
47f38850 1699
f8aa696f 1700# check for ioctl_meteor.h, ioctl_bt848.h and alternatives
1c915f83
RP
1701{ check_header dev/bktr/ioctl_meteor.h &&
1702 check_header dev/bktr/ioctl_bt848.h; } ||
1703{ check_header machine/ioctl_meteor.h &&
1704 check_header machine/ioctl_bt848.h; } ||
1705{ check_header dev/video/meteor/ioctl_meteor.h &&
1706 check_header dev/video/bktr/ioctl_bt848.h; } ||
1707check_header dev/ic/bt8xx.h
f8aa696f 1708
c7682de0
RP
1709check_header sys/soundcard.h
1710check_header soundcard.h
deb29777 1711
7483e694 1712# deal with the X11 frame grabber
56a059ac 1713enabled x11grab &&
f58f4ce1
GP
1714check_header X11/Xlib.h &&
1715check_header X11/extensions/XShm.h &&
1716check_func XOpenDisplay -lX11 &&
06eab4ba 1717check_func XShmCreateImage -lX11 -lXext
f58f4ce1 1718
57bd82d4
MR
1719enabled debug && add_cflags -g
1720
1721# add some useful compiler flags if supported
1722check_cflags -Wdeclaration-after-statement
dcd479c0
MR
1723check_cflags -Wall
1724check_cflags -Wno-switch
c07bd6a9
MN
1725check_cflags -Wdisabled-optimization
1726check_cflags -Wpointer-arith
1727check_cflags -Wredundant-decls
cc1fb623 1728check_cflags -Wno-pointer-sign
5af4e0cc 1729enabled extra_warnings && check_cflags -Winline
cf9d24ad 1730
57bd82d4 1731# add some linker flags
5c0e9479 1732check_ldflags -Wl,--warn-common
e240ee67 1733check_ldflags $LDLATEFLAGS
c2fd6530 1734check_ldflags -Wl,-Bsymbolic
94a3401e 1735
bd2216e4
MR
1736if enabled small; then
1737 check_cflags -Os # not all compilers support -Os
8400d6b8
DB
1738 optimizations="small"
1739elif enabled optimizations; then
b2924696 1740 if test -n "`$cc -v 2>&1 | grep xlc`"; then
30a3e5d4
NP
1741 add_cflags "-O5"
1742 add_ldflags "-O5"
cf9d24ad 1743 else
30a3e5d4 1744 add_cflags "-O3"
cf9d24ad 1745 fi
cddf3f45
GM
1746fi
1747
80581e98 1748# PIC flags for shared library objects where they are needed
5af4e0cc 1749if enabled shared; then
f25fc9b1
MR
1750 # LIBOBJFLAGS may have already been set in the OS configuration
1751 if test -z "$LIBOBJFLAGS" ; then
cc6a90dd 1752 case "$arch" in
35d6cebd 1753 x86_64|ia64|alpha|sparc*|power*) LIBOBJFLAGS='$(PIC)' ;;
813457e5 1754 esac
80581e98 1755 fi
80581e98
MN
1756fi
1757
90be59ef 1758if enabled gprof; then
30a3e5d4
NP
1759 add_cflags "-p"
1760 add_ldflags "-p"
1db54e20
DB
1761fi
1762
3b26ee47 1763VHOOKCFLAGS="-fPIC"
18451f7d 1764
7f3c02fc 1765# Find out if the .align argument is a power of two or not.
4454dc1b 1766if test $asmalign_pot = "unknown"; then
497237c7
RP
1767 disable asmalign_pot
1768 echo 'asm (".align 3");' | check_cc && enable asmalign_pot
4454dc1b
JD
1769fi
1770
7483e694
DB
1771enabled_any $DECODER_LIST && enable decoders
1772enabled_any $ENCODER_LIST && enable encoders
1773enabled_any $BSF_LIST && enable bsfs
1774enabled_any $DEMUXER_LIST && enable demuxers
1775enabled_any $MUXER_LIST && enable muxers
1776enabled_any $INDEV_LIST && enable demuxers
1777enabled_any $OUTDEV_LIST && enable muxers
1778enabled_any $PROTOCOL_LIST && enable protocols
1779
1780enabled_any $THREADS_LIST && enable threads
1781
1782check_deps $CONFIG_LIST \
1783 $HAVE_LIST \
1784 $DECODER_LIST \
1785 $ENCODER_LIST \
1786 $PARSER_LIST \
1787 $BSF_LIST \
1788 $DEMUXER_LIST \
1789 $MUXER_LIST \
1790 $INDEV_LIST \
1791 $OUTDEV_LIST \
1792 $PROTOCOL_LIST \
f70f03f6 1793
f7b8bffe 1794enabled libdc1394 && append pkg_requires "libraw1394"
fb2ce7d9 1795enabled libtheora && append pkg_requires "theora"
f9def9cc 1796enabled libvorbis && append pkg_requires "vorbisenc"
fb2ce7d9 1797
f36958f8
DB
1798echo "install prefix $PREFIX"
1799echo "source path $source_path"
1800echo "C compiler $cc"
1801echo "make $make"
bfd5afd8 1802echo ".align is power-of-two $asmalign_pot"
f36958f8 1803echo "ARCH $arch ($cpu)"
eb94aca9 1804if test "$BUILDSUF" != ""; then
f36958f8 1805 echo "build suffix $BUILDSUF"
eb94aca9 1806fi
0db2ce77 1807echo "big-endian ${bigendian-no}"
419b8784 1808if test $arch = "x86_32" -o $arch = "x86_64"; then
0db2ce77
MR
1809 echo "MMX enabled ${mmx-no}"
1810 echo "CMOV enabled ${cmov-no}"
1811 echo "CMOV is fast ${fast_cmov-no}"
971cc990
MN
1812 echo "EBX available ${ebx_available-no}"
1813 echo "EBP available ${ebp_available-no}"
e41e8342 1814fi
cc6a90dd 1815if test $arch = "armv4l"; then
0db2ce77
MR
1816 echo "ARMv5TE enabled ${armv5te-no}"
1817 echo "ARMv6 enabled ${armv6-no}"
1818 echo "IWMMXT enabled ${iwmmxt-no}"
eba9ae3c 1819fi
e241ba14 1820if test $arch = "mips"; then
0db2ce77 1821 echo "MMI enabled ${mmi-no}"
e41e8342 1822fi
cc6a90dd 1823if test $arch = "powerpc"; then
0db2ce77
MR
1824 echo "AltiVec enabled ${altivec-no}"
1825 echo "dcbzl available ${dcbzl-no}"
e41e8342 1826fi
0db2ce77
MR
1827echo "gprof enabled ${gprof-no}"
1828echo "debug symbols ${debug-no}"
1829echo "strip symbols ${dostrip-no}"
8400d6b8 1830echo "optimizations ${optimizations-no}"
0db2ce77
MR
1831echo "static ${static-no}"
1832echo "shared ${shared-no}"
1833echo "postprocessing support ${pp-no}"
1834echo "software scaler enabled ${swscaler-no}"
1835echo "video hooking ${vhook-no}"
90be59ef 1836if enabled vhook; then
0db2ce77
MR
1837 echo "Imlib2 support ${imlib2-no}"
1838 echo "FreeType support ${freetype2-no}"
68892110 1839fi
0db2ce77 1840echo "network support ${network-no}"
90be59ef 1841if enabled network; then
0db2ce77 1842 echo "IPv6 support ${ipv6-no}"
bfd5afd8 1843fi
0db2ce77
MR
1844echo "threading support ${thread_type-no}"
1845echo "SDL support ${sdl-no}"
90be59ef 1846if enabled sdl_too_old; then
bfd5afd8
DB
1847 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1848fi
0db2ce77
MR
1849echo "Sun medialib support ${mlib-no}"
1850echo "AVISynth enabled ${avisynth-no}"
1851echo "liba52 support ${liba52-no}"
1852echo "liba52 dlopened ${liba52bin-no}"
1853echo "libamr-nb support ${libamr_nb-no}"
1854echo "libamr-wb support ${libamr_wb-no}"
f7b8bffe 1855echo "libdc1394 support ${libdc1394-no}"
0db2ce77
MR
1856echo "libfaac enabled ${libfaac-no}"
1857echo "libfaad enabled ${libfaad-no}"
7e0871a7 1858echo "libfaad dlopened ${libfaadbin-no}"
0db2ce77
MR
1859echo "libgsm enabled ${libgsm-no}"
1860echo "libmp3lame enabled ${libmp3lame-no}"
1861echo "libnut enabled ${libnut-no}"
0db2ce77
MR
1862echo "libtheora enabled ${libtheora-no}"
1863echo "libvorbis enabled ${libvorbis-no}"
1864echo "x264 enabled ${libx264-no}"
1865echo "XviD enabled ${libxvid-no}"
1866echo "zlib enabled ${zlib-no}"
3ae3b721
RP
1867enabled gpl &&
1868 echo "License: GPL" ||
f25fc9b1 1869 echo "License: LGPL"
de6d9b64 1870
7dd2862b 1871for type in decoder encoder parser demuxer muxer protocol bsf indev outdev; do
8138b9db
RP
1872 echo "Enabled ${type}s:"
1873 ucname="\$`toupper $type`_LIST"
1874 list="`eval echo $ucname`"
1875 partlist=""
1876 for part in $list; do
1877 enabled $part && partlist="$partlist $part"
1878 done
1879 partlist=`echo $partlist | sed s/_$type//g | tr ' ' '\n' | sort`
1880 echo $partlist
1881done
1882
29799f8b 1883echo "Creating config.mak and config.h..."
de6d9b64 1884
29799f8b
DB
1885echo "# Automatically generated by configure - do not modify!" > config.mak
1886echo "/* Automatically generated by configure - do not modify! */" > $TMPH
9c05103f
DB
1887echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
1888echo "#define FFMPEG_CONFIG_H" >> $TMPH
0fd12426 1889echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH
de6d9b64 1890
2266e085 1891echo "PREFIX=$PREFIX" >> config.mak
c75560ae 1892echo "prefix=\$(DESTDIR)\$(PREFIX)" >> config.mak
22a324da
DB
1893echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
1894echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
1895echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
1896echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
1897echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
4a908fbc 1898echo "MAKE=$make" >> config.mak
980fc7b8
FB
1899echo "CC=$cc" >> config.mak
1900echo "AR=$ar" >> config.mak
be7109c1 1901echo "RANLIB=$ranlib" >> config.mak
78eb6531 1902echo "LDCONFIG=$LDCONFIG" >> config.mak
20369773 1903echo "LN_S=$ln_s" >> config.mak
3ae3b721
RP
1904enabled dostrip &&
1905 echo "STRIP=$strip" >> config.mak ||
f25fc9b1 1906 echo "STRIP=echo ignoring strip" >> config.mak
75388c74 1907
a9b3f630 1908echo "OPTFLAGS=$CFLAGS" >> config.mak
408382a4 1909echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
0f3cb305 1910echo "LDFLAGS=$LDFLAGS" >> config.mak
c536cb09 1911echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
e1707f52 1912echo "SHFLAGS=$SHFLAGS" >> config.mak
408382a4 1913echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
fbb9d104 1914echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
80581e98 1915echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
5af4e0cc 1916echo "BUILD_STATIC=$static" >> config.mak
eb94aca9 1917echo "BUILDSUF=$BUILDSUF" >> config.mak
c5f14466 1918echo "FULLNAME=$FULLNAME" >> config.mak
f3ec2d46 1919echo "LIBPREF=$LIBPREF" >> config.mak
c5f14466 1920echo "LIBSUF=$LIBSUF" >> config.mak
24743a76 1921echo "LIBNAME=$LIBNAME" >> config.mak
f3ec2d46 1922echo "SLIBPREF=$SLIBPREF" >> config.mak
c5f14466
RP
1923echo "SLIBSUF=$SLIBSUF" >> config.mak
1924echo "EXESUF=$EXESUF" >> config.mak
4dc62701 1925
90be59ef 1926if enabled bigendian; then
7483e694
DB
1927 echo "WORDS_BIGENDIAN=yes" >> config.mak
1928 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 1929fi
90be59ef 1930if enabled mmx; then
7483e694 1931 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 1932fi
44161118 1933
90be59ef 1934if enabled sdl; then
7483e694
DB
1935 echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
1936 echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
a86b921c 1937fi
90be59ef 1938if enabled texi2html; then
7483e694 1939 echo "BUILD_DOC=yes" >> config.mak
146ea952 1940fi
5a872801 1941
790c9ca7 1942sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
6d9a2421 1943pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
5a872801 1944lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
c721d803 1945lavd_version=`grep '#define LIBAVDEVICE_VERSION ' "$source_path/libavdevice/avdevice.h" | sed 's/[^0-9\.]//g'`
5a872801
LB
1946lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1947lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1948
1949
1950
5af4e0cc 1951if enabled shared; then
7483e694
DB
1952 echo "BUILD_SHARED=yes" >> config.mak
1953 echo "PIC=-fPIC -DPIC" >> config.mak
1954 echo "SPPMAJOR=${pp_version%%.*}" >> config.mak
1955 echo "SPPVERSION=$pp_version" >> config.mak
1956 echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
1957 echo "LAVCVERSION=$lavc_version" >> config.mak
1958 echo "LAVDMAJOR=${lavd_version%%.*}" >> config.mak
1959 echo "LAVDVERSION=$lavd_version" >> config.mak
1960 echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
1961 echo "LAVFVERSION=$lavf_version" >> config.mak
1962 echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
1963 echo "LAVUVERSION=$lavu_version" >> config.mak
1964 echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
1965 echo "SWSVERSION=$sws_version" >> config.mak
1966 echo "SLIBNAME=${SLIBNAME}" >> config.mak
1967 echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1968 echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
d22e8442 1969 echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
7483e694
DB
1970 echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
1971 echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
1972 echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
0319c531 1973fi
d7e27559 1974echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
ef0bc4c9 1975echo "EXTRALIBS=$extralibs" >> config.mak
d2845d68 1976
3d907e22
MR
1977print_config ARCH_ $TMPH config.mak $ARCH_LIST
1978print_config HAVE_ $TMPH config.mak $HAVE_LIST
7483e694
DB
1979print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
1980 $DECODER_LIST \
1981 $ENCODER_LIST \
1982 $PARSER_LIST \
1983 $BSF_LIST \
1984 $DEMUXER_LIST \
1985 $MUXER_LIST \
1986 $PROTOCOL_LIST \
1987 $INDEV_LIST \
1988 $OUTDEV_LIST \
8ac17293 1989
c13e1abd
FH
1990echo "#define restrict $_restrict" >> $TMPH
1991
bd2216e4 1992if enabled small; then
7483e694 1993 echo "#define av_always_inline" >> $TMPH
bb801c97
MN
1994fi
1995
997baf01
MR
1996echo "SRC_PATH=\"$source_path\"" >> config.mak
1997echo "SRC_PATH_BARE=$source_path" >> config.mak
1998echo "BUILD_ROOT=\"$PWD\"" >> config.mak
0f3cb305 1999
8156056e 2000# Apparently it's not possible to portably echo a backslash.
3ae3b721 2001enabled asmalign_pot &&
7483e694
DB
2002 printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
2003 printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
4454dc1b 2004
bc634f6f 2005
9c05103f
DB
2006echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
2007
9cb2cf10 2008# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
3ae3b721
RP
2009cmp -s $TMPH config.h &&
2010 echo "config.h is unchanged" ||
2011 mv -f $TMPH config.h
3d204385 2012
f3ec2d46 2013rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
def4272a 2014
165af439 2015# build tree in object directory if source path is different from current one
90be59ef 2016if enabled source_path_used; then
165af439 2017 DIRS="\
7483e694
DB
2018 doc \
2019 libavcodec \
2020 libavcodec/alpha \
2021 libavcodec/armv4l \
2022 libavcodec/bfin \
2023 libavcodec/i386 \
2024 libavcodec/mlib \
2025 libavcodec/ppc \
2026 libavcodec/sh4 \
2027 libavcodec/sparc \
52a9cf34 2028 libavdevice \
7483e694
DB
2029 libavformat \
2030 libavutil \
2031 libpostproc \
2032 libswscale \
2033 tests \
2034 tools \
2035 vhook \
2036 "
165af439 2037 FILES="\
7483e694
DB
2038 Makefile \
2039 common.mak \
2040 doc/texi2pod.pl \
2041 libavcodec/Makefile \
52a9cf34 2042 libavdevice/Makefile \
7483e694
DB
2043 libavformat/Makefile \
2044 libavutil/Makefile \
2045 libpostproc/Makefile \
2046 libswscale/Makefile \
2047 "
165af439 2048 for dir in $DIRS ; do
7483e694 2049 mkdir -p $dir
165af439
MR
2050 done
2051 for f in $FILES ; do
20369773 2052 $ln_s "$source_path/$f" $f
165af439
MR
2053 done
2054fi
def4272a 2055
def4272a 2056
d0674868 2057# build pkg-config files
77aee36c 2058# FIXME: libdir and includedir are hardcoded and may differ from the real path.
def4272a 2059
d0674868
DB
2060pkgconfig_generate(){
2061name=$1
2062comment=$2
2063version=$3
2064libs=$4
2065requires=$5
2066include=$6
2067cat <<EOF >$name.pc
2266e085 2068prefix=$PREFIX
a94e666c 2069exec_prefix=\${prefix}
def4272a 2070libdir=\${exec_prefix}/lib
a94e666c 2071includedir=\${prefix}/include
def4272a 2072
d0674868
DB
2073Name: $name
2074Description: $comment
2075Version: $version
2076Requires: $requires
def4272a 2077Conflicts:
d0674868
DB
2078Libs: -L\${libdir} $libs
2079Cflags: -I\${includedir} -I\${includedir}/$include
def4272a 2080EOF
d0674868 2081}
def4272a 2082
d0674868
DB
2083pkgconfig_generate_uninstalled(){
2084name=$1
9c476fd6 2085shortname=${name#lib}
d0674868
DB
2086comment=$2
2087version=$3
2088libs=$4
2089requires=$5
2090cat <<EOF >$name-uninstalled.pc
def4272a
AJ
2091prefix=
2092exec_prefix=
d0674868
DB
2093libdir=\${pcfiledir}/$name
2094includedir=\${pcfiledir}/$name
def4272a 2095
d0674868
DB
2096Name: $name
2097Description: $comment
2098Version: $version
2099Requires: $requires
def4272a 2100Conflicts:
d0674868 2101Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
def4272a
AJ
2102Cflags: -I\${includedir}
2103EOF
d0674868 2104}
def4272a 2105
9d824ad1 2106pkgconfig_generate libavutil "FFmpeg utility library" "$lavu_version" -lavutil "" ffmpeg
d0674868 2107pkgconfig_generate_uninstalled libavutil "FFmpeg utility library" "$lavu_version"
def4272a 2108
d0674868
DB
2109pkgconfig_generate libavcodec "FFmpeg codec library" "$lavc_version" "-lavcodec $extralibs" "$pkg_requires libavutil = $lavu_version" ffmpeg
2110pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$lavc_version" "$extralibs" "$pkg_requires libavutil = $lavu_version"
def4272a 2111
d0674868
DB
2112pkgconfig_generate libavformat "FFmpeg container format library" "$lavf_version" "-lavformat $extralibs" "$pkg_requires libavcodec = $lavc_version" ffmpeg
2113pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$lavf_version" "$extralibs" "$pkg_requires libavcodec = $lavc_version"
def4272a 2114
c721d803
LA
2115pkgconfig_generate libavdevice "FFmpeg device handling library" "$lavd_version" "-lavdevice $extralibs" "$pkg_requires libavformat = $lavf_version" ffmpeg
2116pkgconfig_generate_uninstalled libavdevice "FFmpeg device handling library" "$lavd_version" "$extralibs" "$pkg_requires libavformat = $lavf_version"
90be59ef 2117if enabled pp; then
7483e694
DB
2118 pkgconfig_generate libpostproc "FFmpeg post processing library" "$pp_version" -lpostproc "" postproc
2119 pkgconfig_generate_uninstalled libpostproc "FFmpeg post processing library" "$pp_version"
2e3bcd38 2120fi
790c9ca7 2121
c839db53 2122if enabled swscaler; then
7483e694
DB
2123 pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" -lswscale "libavutil = $lavu_version" ffmpeg
2124 pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "libavutil = $lavu_version"
6c0d0413 2125else
7483e694
DB
2126 pkgconfig_generate libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version" ffmpeg
2127 pkgconfig_generate_uninstalled libswscale "FFmpeg image rescaling library" "$sws_version" "" "$pkg_requires libavcodec = $lavc_version"
2128 apply libswscale.pc sed s/^Libs:.*$/Libs:/
2129 apply libswscale-uninstalled.pc sed s/^Libs:.*$/Libs:/
6c0d0413 2130fi