3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
6 if test x
"$1" = x
"-h" -o x
"$1" = x
"--help" ; then
9 Usage: configure [options]
10 Options: [defaults in brackets after descriptions]
13 echo "Standard options:"
14 echo " --help print this message"
15 echo " --prefix=PREFIX install in PREFIX [$prefix]"
16 echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
17 echo " --mandir=DIR install man page in DIR [PREFIX/man]"
18 echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
19 echo " --enable-libogg enable Ogg support via libogg [default=no]"
20 echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
21 echo " --enable-theora enable Theora support via libtheora [default=no]"
22 echo " --enable-faad enable FAAD support via libfaad [default=no]"
23 echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
24 echo " --enable-faac enable FAAC support via libfaac [default=no]"
25 echo " --enable-libgsm enable GSM support via libgsm [default=no]"
26 echo " --enable-xvid enable XviD support via xvidcore [default=no]"
27 echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
28 echo " --enable-mingw32 enable MinGW native/cross Windows compile"
29 echo " --enable-a52 enable GPLed A52 support [default=no]"
30 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
31 echo " --enable-dts enable GPLed DTS support [default=no]"
32 echo " --enable-pp enable GPLed postprocessing support [default=no]"
33 echo " --enable-shared build shared libraries [default=no]"
34 echo " --enable-amr_nb enable amr_nb float audio codec"
35 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
36 echo " --enable-amr_wb enable amr_wb float audio codec"
37 echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
38 echo " --enable-sunmlib use Sun medialib [default=no]"
39 echo " --enable-pthreads use pthreads [default=no]"
40 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
41 echo " and libraw1394 [default=no]"
42 echo " --enable-gpl allow use of GPL code, the resulting libav*"
43 echo " and ffmpeg will be under GPL [default=no]"
45 echo "Advanced options (experts only):"
46 echo " --source-path=PATH path to source code [$source_path]"
47 echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
48 echo " --cc=CC use C compiler CC [$cc]"
49 echo " --make=MAKE use specified make [$make]"
50 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
51 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
52 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
53 echo " --build-suffix=SUFFIX suffix for application specific build []"
54 echo " --cpu=CPU force cpu to CPU [$cpu]"
55 echo " --tune=CPU tune code for a particular CPU"
56 echo " (may fail or perform badly on other CPUs)"
57 echo " --powerpc-perf-enable enable performance report on PPC"
58 echo " (requires enabling PMC)"
59 echo " --disable-mmx disable MMX usage"
60 echo " --disable-iwmmxt disable iwmmxt usage"
61 echo " --disable-altivec disable AltiVec usage"
62 echo " --disable-audio-oss disable OSS audio support [default=no]"
63 echo " --disable-audio-beos disable BeOS audio support [default=no]"
64 echo " --disable-v4l disable video4linux grabbing [default=no]"
65 echo " --disable-bktr disable bktr video grabbing [default=no]"
66 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
67 echo " --disable-network disable network support [default=no]"
68 echo " --disable-zlib disable zlib [default=no]"
69 echo " --disable-lzo disable lzo [default=no]"
70 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
71 echo " --disable-vhook disable video hooking support"
72 echo " --enable-gprof enable profiling with gprof [$gprof]"
73 echo " --disable-debug disable debugging symbols"
74 echo " --disable-opts disable compiler optimizations"
75 echo " --disable-mpegaudio-hp faster (but less accurate)"
76 echo " MPEG audio decoding [default=no]"
77 echo " --disable-ffserver disable ffserver build"
78 echo " --disable-ffplay disable ffplay build"
79 echo " --enable-small optimize for size instead of speed"
80 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
81 echo " --disable-strip disable stripping of executables and shared libraries"
82 echo " --disable-encoder=NAME disables encoder NAME"
83 echo " --enable-encoder=NAME enables encoder NAME"
84 echo " --disable-decoder=NAME disables decoder NAME"
85 echo " --enable-decoder=NAME enables decoder NAME"
86 echo " --disable-encoders disables all encoders"
87 echo " --disable-decoders disables all decoders"
88 echo " --disable-muxers disables all muxers"
89 echo " --disable-demuxers disables all demuxers"
91 echo "NOTE: Object files are built at the place where configure is launched."
95 # set temporary file name
96 if test ! -z
"$TMPDIR" ; then
98 elif test ! -z
"$TEMPDIR" ; then
104 TMPC
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
105 TMPO
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
106 TMPE
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
107 TMPS
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
108 TMPH
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
129 i386|i486|i586|i686|i86pc|BePC
)
134 canon_arch
="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
135 if [ x
"$canon_arch" = x
"x86_64" -o x
"$canon_arch" = x
"amd64" ]; then
136 if [ -z
"`echo $CFLAGS | grep -- -m32`" ]; then
141 # armv4l is a subset of armv5tel
148 "Power Macintosh"|ppc|powerpc
)
220 SHFLAGS
='-shared -Wl,-soname,$@.$(LIBMAJOR)'
226 LDFLAGS
=-Wl
,--warn-common
231 LIB
='$(LIBPREF)$(NAME)$(LIBSUF)'
234 SLIBNAME
='$(SLIBPREF)$(NAME)$(SLIBSUF)'
235 SLIBNAME_WITH_VERSION
='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBVERSION)'
236 SLIBNAME_WITH_MAJOR
='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBMAJOR)'
254 prefix
="/boot/home/config"
255 # helps building libavcodec
256 CFLAGS
="-DPIC -fomit-frame-pointer"
257 # 3 gcc releases known for BeOS, each with ugly bugs
258 gcc_version
="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
259 case "$gcc_version" in
260 2.9-beos-991026
*|
2.9-beos-000224
*) echo "R5/GG gcc"
263 *20010315*) echo "BeBits gcc"
264 CFLAGS
="$CFLAGS -fno-expensive-optimizations"
268 # disable Linux things
274 # no need for libm, but the inet stuff
276 if (echo $BEINCLUDES|
grep 'headers/be/bone' >/dev
/null
); then
277 extralibs
="-lbind -lsocket"
291 extralibs
="$extralibs -lsocket -lnsl"
299 LDFLAGS
="$LDFLAGS -export-dynamic"
301 2.
*) extralibs
="$extralibs -lossaudio"
311 LIBOBJFLAGS
="\$(PIC)"
312 LDFLAGS
="$LDFLAGS -export-dynamic -pthread"
313 LDCONFIG
="ldconfig -m \$(libdir)"
314 extralibs
="$extralibs -lossaudio"
323 LDFLAGS
="$LDFLAGS -export-dynamic -pthread"
330 extralibs
="-lpoll -lgnugetopt -lm"
341 SHFLAGS
="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
346 LDFLAGS
="-Wl,-dynamic,-search_paths_first"
348 SLIBNAME_WITH_FULLVERSION
='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
349 SLIBNAME_WITH_MAJOR
='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
350 FFSLDFLAGS
=-Wl
,-bind_at_load
353 # Note: the rest of the mingw32 config is done afterwards as mingw32
354 # can be forced on the command line for Linux cross compilation.
367 LDFLAGS
="$LDFLAGS -rdynamic"
370 ranlib
="echo ignoring ranlib"
378 ranlib
="echo ignoring ranlib"
379 strip
="echo ignoring strip"
381 LDFLAGS
="-Zomf -Zstack 16384 -s"
382 SHFLAGS
="-Zdll -Zomf"
403 # From MPlayer configure. We need TARGET_OS available
404 # to the Makefile, so it can distinguish between flavors
405 # of AltiVec on PowerPC.
406 TARGET_OS
=`( uname -s ) 2>&1`
408 Linux|FreeBSD|NetBSD|BSD
/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS
)
416 [cC
][yY
][gG
][wW
][iI
][nN
]*)
420 TARGET_OS
="$TARGET_OS-UNKNOWN"
425 source_path
="`dirname $0`"
426 source_path_used
="yes"
427 if test -z
"$source_path" -o
"$source_path" = "." ; then
429 source_path_used
="no"
431 source_path
="`cd \"$source_path\"; pwd`"
434 FFMPEG_CONFIGURATION
=" "
436 FFMPEG_CONFIGURATION
="$FFMPEG_CONFIGURATION""$opt "
439 CODEC_LIST
=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
443 --prefix
=*) prefix
=`echo $opt | cut -d '=' -f 2`; force_prefix
=yes
445 --libdir
=*) libdir
=`echo $opt | cut -d '=' -f 2`; force_libdir
=yes
447 --mandir
=*) mandir
=`echo $opt | cut -d '=' -f 2`
449 --source-path
=*) source_path
=`echo $opt | cut -d '=' -f 2`
451 --cross-prefix
=*) cross_prefix
=`echo $opt | cut -d '=' -f 2`
453 --cc
=*) cc
=`echo $opt | cut -d '=' -f 2-`
455 --make=*) make=`echo $opt | cut -d '=' -f 2`
457 --extra-cflags
=*) CFLAGS
="$CFLAGS ${opt#--extra-cflags=}"
459 --extra-ldflags
=*) LDFLAGS
="$LDFLAGS ${opt#--extra-ldflags=}"
461 --extra-libs
=*) extralibs
=${opt#--extra-libs=}
463 --build-suffix
=*) BUILDSUF
=${opt#--build-suffix=}
465 --cpu
=*) cpu
=`echo $opt | cut -d '=' -f 2`
467 --tune
=*) tune
=`echo $opt | cut -d '=' -f 2`
469 --powerpc-perf-enable
) powerpc_perf
="yes"
471 --disable-mmx
) mmx
="no"
473 --disable-iwmmxt
) iwmmxt
="no"
475 --disable-altivec
) altivec
="no"
477 --enable-gprof
) gprof
="yes"
479 --disable-v4l
) v4l
="no"
481 --disable-bktr
) bktr
="no"
483 --disable-audio-oss
) audio_oss
="no"
485 --disable-audio-beos
) audio_beos
="no"
486 extralibs
="$extralibs -lbe -lmedia"
488 --disable-dv1394
) dv1394
="no"
490 --disable-network
) network
="no"; ffserver
="no"
492 --disable-zlib
) zlib
="no"
494 --disable-lzo
) lzo
="no"
496 --enable-a52
) a52
="yes"
498 --enable-a52bin
) a52bin
="yes"
500 --enable-dts
) dts
="yes"
501 extralibs
="$extralibs -ldts"
503 --enable-pp
) pp
="yes"
505 --enable-libgsm
) libgsm
="yes"
506 extralibs
="$extralibs -lgsm"
508 --enable-mp3lame
) mp3lame
="yes"
509 extralibs
="$extralibs -lmp3lame"
511 --enable-libogg
) libogg
="yes"
512 extralibs
="$extralibs -logg"
513 pkg_requires
="$pkg_requires ogg >= 1.1"
515 --enable-vorbis
) vorbis
="yes"
516 extralibs
="$extralibs -lvorbis -lvorbisenc"
517 pkg_requires
="$pkg_requires vorbis vorbisenc"
519 --enable-theora
) theora
="yes"
520 extralibs
="$extralibs -ltheora"
521 pkg_requires
="$pkg_requires theora"
523 --enable-faad
) faad
="yes"
524 extralibs
="$extralibs -lfaad"
526 --enable-faadbin
) faadbin
="yes"
528 --enable-faac
) faac
="yes"
529 extralibs
="$extralibs -lfaac"
531 --enable-xvid
) xvid
="yes"
532 extralibs
="$extralibs -lxvidcore"
534 --enable-x264
) x264
="yes"
535 extralibs
="$extralibs -lx264"
537 --enable-dc1394
) dc1394
="yes"
538 extralibs
="$extralibs -ldc1394_control -lraw1394"
539 pkg_requires
="$pkg_requires libraw1394"
541 --disable-vhook
) vhook
="no"
543 --disable-simple_idct
) simpleidct
="no"
545 --enable-mingw32
) mingw32
="yes"
547 --enable-shared
) lshared
="yes"
549 --disable-debug
) debug
="no"
551 --disable-opts
) optimize
="no"
553 --disable-mpegaudio-hp
) mpegaudio_hp
="no"
555 --disable-ffserver
) ffserver
="no"
557 --disable-ffplay
) ffplay
="no"
559 --enable-small
) optimize
="small"
561 --enable-amr_nb
) amr_nb
="yes"
563 --enable-amr_nb-fixed
) amr_nb_fixed
="yes"
565 --enable-amr_wb
) amr_wb
="yes"
567 --enable-amr_if2
) amr_if2
="yes"
569 --enable-sunmlib
) sunmlib
="yes"
571 --enable-pthreads
) pthreads
="yes"
573 --enable-gpl
) gpl
="yes"
575 --enable-memalign-hack
) memalignhack
="yes"
577 --disable-strip
) dostrip
="no"
579 --enable-encoder
=*) CODEC_LIST
="$CODEC_LIST ${opt#--enable-encoder=}_encoder"
581 --enable-decoder
=*) CODEC_LIST
="$CODEC_LIST ${opt#--enable-decoder=}_decoder"
583 --disable-encoder
=*) CODEC_LIST
="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-encoder=}_encoder##\"`"
585 --disable-decoder
=*) CODEC_LIST
="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-decoder=}_decoder##\"`"
587 --disable-encoders
) CODEC_LIST
="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
589 --disable-decoders
) CODEC_LIST
="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
591 --disable-muxers
) muxers
="no"
593 --disable-demuxers
) demuxers
="no"
596 echo "Unknown option \"$opt\"."
597 echo "See $0 --help for available options."
603 if test "$theora" = "yes" ; then
604 if test "$libogg" = "no"; then
605 echo "libogg must be enabled to enable Theora."
611 if test "$vorbis" = "yes" ; then
612 if test "$libogg" = "no"; then
613 echo "libogg must be enabled to enable Vorbis."
619 if test "$gpl" != "yes"; then
620 if test "$pp" != "no"; then
621 echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
625 if test "$a52" != "no" -o
"$a52bin" != "no"; then
626 echo "liba52 is under GPL and --enable-gpl is not specified."
630 if test "$xvid" != "no"; then
631 echo "libxvidcore is under GPL and --enable-gpl is not specified."
635 if test "$x264" != "no"; then
636 echo "x264 is under GPL and --enable-gpl is not specified."
640 if test "$dts" != "no"; then
641 echo "libdts is under GPL and --enable-gpl is not specified."
645 if test "$faad" != "no" -o
"$faadbin" != "no"; then
648 int main( void ) { return 0; }
651 if $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null
; then
654 #ifndef FAAD2_VERSION
657 int main( void ) { return 0; }
659 if $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null
; then
660 echo "FAAD2 is under GPL and --enable-gpl is not specified."
666 echo "FAAD test failed."
671 if test "$fail" = "yes"; then
677 if test $mmx = "default"; then
678 if test $cpu = "x86" -o
$cpu = "x86_64"; then
685 # check iwmmxt support
686 if test $iwmmxt = "default" -a
$cpu = "armv4l"; then
689 __asm__ __volatile__ ("wunpckelub wr6, wr4");
694 if ${cross_prefix}${cc} -o
$TMPO $TMPC 2> /dev
/null
; then
700 needmdynamicnopic
="no"
701 if test $targetos = Darwin
; then
702 if test -n
"`$cc -v 2>&1 | grep xlc`"; then
703 CFLAGS
="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
705 gcc_version
="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
706 case "$gcc_version" in
708 CFLAGS
="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
711 CFLAGS
="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
712 if test "$lshared" = no
; then
713 needmdynamicnopic
="yes"
717 CFLAGS
="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
718 if test "$lshared" = no
; then
719 needmdynamicnopic
="yes"
726 # Can only do AltiVec on PowerPC
727 if test $altivec = "default"; then
728 if test $cpu = "powerpc"; then
735 # Add processor-specific flags
738 if test $tune != "generic"; then
740 601|ppc601|PowerPC601
)
741 CFLAGS
="$CFLAGS -mcpu=601"
742 if test $altivec = "yes"; then
743 echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
747 603*|ppc603
*|PowerPC603
*)
748 CFLAGS
="$CFLAGS -mcpu=603"
749 if test $altivec = "yes"; then
750 echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
754 604*|ppc604
*|PowerPC604
*)
755 CFLAGS
="$CFLAGS -mcpu=604"
756 if test $altivec = "yes"; then
757 echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
761 G3|g3|
75*|ppc75
*|PowerPC75
*)
762 CFLAGS
="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
763 if test $altivec = "yes"; then
764 echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
768 G4|g4|
745*|ppc745
*|PowerPC745
*)
769 CFLAGS
="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
770 if test $altivec = "no"; then
771 echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
775 74*|ppc74
*|PowerPC74
*)
776 CFLAGS
="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
777 if test $altivec = "no"; then
778 echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
782 G5|g5|
970|ppc970|PowerPC970|power4
*|Power4
*)
783 CFLAGS
="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
784 if test $altivec = "no"; then
785 echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
790 i
[3456]86|pentium|pentiumpro|pentium-mmx|pentium
[234]|prescott|k6|k6-
[23]|athlon|athlon-tbird|athlon-4|athlon-
[mx
]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx
)
791 CFLAGS
="$CFLAGS -march=$tune"
794 echo "WARNING: Unknown CPU \"$tune\", ignored."
799 # AltiVec flags: The FSF version of GCC differs from the Apple version
800 if test $cpu = "powerpc"; then
801 if test $altivec = "yes"; then
802 if test -n
"`$cc -v 2>&1 | grep version | grep Apple`"; then
803 CFLAGS
="$CFLAGS -faltivec"
805 CFLAGS
="$CFLAGS -maltivec -mabi=altivec"
810 # check if we have <altivec.h>
813 int main( void ) { return 0; }
817 if $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null
; then
821 # check if our compiler supports Motorola AltiVec C API
822 if test $altivec = "yes"; then
823 if test $_altivec_h = "yes"; then
827 vector signed int v1, v2, v3;
835 vector signed int v1, v2, v3;
841 $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null || altivec
="no"
844 # mmi only available on mips
845 if test $mmi = "default"; then
846 if test $cpu = "mips"; then
853 # check if our compiler supports mmi
854 if test $mmi = "yes"; then
857 __asm__ ("lq \$2, 0(\$2)");
861 $cc -o
$TMPE $TMPC 2> /dev
/null || mmi
="no"
864 if test "$mingw32" = "yes" ; then
875 if test "$force_prefix" != yes; then prefix
="/c/Program Files/FFmpeg"; fi
876 if test "$force_libdir" != yes; then bindir
="$prefix"; fi
879 cc
="${cross_prefix}${cc}"
880 ar="${cross_prefix}${ar}"
881 ranlib
="${cross_prefix}${ranlib}"
882 strip
="${cross_prefix}${strip}"
884 if test -z
"$cross_prefix" ; then
887 # big/little-endian test
889 #include <inttypes.h>
890 int main(int argc, char ** argv){
891 volatile uint32_t i=0x01234567;
892 return (*((uint8_t*)(&i))) == 0x67;
896 if $cc -o
$TMPE $TMPC 2>/dev
/null
; then
897 $TMPE && bigendian
="yes"
899 echo big
/little
test failed
904 # programs cannot be launched if cross compiling, so make a static guess
905 if test "$cpu" = "powerpc" -o
"$cpu" = "mips" ; then
914 #include <inttypes.h>
915 int main(int argc, char ** argv){
920 $cc -o
$TMPE $TMPC 2>/dev
/null || inttypes
="no"
925 #include <inttypes.h>
926 int main(int argc, char ** argv){
927 volatile uint_fast64_t i=0x01234567;
932 $cc -o
$TMPE $TMPC 2>/dev
/null || emu_fast_int
="yes"
935 # check availability of some header files
939 int main( void ) { return 0; }
944 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
947 # check for memalign - atmos
953 string = memalign(64, sizeof(char));
957 $cc -o
$TMPE $TMPC 2> /dev
/null || _memalign
=no
960 if test "$_memalign" = "no" -a
"$mmx" = "yes" -a
"$memalignhack" != "yes"; then
961 echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
967 int main( void ) { localtime_r(NULL, NULL); }
971 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
975 if test "$zlib" = "yes"; then
976 # check for zlib - mmu_man
980 if (zlibVersion() != ZLIB_VERSION)
981 puts("zlib version differs !!!");
986 $cc $CFLAGS $LDFLAGS -o
$TMPE $TMPC -lz
2> /dev
/null || zlib
="no"
987 # $TMPE 2> /dev/null > /dev/null || zlib="no"
988 # XXX: more tests needed - runtime test
990 if test "$zlib" = "yes"; then
991 extralibs
="$extralibs -lz"
994 if test "$lzo" = "yes" -a
"$gpl" = "yes"; then
1003 $cc $CFLAGS $LDFLAGS -o
$TMPE $TMPC -llzo
2> /dev
/null || lzo
="no"
1007 if test "$lzo" = "yes"; then
1008 extralibs
="$extralibs -llzo"
1011 # test for lrintf in math.h
1013 #define _ISOC9X_SOURCE 1
1015 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1019 if $cc $CFLAGS $LDFLAGS $extralibs -o
$TMPE $TMPC 2> /dev
/null
; then
1021 # allanc@chickenandporn.com: cannot execute cross-compiled
1022 # code on the host. Only execute if not cross-compiling.
1023 if test -z
"$cross_prefix" ; then
1024 $TMPE 2> /dev
/null
> /dev
/null || have_lrintf
="no"
1029 for restrict_keyword
in restrict __restrict__ __restrict
; do
1030 echo "void foo(char * $restrict_keyword p);" > $TMPC
1031 if $cc -c
-o
$TMPO $TMPC 2> /dev
/null
; then
1032 _restrict
=$restrict_keyword
1037 # test gcc version to see if vector builtins can be used
1038 # currently only used on i386 for MMX builtins
1040 #include <xmmintrin.h>
1042 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
1045 #error no vector builtins
1051 if $cc -msse
-o
$TMPO $TMPC 2> /dev
/null
; then
1055 # Probe for -Wdeclaration-after-statement
1056 if test "$cc" = "gcc"; then
1058 int main( void ) { return 0; }
1061 if $cc -Wdeclaration-after-statement
-Werror
-o
$TMPE $TMPC 2> /dev
/null
; then
1062 CFLAGS
="$CFLAGS -Wdeclaration-after-statement"
1066 # dlopen/dlfcn.h probing
1070 int main( void ) { return (int) dlopen("foo", 0); }
1075 if $cc $CFLAGS $LDFLAGS -o
$TMPE $TMPC -ldl
> /dev
/null
2>&1 ; then
1080 if $cc $CFLAGS $LDFLAGS -o
$TMPE $TMPC > /dev
/null
2>&1 ; then
1087 int main( void ) { return (int) dlopen("foo", 0); }
1090 if $cc $CFLAGS $LDFLAGS -o
$TMPE $TMPC -ldl
> /dev
/null
2>&1 ; then
1094 if $cc $CFLAGS $LDFLAGS -o
$TMPE $TMPC > /dev
/null
2>&1 ; then
1099 if test "$vhook" = "default" ; then
1103 if test "$vhook" = "yes" -o
"$a52bin" = "yes" -o
"$faadbin" = "yes"; then
1104 extralibs
="$extralibs $ldl"
1108 ##########################################
1112 #include <X11/Xlib.h>
1114 int main( void ) { return (int) imlib_load_font("foo"); }
1118 if $cc $CFLAGS $LDFLAGS -o
$TMPE $TMPC -lImlib2
-lm
> /dev
/null
2>&1 ; then
1122 ##########################################
1126 #include <ft2build.h>
1127 int main( void ) { return (int) FT_Init_FreeType(0); }
1131 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1132 if (freetype-config
--version
) >/dev
/null
2>&1 ; then
1133 if $cc -o
$TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev
/null
2>&1 ; then
1139 ##########################################
1144 #undef main /* We don't want SDL to override our main() */
1145 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1150 if (sdl-config
--version
) >/dev
/null
2>&1 ; then
1151 if $cc -o
$TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev
/null
2>&1 ; then
1152 _sdlversion
=`sdl-config --version | sed 's/[^0-9]//g'`
1153 if test "$_sdlversion" -lt
121 ; then
1161 ##########################################
1165 if (texi2html
-version
) >/dev
/null
2>&1; then
1169 if test "$network" = "yes" ; then
1170 ##########################################
1174 #include <sys/types.h>
1175 #include <sys/socket.h>
1176 #include <netinet/in.h>
1179 struct sockaddr_storage saddr;
1180 struct ipv6_mreq mreq6;
1181 getaddrinfo(0,0,0,0);
1182 getnameinfo(0,0,0,0,0,0,0);
1183 IN6_IS_ADDR_MULTICAST(0);
1188 if $cc -o
$TMPE $TMPC > /dev
/null
2>&1 ; then
1193 case "`$cc -v 2>&1 | grep version`" in
1195 CFLAGS
="-Wall -Wno-switch $CFLAGS"
1201 if test "$sdl" = "no" ; then
1205 if test "$debug" = "yes"; then
1209 if test "$optimize" = "small"; then
1210 # CFLAGS=${CFLAGS//-O3/-Os}
1211 CFLAGS
="$CFLAGS -Os"
1214 if test "$optimize" = "yes"; then
1215 if test -n
"`$cc -v 2>&1 | grep xlc`"; then
1216 CFLAGS
="$CFLAGS -O5"
1217 LDFLAGS
="$LDFLAGS -O5"
1219 CFLAGS
="-O3 $CFLAGS"
1223 # PIC flags for shared library objects where they are needed
1224 if test "$lshared" = "yes" ; then
1225 # LIBOBJFLAGS may have already been set in the OS configuration
1226 if test -z
"$LIBOBJFLAGS" ; then
1227 if test "$cpu" = "x86_64" -o
"$cpu" = "ia64" -o
"$cpu" = "alpha" ; then
1228 LIBOBJFLAGS
="\$(PIC)"
1233 if test x
"$bindir" = x
""; then
1234 bindir
="${prefix}/bin"
1237 if test x
"$libdir" = x
""; then
1238 libdir
="${prefix}/lib"
1241 if test x
"$mandir" = x
""; then
1242 mandir
="${prefix}/man"
1245 echo "install prefix $prefix"
1246 echo "source path $source_path"
1247 echo "C compiler $cc"
1249 echo "CPU $cpu ($tune)"
1250 if test "$BUILDSUF" != ""; then
1251 echo "build suffix $BUILDSUF"
1253 echo "big-endian $bigendian"
1254 echo "inttypes.h $inttypes"
1255 echo "broken inttypes.h $emu_fast_int"
1256 if test $cpu = "x86" -o
$cpu = "x86_64"; then
1257 echo "MMX enabled $mmx"
1258 echo "Vector Builtins $builtin_vector"
1260 if test $cpu = "armv4l"; then
1261 echo "IWMMXT enabled $iwmmxt"
1263 if test $cpu = "mips"; then
1264 echo "MMI enabled $mmi"
1266 if test $cpu = "powerpc"; then
1267 echo "AltiVec enabled $altivec"
1269 echo "gprof enabled $gprof"
1270 echo "zlib enabled $zlib"
1271 echo "lzo enabled $lzo"
1272 echo "libgsm enabled $libgsm"
1273 echo "mp3lame enabled $mp3lame"
1274 echo "libogg enabled $libogg"
1275 echo "Vorbis enabled $vorbis"
1276 echo "Theora enabled $theora"
1277 echo "FAAD enabled $faad"
1278 echo "faadbin enabled $faadbin"
1279 echo "FAAC enabled $faac"
1280 echo "XviD enabled $xvid"
1281 echo "x264 enabled $x264"
1282 echo "a52 support $a52"
1283 echo "a52 dlopened $a52bin"
1284 echo "DTS support $dts"
1285 echo "pp support $pp"
1286 echo "debug symbols $debug"
1287 echo "strip symbols $dostrip"
1288 echo "optimize $optimize"
1289 echo "shared $shared"
1290 echo "video hooking $vhook"
1291 echo "SDL support $sdl"
1292 if test $sdl_too_old = "yes"; then
1293 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1296 if test "$vhook" = "yes" ; then
1297 echo "Imlib2 support $imlib2"
1298 echo "FreeType support $freetype2"
1300 echo "Sun medialib support" $sunmlib
1301 echo "pthreads support" $pthreads
1302 echo "AMR-NB float support" $amr_nb
1303 echo "AMR-NB fixed support" $amr_nb_fixed
1304 echo "AMR-WB float support" $amr_wb
1305 echo "AMR-WB IF2 support" $amr_if2
1306 echo "network support $network"
1307 if test "$network" = "yes" ; then
1308 echo "IPv6 support $ipv6"
1310 if test "$gpl" = "no" ; then
1311 echo "License: LGPL"
1316 echo "Creating config.mak and config.h..."
1319 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1320 echo "# Automatically generated by configure - do not modify!" > config.mak
1321 echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1322 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1324 echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1325 echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1326 echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1327 echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1328 echo "MAKE=$make" >> config.mak
1329 echo "CC=$cc" >> config.mak
1330 echo "AR=$ar" >> config.mak
1331 echo "RANLIB=$ranlib" >> config.mak
1332 if test "$dostrip" = "yes" ; then
1333 echo "STRIP=$strip" >> config.mak
1334 echo "INSTALLSTRIP=$installstrip" >> config.mak
1336 echo "STRIP=echo ignoring strip" >> config.mak
1337 echo "INSTALLSTRIP=" >> config.mak
1340 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1341 # shared modules on OS/X (vhook/Makefile).
1343 if test "$needmdynamicnopic" = yes; then
1344 CFLAGS
="$CFLAGS -mdynamic-no-pic"
1347 echo "OPTFLAGS=$CFLAGS" >> config.mak
1348 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1349 echo "LDFLAGS=$LDFLAGS" >> config.mak
1350 echo "LDCONFIG=$LDCONFIG" >> config.mak
1351 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1352 echo "SHFLAGS=$SHFLAGS" >> config.mak
1353 echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1354 echo "BUILDSUF=$BUILDSUF" >> config.mak
1355 echo "LIBPREF=$LIBPREF" >> config.mak
1356 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1357 echo "LIB=$LIB" >> config.mak
1358 echo "SLIBPREF=$SLIBPREF" >> config.mak
1359 echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1360 echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1361 echo "TARGET_OS=$TARGET_OS" >> config.mak
1362 if test "$cpu" = "x86" ; then
1363 echo "TARGET_ARCH_X86=yes" >> config.mak
1364 echo "#define ARCH_X86 1" >> $TMPH
1365 elif test "$cpu" = "x86_64" ; then
1366 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1367 echo "#define ARCH_X86_64 1" >> $TMPH
1368 elif test "$cpu" = "armv4l" ; then
1369 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1370 echo "#define ARCH_ARMV4L 1" >> $TMPH
1371 elif test "$cpu" = "alpha" ; then
1372 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1373 echo "#define ARCH_ALPHA 1" >> $TMPH
1374 elif test "$cpu" = "sparc64" ; then
1375 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1376 echo "#define ARCH_SPARC64 1" >> $TMPH
1377 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1378 echo "#define ARCH_SPARC 1" >> $TMPH
1379 elif test "$cpu" = "sparc" ; then
1380 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1381 echo "#define ARCH_SPARC 1" >> $TMPH
1382 elif test "$cpu" = "powerpc" ; then
1383 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1384 echo "#define ARCH_POWERPC 1" >> $TMPH
1385 if test $POWERPCMODE = "32bits"; then
1386 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1388 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1390 if test "$powerpc_perf" = "yes"; then
1391 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1393 elif test "$cpu" = "mips" ; then
1394 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1395 echo "#define ARCH_MIPS 1" >> $TMPH
1396 elif test "$cpu" = "sh4" ; then
1397 echo "TARGET_ARCH_SH4=yes" >> config.mak
1398 echo "#define ARCH_SH4 1" >> $TMPH
1399 elif test "$cpu" = "parisc" ; then
1400 echo "TARGET_ARCH_PARISC=yes" >> config.mak
1401 echo "#define ARCH_PARISC 1" >> $TMPH
1402 elif test "$cpu" = "s390" ; then
1403 echo "TARGET_ARCH_S390=yes" >> config.mak
1404 echo "#define ARCH_S390 1" >> $TMPH
1405 elif test "$cpu" = "m68k" ; then
1406 echo "TARGET_ARCH_M68K=yes" >> config.mak
1407 echo "#define ARCH_M68K 1" >> $TMPH
1408 elif test "$cpu" = "ia64" ; then
1409 echo "TARGET_ARCH_IA64=yes" >> config.mak
1410 echo "#define ARCH_IA64 1" >> $TMPH
1412 echo "#define TUNECPU $TUNECPU" >> $TMPH
1413 if test "$bigendian" = "yes" ; then
1414 echo "WORDS_BIGENDIAN=yes" >> config.mak
1415 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1417 if test "$inttypes" != "yes" ; then
1418 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1420 if test "$emu_fast_int" = "yes" ; then
1421 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1423 if test "$mmx" = "yes" ; then
1424 echo "TARGET_MMX=yes" >> config.mak
1425 echo "#define HAVE_MMX 1" >> $TMPH
1426 echo "#define __CPU__ 586" >> $TMPH
1428 if test "$builtin_vector" = "yes" ; then
1429 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1430 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1432 if test "$iwmmxt" = "yes" ; then
1433 echo "TARGET_IWMMXT=yes" >> config.mak
1434 echo "#define HAVE_IWMMXT 1" >> $TMPH
1436 if test "$mmi" = "yes" ; then
1437 echo "TARGET_MMI=yes" >> config.mak
1438 echo "#define HAVE_MMI 1" >> $TMPH
1440 if test "$altivec" = "yes" ; then
1441 echo "TARGET_ALTIVEC=yes" >> config.mak
1442 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1443 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1444 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1445 if test "$_altivec_h" = "yes" ; then
1446 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1448 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1451 if test "$gprof" = "yes" ; then
1452 echo "TARGET_GPROF=yes" >> config.mak
1453 echo "#define HAVE_GPROF 1" >> $TMPH
1455 if test "$localtime_r" = "yes" ; then
1456 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1458 if test "$imlib2" = "yes" ; then
1459 echo "HAVE_IMLIB2=yes" >> config.mak
1461 if test "$freetype2" = "yes" ; then
1462 echo "HAVE_FREETYPE2=yes" >> config.mak
1464 if test "$sunmlib" = "yes" ; then
1465 echo "HAVE_MLIB=yes" >> config.mak
1466 echo "#define HAVE_MLIB 1" >> $TMPH
1467 extralibs
="$extralibs -lmlib"
1469 if test "$pthreads" = "yes" ; then
1470 echo "HAVE_PTHREADS=yes" >> config.mak
1471 echo "#define HAVE_PTHREADS 1" >> $TMPH
1472 echo "#define HAVE_THREADS 1" >> $TMPH
1473 if test $targetos != FreeBSD
-a
$targetos != OpenBSD
; then
1474 extralibs
="$extralibs -lpthread"
1477 if test "$sdl" = "yes" ; then
1478 echo "CONFIG_SDL=yes" >> config.mak
1479 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1480 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1482 if test "$texi2html" = "yes"; then
1483 echo "BUILD_DOC=yes" >> config.mak
1485 if test "$have_lrintf" = "yes" ; then
1486 echo "#define HAVE_LRINTF 1" >> $TMPH
1488 if test "$vhook" = "yes" ; then
1489 echo "BUILD_VHOOK=yes" >> config.mak
1490 echo "#define HAVE_VHOOK 1" >> $TMPH
1493 lavc_version
=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1494 lavf_version
=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1495 lavu_version
=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1499 if test "$lshared" = "yes" ; then
1500 echo "BUILD_SHARED=yes" >> config.mak
1501 echo "PIC=-fPIC -DPIC" >> config.mak
1502 echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
1503 echo "SPPVERSION=$lavc_version" >> config.mak
1504 echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
1505 echo "LAVCVERSION=$lavc_version" >> config.mak
1506 echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
1507 echo "LAVFVERSION=$lavf_version" >> config.mak
1508 echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
1509 echo "LAVUVERSION=$lavu_version" >> config.mak
1510 echo "SLIBNAME=${SLIBNAME}" >> config.mak
1511 echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1512 echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
1514 echo "EXTRALIBS=$extralibs" >> config.mak
1515 version
=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1517 echo "VERSION=$version" >>config.mak
1518 # If you do not want to use encoders, disable them.
1519 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1520 echo "CONFIG_ENCODERS=yes" >> config.mak
1522 # If you do not want to use decoders, disable them.
1523 echo "#define CONFIG_DECODERS 1" >> $TMPH
1524 echo "CONFIG_DECODERS=yes" >> config.mak
1527 if test "$muxers" = "yes" ; then
1528 echo "#define CONFIG_MUXERS 1" >> $TMPH
1529 echo "CONFIG_MUXERS=yes" >> config.mak
1533 if test "$demuxers" = "yes" ; then
1534 echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1535 echo "CONFIG_DEMUXERS=yes" >> config.mak
1539 if test "$a52" = "yes" ; then
1540 echo "#define CONFIG_AC3 1" >> $TMPH
1541 echo "CONFIG_AC3=yes" >> config.mak
1543 if test "$a52bin" = "yes" ; then
1544 echo "#define CONFIG_A52BIN 1" >> $TMPH
1545 echo "CONFIG_A52BIN=yes" >> config.mak
1550 if test "$dts" = "yes" ; then
1551 echo "#define CONFIG_DTS 1" >> $TMPH
1552 echo "CONFIG_DTS=yes" >> config.mak
1556 if test "$pp" = "yes" ; then
1557 echo "#define CONFIG_PP 1" >> $TMPH
1558 echo "CONFIG_PP=yes" >> config.mak
1561 # MPEG audio high precision mode
1562 if test "$mpegaudio_hp" = "yes" ; then
1563 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1566 if test "$v4l" = "yes" ; then
1567 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1568 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1571 if test "$bktr" = "yes" ; then
1572 echo "#define CONFIG_BKTR 1" >> $TMPH
1573 echo "CONFIG_BKTR=yes" >> config.mak
1576 if test "$dv1394" = "yes" ; then
1577 echo "#define CONFIG_DV1394 1" >> $TMPH
1578 echo "CONFIG_DV1394=yes" >> config.mak
1581 if test "$dc1394" = "yes" ; then
1582 echo "#define CONFIG_DC1394 1" >> $TMPH
1583 echo "CONFIG_DC1394=yes" >> config.mak
1586 if test "$dlopen" = "yes" ; then
1587 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1590 if test "$dlfcn" = "yes" ; then
1591 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1594 if test "$audio_oss" = "yes" ; then
1595 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1596 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1599 if test "$audio_beos" = "yes" ; then
1600 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1601 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1604 if test "$network" = "yes" ; then
1605 echo "#define CONFIG_NETWORK 1" >> $TMPH
1606 echo "CONFIG_NETWORK=yes" >> config.mak
1609 if test "$ipv6" = "yes" ; then
1610 echo "#define CONFIG_IPV6 1" >> $TMPH
1613 if test "$zlib" = "yes" ; then
1614 echo "#define CONFIG_ZLIB 1" >> $TMPH
1615 echo "CONFIG_ZLIB=yes" >> config.mak
1618 if test "$lzo" = "yes" ; then
1619 echo "#define CONFIG_LZO 1" >> $TMPH
1620 echo "CONFIG_LZO=yes" >> config.mak
1623 if test "$libgsm" = "yes" ; then
1624 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1625 echo "CONFIG_LIBGSM=yes" >> config.mak
1628 if test "$mp3lame" = "yes" ; then
1629 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1630 echo "CONFIG_MP3LAME=yes" >> config.mak
1633 if test "$libogg" = "yes" ; then
1634 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1635 echo "CONFIG_LIBOGG=yes" >> config.mak
1638 if test "$vorbis" = "yes" ; then
1639 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1640 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1643 if test "$theora" = "yes" ; then
1644 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1645 echo "CONFIG_LIBTHEORA=yes" >> config.mak
1648 if test "$faad" = "yes" ; then
1649 echo "#define CONFIG_FAAD 1" >> $TMPH
1650 echo "CONFIG_FAAD=yes" >> config.mak
1653 if test "$faadbin" = "yes" ; then
1654 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1655 echo "CONFIG_FAADBIN=yes" >> config.mak
1658 if test "$faac" = "yes" ; then
1659 echo "#define CONFIG_FAAC 1" >> $TMPH
1660 echo "CONFIG_FAAC=yes" >> config.mak
1663 if test "$xvid" = "yes" ; then
1664 echo "#define CONFIG_XVID 1" >> $TMPH
1665 echo "CONFIG_XVID=yes" >> config.mak
1668 if test "$x264" = "yes" ; then
1669 echo "#define CONFIG_X264 1" >> $TMPH
1670 echo "CONFIG_X264=yes" >> config.mak
1673 if test "$mingw32" = "yes" ; then
1674 echo "#define CONFIG_WIN32 1" >> $TMPH
1675 echo "CONFIG_WIN32=yes" >> config.mak
1676 echo "HAVE_W32THREADS=yes" >> config.mak
1677 echo "#define HAVE_W32THREADS 1" >> $TMPH
1678 echo "#define HAVE_THREADS 1" >> $TMPH
1679 echo "#ifndef __MINGW32__" >> $TMPH
1680 echo "#define __MINGW32__ 1" >> $TMPH
1681 echo "#endif" >> $TMPH
1684 if test "$os2" = "yes" ; then
1685 echo "#define CONFIG_OS2 1" >> $TMPH
1686 echo "CONFIG_OS2=yes" >> config.mak
1689 if test "$TARGET_OS" = "SunOS" ; then
1690 echo "#define CONFIG_SUNOS 1" >> $TMPH
1693 if test "$TARGET_OS" = "BeOS" ; then
1694 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1695 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1696 echo "#define HAVE_THREADS 1" >> $TMPH
1699 if test "$darwin" = "yes"; then
1700 echo "#define CONFIG_DARWIN 1" >> $TMPH
1701 echo "CONFIG_DARWIN=yes" >> config.mak
1704 if test "$_malloc_h" = "yes" ; then
1705 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1707 echo "#undef HAVE_MALLOC_H" >> $TMPH
1710 if test "$_memalign" = "yes" ; then
1711 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1713 echo "#undef HAVE_MEMALIGN" >> $TMPH
1716 if test "$memalignhack" = "yes" ; then
1717 echo "#define MEMALIGN_HACK 1" >> $TMPH
1721 if test "$netserver" = "yes" ; then
1722 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1723 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1726 if test "$need_inet_aton" = "yes" ; then
1727 echo "NEED_INET_ATON=yes" >> config.mak
1730 if test "$simpleidct" = "yes" ; then
1731 echo "#define SIMPLE_IDCT 1" >> $TMPH
1734 if test "$ffserver" = "yes" ; then
1735 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1736 echo "CONFIG_FFSERVER=yes" >> config.mak
1739 if test "$ffplay" = "yes" ; then
1740 echo "CONFIG_FFPLAY=yes" >> config.mak
1743 if test "$gpl" = "yes" ; then
1744 echo "#define CONFIG_GPL 1" >> $TMPH
1745 echo "CONFIG_GPL=yes" >> config.mak
1748 echo "#define restrict $_restrict" >> $TMPH
1750 if test "$optimize" = "small"; then
1751 echo "#define always_inline" >> $TMPH
1754 # build tree in object directory if source path is different from current one
1755 if test "$source_path_used" = "yes" ; then
1767 libavcodec/libpostproc \
1774 libavformat/Makefile \
1775 libavcodec/Makefile \
1776 libavcodec/libpostproc/Makefile \
1777 libavutil/Makefile \
1783 for dir
in $DIRS ; do
1786 for f
in $FILES ; do
1787 ln -sf
"$source_path/$f" $f
1789 echo "SRC_PATH=$source_path" >> config.mak
1791 echo "SRC_PATH='$source_path'" >> config.mak
1794 if test "$amr_wb" = "yes" ; then
1795 echo "#define AMR_WB 1" >> $TMPH
1796 echo "AMR_WB=yes" >> config.mak
1798 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1800 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1801 echo "and extracted the source to libavcodec/amrwb_float"
1805 if test "$amr_nb" = "yes" ; then
1806 echo "#define AMR_NB 1" >> $TMPH
1807 echo "AMR_NB=yes" >> config.mak
1809 if test "$amr_nb_fixed" = "yes" ; then
1810 echo "AMR_NB_FIXED=yes" >> config.mak
1811 echo "#define AMR_NB_FIXED 1" >> $TMPH
1812 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1813 echo "REL-5 version 5.1.0 from "
1814 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1815 echo "and extracted src to libavcodec/amr"
1816 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1817 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1820 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1821 echo "REL-5 V5.1.0 from "
1822 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1823 echo "and extracted the source to libavcodec/amr_float"
1824 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1828 if test "$amr_if2" = "yes" ; then
1829 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1834 for codec
in $CODEC_LIST ; do
1835 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1836 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1839 diff $TMPH config.h
>/dev
/null
2>&1
1840 if test $?
-ne
0 ; then
1841 mv -f
$TMPH config.h
1843 echo "config.h is unchanged"
1846 rm -f
$TMPO $TMPC $TMPE $TMPS $TMPH
1849 # build pkg-config files libav*.pc and libpostproc.pc
1851 cat <<EOF >libavutil.pc
1853 exec_prefix=\${prefix}
1854 libdir=\${exec_prefix}/lib
1855 includedir=\${prefix}/include
1858 Description: FFmpeg utility library
1859 Version: $lavu_version
1862 Libs: -L\${libdir} -lavutil
1863 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1866 cat <<EOF >libavutil-uninstalled.pc
1869 libdir=\${pcfiledir}/libavutil
1870 includedir=\${pcfiledir}/libavutil
1873 Description: FFmpeg utility library
1874 Version: $lavu_version
1877 Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1878 Cflags: -I\${includedir}
1882 cat <<EOF >libavcodec.pc
1884 exec_prefix=\${prefix}
1885 libdir=\${exec_prefix}/lib
1886 includedir=\${prefix}/include
1889 Description: FFmpeg codec library
1890 Version: $lavc_version
1891 Requires: $pkg_requires libavutil = $lavu_version
1893 Libs: -L\${libdir} -lavcodec $extralibs
1894 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1897 cat <<EOF >libavcodec-uninstalled.pc
1900 libdir=\${pcfiledir}/libavcodec
1901 includedir=\${pcfiledir}/libavcodec
1904 Description: FFmpeg codec library
1905 Version: $lavc_version
1906 Requires: $pkg_requires libavutil = $lavu_version
1908 Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1909 Cflags: -I\${includedir}
1913 cat <<EOF >libavformat.pc
1915 exec_prefix=\${prefix}
1916 libdir=\${exec_prefix}/lib
1917 includedir=\${prefix}/include
1920 Description: FFmpeg container format library
1921 Version: $lavf_version
1922 Requires: $pkg_requires libavcodec = $lavc_version
1924 Libs: -L\${libdir} -lavformat $extralibs
1925 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1928 cat <<EOF >libavformat-uninstalled.pc
1931 libdir=\${pcfiledir}/libavformat
1932 includedir=\${pcfiledir}/libavformat
1935 Description: FFmpeg container format library
1936 Version: $lavf_version
1937 Requires: $pkg_requires libavcodec = $lavc_version
1939 Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1940 Cflags: -I\${includedir}
1945 cat <<EOF >libpostproc.pc
1947 exec_prefix=\${prefix}
1948 libdir=\${exec_prefix}/lib
1949 includedir=\${prefix}/include
1952 Description: FFmpeg post processing library
1953 Version: $lavc_version
1956 Libs: -L\${libdir} -lpostproc
1957 Cflags: -I\${includedir} -I\${includedir}/postproc
1960 cat <<EOF >libpostproc-uninstalled.pc
1963 libdir=\${pcfiledir}/libavcodec/libpostproc
1964 includedir=\${pcfiledir}/libavcodec/libpostproc
1967 Description: FFmpeg post processing library
1968 Version: $lavc_version
1971 Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1972 Cflags: -I\${includedir}