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-pp use libpostproc.so [default=no]"
34 echo " --enable-shared build shared libraries [default=no]"
35 echo " --enable-amr_nb enable amr_nb float audio codec"
36 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
37 echo " --enable-amr_wb enable amr_wb float audio codec"
38 echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
39 echo " --enable-sunmlib use Sun medialib [default=no]"
40 echo " --enable-pthreads use pthreads [default=no]"
41 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
42 echo " and libraw1394 [default=no]"
43 echo " --enable-gpl allow use of GPL code, the resulting libav*"
44 echo " and ffmpeg will be under GPL [default=no]"
46 echo "Advanced options (experts only):"
47 echo " --source-path=PATH path to source code [$source_path]"
48 echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
49 echo " --cc=CC use C compiler CC [$cc]"
50 echo " --make=MAKE use specified make [$make]"
51 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
52 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
53 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
54 echo " --build-suffix=SUFFIX suffix for application specific build []"
55 echo " --cpu=CPU force cpu to CPU [$cpu]"
56 echo " --tune=CPU tune code for a particular CPU"
57 echo " (may fail or perform badly on other CPUs)"
58 echo " --powerpc-perf-enable enable performance report on PPC"
59 echo " (requires enabling PMC)"
60 echo " --disable-mmx disable MMX usage"
61 echo " --disable-iwmmxt disable iwmmxt usage"
62 echo " --disable-altivec disable AltiVec usage"
63 echo " --disable-audio-oss disable OSS audio support [default=no]"
64 echo " --disable-audio-beos disable BeOS audio support [default=no]"
65 echo " --disable-v4l disable video4linux grabbing [default=no]"
66 echo " --disable-bktr disable bktr video grabbing [default=no]"
67 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
68 echo " --disable-network disable network support [default=no]"
69 echo " --disable-zlib disable zlib [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,$@.$(LIBVERSION)'
226 LDFLAGS=-Wl,--warn-common
250 prefix="/boot/home/config"
251 # helps building libavcodec
252 CFLAGS="-DPIC -fomit-frame-pointer"
253 # 3 gcc releases known for BeOS, each with ugly bugs
254 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
255 case "$gcc_version" in
256 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
259 *20010315*) echo "BeBits gcc"
260 CFLAGS="$CFLAGS -fno-expensive-optimizations"
264 # disable Linux things
270 # no need for libm, but the inet stuff
272 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
273 extralibs="-lbind -lsocket"
287 extralibs="$extralibs -lsocket -lnsl"
295 LDFLAGS="$LDFLAGS -export-dynamic"
297 2.*) extralibs="$extralibs -lossaudio"
307 LIBOBJFLAGS="\$(PIC)"
308 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
309 LDCONFIG="ldconfig -m \$(libdir)"
310 extralibs="$extralibs -lossaudio"
319 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
326 extralibs="-lpoll -lgnugetopt -lm"
337 SHFLAGS="-dynamiclib -Wl,-single_module"
342 LDFLAGS="-Wl,-dynamic,-search_paths_first"
344 FFSLDFLAGS=-Wl,-bind_at_load
347 # Note: the rest of the mingw32 config is done afterwards as mingw32
348 # can be forced on the command line for Linux cross compilation.
361 LDFLAGS="$LDFLAGS -rdynamic"
364 ranlib="echo ignoring ranlib"
372 ranlib="echo ignoring ranlib"
373 strip="echo ignoring strip"
375 LDFLAGS="-Zomf -Zstack 16384 -s"
376 SHFLAGS="-Zdll -Zomf"
397 # From MPlayer configure. We need TARGET_OS available
398 # to the Makefile, so it can distinguish between flavors
399 # of AltiVec on PowerPC.
400 TARGET_OS=`( uname -s ) 2>&1`
402 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS)
410 [cC][yY][gG][wW][iI][nN]*)
414 TARGET_OS="$TARGET_OS-UNKNOWN"
419 source_path="`echo $0 | sed -e 's#/configure##'`"
420 source_path_used="yes"
421 if test -z "$source_path" -o "$source_path" = "." ; then
423 source_path_used="no"
425 source_path="`cd \"$source_path\"; pwd`"
428 FFMPEG_CONFIGURATION=" "
430 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
433 CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
437 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
439 --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
441 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
443 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
445 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
447 --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
449 --make=*) make=`echo $opt | cut -d '=' -f 2`
451 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
453 --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
455 --extra-libs=*) extralibs=${opt#--extra-libs=}
457 --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
459 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
461 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
463 --powerpc-perf-enable) powerpc_perf="yes"
465 --disable-mmx) mmx="no"
467 --disable-iwmmxt) iwmmxt="no"
469 --disable-altivec) altivec="no"
471 --enable-gprof) gprof="yes"
473 --disable-v4l) v4l="no"
475 --disable-bktr) bktr="no"
477 --disable-audio-oss) audio_oss="no"
479 --disable-audio-beos) audio_beos="no"
480 extralibs="$extralibs -lbe -lmedia"
482 --disable-dv1394) dv1394="no"
484 --disable-network) network="no"; ffserver="no"
486 --disable-zlib) zlib="no"
488 --enable-a52) a52="yes"
490 --enable-a52bin) a52bin="yes"
492 --enable-dts) dts="yes"
493 extralibs="$extralibs -ldts"
495 --enable-pp) pp="yes"
497 --enable-shared-pp) shared_pp="yes"
499 --enable-libgsm) libgsm="yes"
500 extralibs="$extralibs -lgsm"
502 --enable-mp3lame) mp3lame="yes"
503 extralibs="$extralibs -lmp3lame"
505 --enable-libogg) libogg="yes"
506 extralibs="$extralibs -logg"
507 pkg_requires="$pkg_requires ogg >= 1.1"
509 --enable-vorbis) vorbis="yes"
510 extralibs="$extralibs -lvorbis -lvorbisenc"
511 pkg_requires="$pkg_requires vorbis vorbisenc"
513 --enable-theora) theora="yes"
514 extralibs="$extralibs -ltheora"
515 pkg_requires="$pkg_requires theora"
517 --enable-faad) faad="yes"
518 extralibs="$extralibs -lfaad"
520 --enable-faadbin) faadbin="yes"
522 --enable-faac) faac="yes"
523 extralibs="$extralibs -lfaac"
525 --enable-xvid) xvid="yes"
526 extralibs="$extralibs -lxvidcore"
528 --enable-x264) x264="yes"
529 extralibs="$extralibs -lx264"
531 --enable-dc1394) dc1394="yes"
532 extralibs="$extralibs -ldc1394_control -lraw1394"
533 pkg_requires="$pkg_requires libraw1394"
535 --disable-vhook) vhook="no"
537 --disable-simple_idct) simpleidct="no"
539 --enable-mingw32) mingw32="yes"
541 --enable-shared) lshared="yes"
543 --disable-debug) debug="no"
545 --disable-opts) optimize="no"
547 --disable-mpegaudio-hp) mpegaudio_hp="no"
549 --disable-ffserver) ffserver="no"
551 --disable-ffplay) ffplay="no"
553 --enable-small) optimize="small"
555 --enable-amr_nb) amr_nb="yes"
557 --enable-amr_nb-fixed) amr_nb_fixed="yes"
559 --enable-amr_wb) amr_wb="yes"
561 --enable-amr_if2) amr_if2="yes"
563 --enable-sunmlib) sunmlib="yes"
565 --enable-pthreads) pthreads="yes"
567 --enable-gpl) gpl="yes"
569 --enable-memalign-hack) memalignhack="yes"
571 --disable-strip) dostrip="no"
573 --enable-encoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-encoder=}_encoder"
575 --enable-decoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-decoder=}_decoder"
577 --disable-encoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-encoder=}_encoder##\"`"
579 --disable-decoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-decoder=}_decoder##\"`"
581 --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
583 --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
585 --disable-muxers) muxers="no"
587 --disable-demuxers) demuxers="no"
590 echo "Unknown option \"$opt\"."
591 echo "See $0 --help for available options."
597 if test "$theora" = "yes" ; then
598 if test "$libogg" = "no"; then
599 echo "libogg must be enabled to enable Theora."
605 if test "$vorbis" = "yes" ; then
606 if test "$libogg" = "no"; then
607 echo "libogg must be enabled to enable Vorbis."
613 if test "$gpl" != "yes"; then
614 if test "$pp" != "no" -o "$shared_pp" != "no"; then
615 echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
619 if test "$a52" != "no" -o "$a52bin" != "no"; then
620 echo "liba52 is under GPL and --enable-gpl is not specified."
624 if test "$xvid" != "no"; then
625 echo "libxvidcore is under GPL and --enable-gpl is not specified."
629 if test "$x264" != "no"; then
630 echo "x264 is under GPL and --enable-gpl is not specified."
634 if test "$dts" != "no"; then
635 echo "libdts is under GPL and --enable-gpl is not specified."
639 if test "$faad" != "no" -o "$faadbin" != "no"; then
642 int main( void ) { return 0; }
645 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
648 #ifndef FAAD2_VERSION
651 int main( void ) { return 0; }
653 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
654 echo "FAAD2 is under GPL and --enable-gpl is not specified."
660 echo "FAAD test failed."
665 if test "$fail" = "yes"; then
671 if test $mmx = "default"; then
672 if test $cpu = "x86" -o $cpu = "x86_64"; then
679 # check iwmmxt support
680 if test $iwmmxt = "default" -a $cpu = "armv4l"; then
683 __asm__ __volatile__ ("wunpckelub wr6, wr4");
688 if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
694 needmdynamicnopic="no"
695 if test $targetos = Darwin; then
696 if test -n "`$cc -v 2>&1 | grep xlc`"; then
697 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
699 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
700 case "$gcc_version" in
702 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
705 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
706 if test "$lshared" = no; then
707 needmdynamicnopic="yes"
711 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
712 if test "$lshared" = no; then
713 needmdynamicnopic="yes"
720 # Can only do AltiVec on PowerPC
721 if test $altivec = "default"; then
722 if test $cpu = "powerpc"; then
729 # Add processor-specific flags
732 if test $tune != "generic"; then
734 601|ppc601|PowerPC601)
735 CFLAGS="$CFLAGS -mcpu=601"
736 if test $altivec = "yes"; then
737 echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
741 603*|ppc603*|PowerPC603*)
742 CFLAGS="$CFLAGS -mcpu=603"
743 if test $altivec = "yes"; then
744 echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
748 604*|ppc604*|PowerPC604*)
749 CFLAGS="$CFLAGS -mcpu=604"
750 if test $altivec = "yes"; then
751 echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
755 G3|g3|75*|ppc75*|PowerPC75*)
756 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
757 if test $altivec = "yes"; then
758 echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
762 G4|g4|745*|ppc745*|PowerPC745*)
763 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
764 if test $altivec = "no"; then
765 echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
769 74*|ppc74*|PowerPC74*)
770 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
771 if test $altivec = "no"; then
772 echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
776 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
777 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
778 if test $altivec = "no"; then
779 echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
784 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)
785 CFLAGS="$CFLAGS -march=$tune"
788 echo "WARNING: Unknown CPU \"$tune\", ignored."
793 # AltiVec flags: The FSF version of GCC differs from the Apple version
794 if test $cpu = "powerpc"; then
795 if test $altivec = "yes"; then
796 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
797 CFLAGS="$CFLAGS -faltivec"
799 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
804 # check if we have <altivec.h>
807 int main( void ) { return 0; }
811 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
815 # check if our compiler supports Motorola AltiVec C API
816 if test $altivec = "yes"; then
817 if test $_altivec_h = "yes"; then
821 vector signed int v1, v2, v3;
829 vector signed int v1, v2, v3;
835 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
838 # mmi only available on mips
839 if test $mmi = "default"; then
840 if test $cpu = "mips"; then
847 # check if our compiler supports mmi
848 if test $mmi = "yes"; then
851 __asm__ ("lq \$2, 0(\$2)");
855 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
858 if test "$mingw32" = "yes" ; then
869 if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
870 if test "$force_libdir" != yes; then bindir="$prefix"; fi
873 cc="${cross_prefix}${cc}"
874 ar="${cross_prefix}${ar}"
875 ranlib="${cross_prefix}${ranlib}"
876 strip="${cross_prefix}${strip}"
878 if test -z "$cross_prefix" ; then
881 # big/little-endian test
883 #include <inttypes.h>
884 int main(int argc, char ** argv){
885 volatile uint32_t i=0x01234567;
886 return (*((uint8_t*)(&i))) == 0x67;
890 if $cc -o $TMPE $TMPC 2>/dev/null ; then
891 $TMPE && bigendian="yes"
893 echo big/little test failed
898 # programs cannot be launched if cross compiling, so make a static guess
899 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
908 #include <inttypes.h>
909 int main(int argc, char ** argv){
914 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
919 #include <inttypes.h>
920 int main(int argc, char ** argv){
921 volatile uint_fast64_t i=0x01234567;
926 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
929 # check availability of some header files
933 int main( void ) { return 0; }
938 if $cc -o $TMPE $TMPC 2> /dev/null ; then
941 # check for memalign - atmos
947 string = memalign(64, sizeof(char));
951 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
954 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
955 echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
961 int main( void ) { localtime_r(NULL, NULL); }
965 if $cc -o $TMPE $TMPC 2> /dev/null ; then
969 if test "$zlib" = "yes"; then
970 # check for zlib - mmu_man
974 if (zlibVersion() != ZLIB_VERSION)
975 puts("zlib version differs !!!");
980 $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
981 # $TMPE 2> /dev/null > /dev/null || zlib="no"
982 # XXX: more tests needed - runtime test
984 if test "$zlib" = "yes"; then
985 extralibs="$extralibs -lz"
988 # test for lrintf in math.h
990 #define _ISOC9X_SOURCE 1
992 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
996 if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
998 # allanc@chickenandporn.com: cannot execute cross-compiled
999 # code on the host. Only execute if not cross-compiling.
1000 if test -z "$cross_prefix" ; then
1001 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
1006 for restrict_keyword in restrict __restrict__ __restrict; do
1007 echo "void foo(char * $restrict_keyword p);" > $TMPC
1008 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
1009 _restrict=$restrict_keyword
1014 # test gcc version to see if vector builtins can be used
1015 # currently only used on i386 for MMX builtins
1017 #include <xmmintrin.h>
1019 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
1022 #error no vector builtins
1028 if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
1032 # Probe for -Wdeclaration-after-statement
1033 if test "$cc" == "gcc"; then
1035 int main( void ) { return 0; }
1038 if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
1039 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
1043 # dlopen/dlfcn.h probing
1047 int main( void ) { return (int) dlopen("foo", 0); }
1052 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1057 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1064 int main( void ) { return (int) dlopen("foo", 0); }
1067 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1071 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1076 if test "$vhook" = "default" ; then
1080 if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1081 extralibs="$extralibs $ldl"
1085 ##########################################
1089 #include <X11/Xlib.h>
1091 int main( void ) { return (int) imlib_load_font("foo"); }
1095 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
1099 ##########################################
1103 #include <ft2build.h>
1104 int main( void ) { return (int) FT_Init_FreeType(0); }
1108 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1109 if (freetype-config --version) >/dev/null 2>&1 ; then
1110 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
1116 ##########################################
1121 #undef main /* We don't want SDL to override our main() */
1122 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1127 if (sdl-config --version) >/dev/null 2>&1 ; then
1128 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
1129 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1130 if test "$_sdlversion" -lt 121 ; then
1138 ##########################################
1142 if (texi2html -version) >/dev/null 2>&1; then
1146 if test "$network" = "yes" ; then
1147 ##########################################
1151 #include <sys/types.h>
1152 #include <sys/socket.h>
1153 #include <netinet/in.h>
1156 struct sockaddr_storage saddr;
1157 struct ipv6_mreq mreq6;
1158 getaddrinfo(0,0,0,0);
1159 getnameinfo(0,0,0,0,0,0,0);
1160 IN6_IS_ADDR_MULTICAST(0);
1165 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1170 case "`$cc -v 2>&1 | grep version`" in
1172 CFLAGS="-Wall -Wno-switch $CFLAGS"
1178 if test "$sdl" = "no" ; then
1182 if test "$debug" = "yes"; then
1186 if test "$optimize" = "small"; then
1187 # CFLAGS=${CFLAGS//-O3/-Os}
1188 CFLAGS="$CFLAGS -Os"
1191 if test "$optimize" = "yes"; then
1192 if test -n "`$cc -v 2>&1 | grep xlc`"; then
1193 CFLAGS="$CFLAGS -O5"
1194 LDFLAGS="$LDFLAGS -O5"
1196 CFLAGS="-O3 $CFLAGS"
1200 # PIC flags for shared library objects where they are needed
1201 if test "$lshared" = "yes" ; then
1202 # LIBOBJFLAGS may have already been set in the OS configuration
1203 if test -z "$LIBOBJFLAGS" ; then
1204 if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
1205 LIBOBJFLAGS="\$(PIC)"
1210 if test x"$bindir" = x""; then
1211 bindir="${prefix}/bin"
1214 if test x"$libdir" = x""; then
1215 libdir="${prefix}/lib"
1218 if test x"$mandir" = x""; then
1219 mandir="${prefix}/man"
1222 echo "install prefix $prefix"
1223 echo "source path $source_path"
1224 echo "C compiler $cc"
1226 echo "CPU $cpu ($tune)"
1227 if test "$BUILDSUF" != ""; then
1228 echo "build suffix $BUILDSUF"
1230 echo "big-endian $bigendian"
1231 echo "inttypes.h $inttypes"
1232 echo "broken inttypes.h $emu_fast_int"
1233 if test $cpu = "x86" -o $cpu = "x86_64"; then
1234 echo "MMX enabled $mmx"
1235 echo "Vector Builtins $builtin_vector"
1237 if test $cpu = "armv4l"; then
1238 echo "IWMMXT enabled $iwmmxt"
1240 if test $cpu = "mips"; then
1241 echo "MMI enabled $mmi"
1243 if test $cpu = "powerpc"; then
1244 echo "AltiVec enabled $altivec"
1246 echo "gprof enabled $gprof"
1247 echo "zlib enabled $zlib"
1248 echo "libgsm enabled $libgsm"
1249 echo "mp3lame enabled $mp3lame"
1250 echo "libogg enabled $libogg"
1251 echo "Vorbis enabled $vorbis"
1252 echo "Theora enabled $theora"
1253 echo "FAAD enabled $faad"
1254 echo "faadbin enabled $faadbin"
1255 echo "FAAC enabled $faac"
1256 echo "XviD enabled $xvid"
1257 echo "x264 enabled $x264"
1258 echo "a52 support $a52"
1259 echo "a52 dlopened $a52bin"
1260 echo "DTS support $dts"
1261 echo "pp support $pp"
1262 echo "debug symbols $debug"
1263 echo "strip symbols $dostrip"
1264 echo "optimize $optimize"
1265 echo "shared pp $shared_pp"
1266 echo "video hooking $vhook"
1267 echo "SDL support $sdl"
1268 if test $sdl_too_old = "yes"; then
1269 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1272 if test "$vhook" = "yes" ; then
1273 echo "Imlib2 support $imlib2"
1274 echo "FreeType support $freetype2"
1276 echo "Sun medialib support" $sunmlib
1277 echo "pthreads support" $pthreads
1278 echo "AMR-NB float support" $amr_nb
1279 echo "AMR-NB fixed support" $amr_nb_fixed
1280 echo "AMR-WB float support" $amr_wb
1281 echo "AMR-WB IF2 support" $amr_if2
1282 echo "network support $network"
1283 if test "$network" = "yes" ; then
1284 echo "IPv6 support $ipv6"
1286 if test "$gpl" = "no" ; then
1287 echo "License: LGPL"
1292 echo "Creating config.mak and config.h..."
1295 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1296 echo "# Automatically generated by configure - do not modify!" > config.mak
1297 echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1298 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1300 echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1301 echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1302 echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1303 echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1304 echo "MAKE=$make" >> config.mak
1305 echo "CC=$cc" >> config.mak
1306 echo "AR=$ar" >> config.mak
1307 echo "RANLIB=$ranlib" >> config.mak
1308 if test "$dostrip" = "yes" ; then
1309 echo "STRIP=$strip" >> config.mak
1310 echo "INSTALLSTRIP=$installstrip" >> config.mak
1312 echo "STRIP=echo ignoring strip" >> config.mak
1313 echo "INSTALLSTRIP=" >> config.mak
1316 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1317 # shared modules on OS/X (vhook/Makefile).
1319 if test "$needmdynamicnopic" = yes; then
1320 CFLAGS="$CFLAGS -mdynamic-no-pic"
1323 echo "OPTFLAGS=$CFLAGS" >> config.mak
1324 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1325 echo "LDFLAGS=$LDFLAGS" >> config.mak
1326 echo "LDCONFIG=$LDCONFIG" >> config.mak
1327 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1328 echo "SHFLAGS=$SHFLAGS" >> config.mak
1329 echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1330 echo "BUILDSUF=$BUILDSUF" >> config.mak
1331 echo "LIBPREF=$LIBPREF" >> config.mak
1332 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1333 echo "SLIBPREF=$SLIBPREF" >> config.mak
1334 echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1335 echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1336 echo "TARGET_OS=$TARGET_OS" >> config.mak
1337 if test "$cpu" = "x86" ; then
1338 echo "TARGET_ARCH_X86=yes" >> config.mak
1339 echo "#define ARCH_X86 1" >> $TMPH
1340 elif test "$cpu" = "x86_64" ; then
1341 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1342 echo "#define ARCH_X86_64 1" >> $TMPH
1343 elif test "$cpu" = "armv4l" ; then
1344 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1345 echo "#define ARCH_ARMV4L 1" >> $TMPH
1346 elif test "$cpu" = "alpha" ; then
1347 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1348 echo "#define ARCH_ALPHA 1" >> $TMPH
1349 elif test "$cpu" = "sparc64" ; then
1350 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1351 echo "#define ARCH_SPARC64 1" >> $TMPH
1352 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1353 echo "#define ARCH_SPARC 1" >> $TMPH
1354 elif test "$cpu" = "sparc" ; then
1355 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1356 echo "#define ARCH_SPARC 1" >> $TMPH
1357 elif test "$cpu" = "powerpc" ; then
1358 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1359 echo "#define ARCH_POWERPC 1" >> $TMPH
1360 if test $POWERPCMODE = "32bits"; then
1361 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1363 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1365 if test "$powerpc_perf" = "yes"; then
1366 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1368 elif test "$cpu" = "mips" ; then
1369 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1370 echo "#define ARCH_MIPS 1" >> $TMPH
1371 elif test "$cpu" = "sh4" ; then
1372 echo "TARGET_ARCH_SH4=yes" >> config.mak
1373 echo "#define ARCH_SH4 1" >> $TMPH
1374 elif test "$cpu" = "parisc" ; then
1375 echo "TARGET_ARCH_PARISC=yes" >> config.mak
1376 echo "#define ARCH_PARISC 1" >> $TMPH
1377 elif test "$cpu" = "s390" ; then
1378 echo "TARGET_ARCH_S390=yes" >> config.mak
1379 echo "#define ARCH_S390 1" >> $TMPH
1380 elif test "$cpu" = "m68k" ; then
1381 echo "TARGET_ARCH_M68K=yes" >> config.mak
1382 echo "#define ARCH_M68K 1" >> $TMPH
1383 elif test "$cpu" = "ia64" ; then
1384 echo "TARGET_ARCH_IA64=yes" >> config.mak
1385 echo "#define ARCH_IA64 1" >> $TMPH
1387 echo "#define TUNECPU $TUNECPU" >> $TMPH
1388 if test "$bigendian" = "yes" ; then
1389 echo "WORDS_BIGENDIAN=yes" >> config.mak
1390 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1392 if test "$inttypes" != "yes" ; then
1393 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1395 if test "$emu_fast_int" = "yes" ; then
1396 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1398 if test "$mmx" = "yes" ; then
1399 echo "TARGET_MMX=yes" >> config.mak
1400 echo "#define HAVE_MMX 1" >> $TMPH
1401 echo "#define __CPU__ 586" >> $TMPH
1403 if test "$builtin_vector" = "yes" ; then
1404 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1405 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1407 if test "$iwmmxt" = "yes" ; then
1408 echo "TARGET_IWMMXT=yes" >> config.mak
1409 echo "#define HAVE_IWMMXT 1" >> $TMPH
1411 if test "$mmi" = "yes" ; then
1412 echo "TARGET_MMI=yes" >> config.mak
1413 echo "#define HAVE_MMI 1" >> $TMPH
1415 if test "$altivec" = "yes" ; then
1416 echo "TARGET_ALTIVEC=yes" >> config.mak
1417 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1418 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1419 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1420 if test "$_altivec_h" = "yes" ; then
1421 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1423 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1426 if test "$gprof" = "yes" ; then
1427 echo "TARGET_GPROF=yes" >> config.mak
1428 echo "#define HAVE_GPROF 1" >> $TMPH
1430 if test "$localtime_r" = "yes" ; then
1431 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1433 if test "$imlib2" = "yes" ; then
1434 echo "HAVE_IMLIB2=yes" >> config.mak
1436 if test "$freetype2" = "yes" ; then
1437 echo "HAVE_FREETYPE2=yes" >> config.mak
1439 if test "$sunmlib" = "yes" ; then
1440 echo "HAVE_MLIB=yes" >> config.mak
1441 echo "#define HAVE_MLIB 1" >> $TMPH
1442 extralibs="$extralibs -lmlib"
1444 if test "$pthreads" = "yes" ; then
1445 echo "HAVE_PTHREADS=yes" >> config.mak
1446 echo "#define HAVE_PTHREADS 1" >> $TMPH
1447 echo "#define HAVE_THREADS 1" >> $TMPH
1448 if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
1449 extralibs="$extralibs -lpthread"
1452 if test "$sdl" = "yes" ; then
1453 echo "CONFIG_SDL=yes" >> config.mak
1454 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1455 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1457 if test "$texi2html" = "yes"; then
1458 echo "BUILD_DOC=yes" >> config.mak
1460 if test "$have_lrintf" = "yes" ; then
1461 echo "#define HAVE_LRINTF 1" >> $TMPH
1463 if test "$vhook" = "yes" ; then
1464 echo "BUILD_VHOOK=yes" >> config.mak
1465 echo "#define HAVE_VHOOK 1" >> $TMPH
1468 lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1469 lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1470 lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1474 if test "$lshared" = "yes" ; then
1475 echo "BUILD_SHARED=yes" >> config.mak
1476 echo "PIC=-fPIC -DPIC" >> config.mak
1477 echo "SPPMAJOR=${lavc_version/.*/}" >> config.mak
1478 echo "SPPVERSION=$lavc_version" >> config.mak
1479 echo "LAVCMAJOR=${lavc_version/.*/}" >> config.mak
1480 echo "LAVCVERSION=$lavc_version" >> config.mak
1481 echo "LAVFMAJOR=${lavf_version/.*/}" >> config.mak
1482 echo "LAVFVERSION=$lavf_version" >> config.mak
1483 echo "LAVUMAJOR=${lavu_version/.*/}" >> config.mak
1484 echo "LAVUVERSION=$lavu_version" >> config.mak
1486 echo "EXTRALIBS=$extralibs" >> config.mak
1487 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1489 echo "VERSION=$version" >>config.mak
1490 # If you do not want to use encoders, disable them.
1491 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1492 echo "CONFIG_ENCODERS=yes" >> config.mak
1494 # If you do not want to use decoders, disable them.
1495 echo "#define CONFIG_DECODERS 1" >> $TMPH
1496 echo "CONFIG_DECODERS=yes" >> config.mak
1499 if test "$muxers" = "yes" ; then
1500 echo "#define CONFIG_MUXERS 1" >> $TMPH
1501 echo "CONFIG_MUXERS=yes" >> config.mak
1505 if test "$demuxers" = "yes" ; then
1506 echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1507 echo "CONFIG_DEMUXERS=yes" >> config.mak
1511 if test "$a52" = "yes" ; then
1512 echo "#define CONFIG_AC3 1" >> $TMPH
1513 echo "CONFIG_AC3=yes" >> config.mak
1515 if test "$a52bin" = "yes" ; then
1516 echo "#define CONFIG_A52BIN 1" >> $TMPH
1517 echo "CONFIG_A52BIN=yes" >> config.mak
1522 if test "$dts" = "yes" ; then
1523 echo "#define CONFIG_DTS 1" >> $TMPH
1524 echo "CONFIG_DTS=yes" >> config.mak
1528 if test "$pp" = "yes" ; then
1529 echo "#define CONFIG_PP 1" >> $TMPH
1530 echo "CONFIG_PP=yes" >> config.mak
1532 if test "$shared_pp" = "yes" ; then
1533 echo "#define SHARED_PP 1" >> $TMPH
1534 echo "SHARED_PP=yes" >> config.mak
1538 # MPEG audio high precision mode
1539 if test "$mpegaudio_hp" = "yes" ; then
1540 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1543 if test "$v4l" = "yes" ; then
1544 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1545 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1548 if test "$bktr" = "yes" ; then
1549 echo "#define CONFIG_BKTR 1" >> $TMPH
1550 echo "CONFIG_BKTR=yes" >> config.mak
1553 if test "$dv1394" = "yes" ; then
1554 echo "#define CONFIG_DV1394 1" >> $TMPH
1555 echo "CONFIG_DV1394=yes" >> config.mak
1558 if test "$dc1394" = "yes" ; then
1559 echo "#define CONFIG_DC1394 1" >> $TMPH
1560 echo "CONFIG_DC1394=yes" >> config.mak
1563 if test "$dlopen" = "yes" ; then
1564 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1567 if test "$dlfcn" = "yes" ; then
1568 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1571 if test "$audio_oss" = "yes" ; then
1572 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1573 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1576 if test "$audio_beos" = "yes" ; then
1577 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1578 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1581 if test "$network" = "yes" ; then
1582 echo "#define CONFIG_NETWORK 1" >> $TMPH
1583 echo "CONFIG_NETWORK=yes" >> config.mak
1586 if test "$ipv6" = "yes" ; then
1587 echo "#define CONFIG_IPV6 1" >> $TMPH
1590 if test "$zlib" = "yes" ; then
1591 echo "#define CONFIG_ZLIB 1" >> $TMPH
1592 echo "CONFIG_ZLIB=yes" >> config.mak
1595 if test "$libgsm" = "yes" ; then
1596 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1597 echo "CONFIG_LIBGSM=yes" >> config.mak
1600 if test "$mp3lame" = "yes" ; then
1601 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1602 echo "CONFIG_MP3LAME=yes" >> config.mak
1605 if test "$libogg" = "yes" ; then
1606 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1607 echo "CONFIG_LIBOGG=yes" >> config.mak
1610 if test "$vorbis" = "yes" ; then
1611 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1612 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1615 if test "$theora" = "yes" ; then
1616 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1617 echo "CONFIG_LIBTHEORA=yes" >> config.mak
1620 if test "$faad" = "yes" ; then
1621 echo "#define CONFIG_FAAD 1" >> $TMPH
1622 echo "CONFIG_FAAD=yes" >> config.mak
1625 if test "$faadbin" = "yes" ; then
1626 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1627 echo "CONFIG_FAADBIN=yes" >> config.mak
1630 if test "$faac" = "yes" ; then
1631 echo "#define CONFIG_FAAC 1" >> $TMPH
1632 echo "CONFIG_FAAC=yes" >> config.mak
1635 if test "$xvid" = "yes" ; then
1636 echo "#define CONFIG_XVID 1" >> $TMPH
1637 echo "CONFIG_XVID=yes" >> config.mak
1640 if test "$x264" = "yes" ; then
1641 echo "#define CONFIG_X264 1" >> $TMPH
1642 echo "CONFIG_X264=yes" >> config.mak
1645 if test "$mingw32" = "yes" ; then
1646 echo "#define CONFIG_WIN32 1" >> $TMPH
1647 echo "CONFIG_WIN32=yes" >> config.mak
1648 echo "HAVE_W32THREADS=yes" >> config.mak
1649 echo "#define HAVE_W32THREADS 1" >> $TMPH
1650 echo "#define HAVE_THREADS 1" >> $TMPH
1651 echo "#ifndef __MINGW32__" >> $TMPH
1652 echo "#define __MINGW32__ 1" >> $TMPH
1653 echo "#endif" >> $TMPH
1656 if test "$os2" = "yes" ; then
1657 echo "#define CONFIG_OS2 1" >> $TMPH
1658 echo "CONFIG_OS2=yes" >> config.mak
1661 if test "$TARGET_OS" = "SunOS" ; then
1662 echo "#define CONFIG_SUNOS 1" >> $TMPH
1665 if test "$TARGET_OS" = "BeOS" ; then
1666 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1667 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1668 echo "#define HAVE_THREADS 1" >> $TMPH
1671 if test "$darwin" = "yes"; then
1672 echo "#define CONFIG_DARWIN 1" >> $TMPH
1673 echo "CONFIG_DARWIN=yes" >> config.mak
1676 if test "$_malloc_h" = "yes" ; then
1677 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1679 echo "#undef HAVE_MALLOC_H" >> $TMPH
1682 if test "$_memalign" = "yes" ; then
1683 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1685 echo "#undef HAVE_MEMALIGN" >> $TMPH
1688 if test "$memalignhack" = "yes" ; then
1689 echo "#define MEMALIGN_HACK 1" >> $TMPH
1693 if test "$netserver" = "yes" ; then
1694 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1695 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1698 if test "$need_inet_aton" = "yes" ; then
1699 echo "NEED_INET_ATON=yes" >> config.mak
1702 if test "$simpleidct" = "yes" ; then
1703 echo "#define SIMPLE_IDCT 1" >> $TMPH
1706 if test "$ffserver" = "yes" ; then
1707 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1708 echo "CONFIG_FFSERVER=yes" >> config.mak
1711 if test "$ffplay" = "yes" ; then
1712 echo "CONFIG_FFPLAY=yes" >> config.mak
1715 if test "$gpl" = "yes" ; then
1716 echo "#define CONFIG_GPL 1" >> $TMPH
1717 echo "CONFIG_GPL=yes" >> config.mak
1720 echo "#define restrict $_restrict" >> $TMPH
1722 if test "$optimize" = "small"; then
1723 echo "#define always_inline" >> $TMPH
1726 # build tree in object directory if source path is different from current one
1727 if test "$source_path_used" = "yes" ; then
1739 libavcodec/libpostproc \
1746 libavformat/Makefile \
1747 libavcodec/Makefile \
1748 libavcodec/libpostproc/Makefile \
1749 libavutil/Makefile \
1755 for dir in $DIRS ; do
1758 for f in $FILES ; do
1759 ln -sf "$source_path/$f" $f
1761 echo "SRC_PATH=$source_path" >> config.mak
1763 echo "SRC_PATH='$source_path'" >> config.mak
1766 if test "$amr_wb" = "yes" ; then
1767 echo "#define AMR_WB 1" >> $TMPH
1768 echo "AMR_WB=yes" >> config.mak
1770 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1772 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1773 echo "and extracted the source to libavcodec/amrwb_float"
1777 if test "$amr_nb" = "yes" ; then
1778 echo "#define AMR_NB 1" >> $TMPH
1779 echo "AMR_NB=yes" >> config.mak
1781 if test "$amr_nb_fixed" = "yes" ; then
1782 echo "AMR_NB_FIXED=yes" >> config.mak
1783 echo "#define AMR_NB_FIXED 1" >> $TMPH
1784 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1785 echo "REL-5 version 5.1.0 from "
1786 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1787 echo "and extracted src to libavcodec/amr"
1788 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1789 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1792 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1793 echo "REL-5 V5.1.0 from "
1794 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1795 echo "and extracted the source to libavcodec/amr_float"
1796 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1800 if test "$amr_if2" = "yes" ; then
1801 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1806 for codec in $CODEC_LIST ; do
1807 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1808 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1811 diff $TMPH config.h >/dev/null 2>&1
1812 if test $? -ne 0 ; then
1813 mv -f $TMPH config.h
1815 echo "config.h is unchanged"
1818 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1821 # build pkg-config files libav*.pc and libpostproc.pc
1823 cat <<EOF >libavutil.pc
1825 exec_prefix=\${prefix}
1826 libdir=\${exec_prefix}/lib
1827 includedir=\${prefix}/include
1830 Description: FFmpeg utility library
1831 Version: $lavu_version
1834 Libs: -L\${libdir} -lavutil
1835 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1838 cat <<EOF >libavutil-uninstalled.pc
1841 libdir=\${pcfiledir}/libavutil
1842 includedir=\${pcfiledir}/libavutil
1845 Description: FFmpeg utility library
1846 Version: $lavu_version
1849 Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1850 Cflags: -I\${includedir}
1854 cat <<EOF >libavcodec.pc
1856 exec_prefix=\${prefix}
1857 libdir=\${exec_prefix}/lib
1858 includedir=\${prefix}/include
1861 Description: FFmpeg codec library
1862 Version: $lavc_version
1863 Requires: $pkg_requires libavutil = $lavu_version
1865 Libs: -L\${libdir} -lavcodec $extralibs
1866 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1869 cat <<EOF >libavcodec-uninstalled.pc
1872 libdir=\${pcfiledir}/libavcodec
1873 includedir=\${pcfiledir}/libavcodec
1876 Description: FFmpeg codec library
1877 Version: $lavc_version
1878 Requires: $pkg_requires libavutil = $lavu_version
1880 Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1881 Cflags: -I\${includedir}
1885 cat <<EOF >libavformat.pc
1887 exec_prefix=\${prefix}
1888 libdir=\${exec_prefix}/lib
1889 includedir=\${prefix}/include
1892 Description: FFmpeg container format library
1893 Version: $lavf_version
1894 Requires: $pkg_requires libavcodec = $lavc_version
1896 Libs: -L\${libdir} -lavformat $extralibs
1897 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1900 cat <<EOF >libavformat-uninstalled.pc
1903 libdir=\${pcfiledir}/libavformat
1904 includedir=\${pcfiledir}/libavformat
1907 Description: FFmpeg container format library
1908 Version: $lavf_version
1909 Requires: $pkg_requires libavcodec = $lavc_version
1911 Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1912 Cflags: -I\${includedir}
1917 cat <<EOF >libpostproc.pc
1919 exec_prefix=\${prefix}
1920 libdir=\${exec_prefix}/lib
1921 includedir=\${prefix}/include
1924 Description: FFmpeg post processing library
1925 Version: $lavc_version
1928 Libs: -L\${libdir} -lpostproc
1929 Cflags: -I\${includedir} -I\${includedir}/postproc
1932 cat <<EOF >libpostproc-uninstalled.pc
1935 libdir=\${pcfiledir}/libavcodec/libpostproc
1936 includedir=\${pcfiledir}/libavcodec/libpostproc
1939 Description: FFmpeg post processing library
1940 Version: $lavc_version
1943 Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1944 Cflags: -I\${includedir}