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 " --mandir=DIR man documentation in DIR [PREFIX/man]"
17 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
18 echo " --enable-ogg enable ogg support via libogg [default=no]"
19 echo " --enable-vorbis enable vorbis support via libvorbis [default=no]"
20 echo " --enable-theora enable theora support via libtheora [default=no]"
21 echo " --enable-faad enable faad support via libfaad [default=no]"
22 echo " --enable-faadbin build faad support with runtime linking [default=no]"
23 echo " --enable-faac enable faac support via libfaac [default=no]"
24 echo " --enable-xvid enable xvid support via xvidcore [default=no]"
25 echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
26 echo " --enable-mingw32 enable mingw32 native/cross windows compile"
27 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
28 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
29 echo " --enable-dts enable GPL'ed DTS support [default=no]"
30 echo " --enable-pp enable GPL'ed post processing support [default=no]"
31 echo " --enable-shared-pp use libpostproc.so [default=no]"
32 echo " --enable-shared build shared libraries [default=no]"
33 echo " --enable-amr_nb enable amr_nb float audio codec"
34 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
35 echo " --enable-amr_wb enable amr_wb float audio codec"
36 echo " --enable-sunmlib use Sun medialib [default=no]"
37 echo " --enable-pthreads use pthreads [default=no]"
38 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [default=no]"
39 echo " --enable-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
41 echo "Advanced options (experts only):"
42 echo " --source-path=PATH path of source code [$source_path]"
43 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
44 echo " --cc=CC use C compiler CC [$cc]"
45 echo " --make=MAKE use specified make [$make]"
46 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
47 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
48 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
49 echo " --cpu=CPU force cpu to CPU [$cpu]"
50 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
51 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
52 echo " --disable-mmx disable mmx usage"
53 echo " --disable-altivec disable AltiVec usage"
54 echo " --disable-audio-oss disable OSS audio support [default=no]"
55 echo " --disable-audio-beos disable BeOS audio support [default=no]"
56 echo " --disable-v4l disable video4linux grabbing [default=no]"
57 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
58 echo " --disable-network disable network support [default=no]"
59 echo " --disable-zlib disable zlib [default=no]"
60 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
61 echo " --disable-vhook disable video hooking support"
62 echo " --enable-gprof enable profiling with gprof [$gprof]"
63 echo " --disable-debug disable debugging symbols"
64 echo " --disable-opts disable compiler optimizations"
65 echo " --disable-mpegaudio-hp faster (but less accurate)"
66 echo " mpegaudio decoding [default=no]"
67 echo " --disable-ffserver disable ffserver build"
68 echo " --disable-ffplay disable ffplay build"
69 echo " --enable-small optimize for size instead of speed"
70 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
71 echo " --disable-strip disable stripping of executables and shared libraries"
73 echo "NOTE: The object files are build at the place where configure is launched"
77 # set temporary file name
78 if test ! -z "$TMPDIR" ; then
80 elif test ! -z "$TEMPDIR" ; then
86 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
87 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
88 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
89 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
90 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
109 i386|i486|i586|i686|i86pc|BePC)
113 if [ "`$cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
114 -z "`echo $CFLAGS | grep -- -m32`" ]; then
120 # armv4l is a subset of armv5tel
127 "Power Macintosh"|ppc)
189 LDFLAGS=-Wl,--warn-common
209 prefix="/boot/home/config"
210 # helps building libavcodec
211 CFLAGS="-DPIC -fomit-frame-pointer"
212 # 3 gcc releases known for BeOS, each with ugly bugs
213 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
214 case "$gcc_version" in
215 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
218 *20010315*) echo "BeBits gcc"
219 CFLAGS="$CFLAGS -fno-expensive-optimizations"
223 # disable linux things
229 # no need for libm, but the inet stuff
231 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
232 extralibs="-lbind -lsocket"
246 extralibs="$extralibs -lsocket -lnsl"
253 LDFLAGS="$LDFLAGS -export-dynamic"
255 2.*) extralibs="-lossaudio"
265 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
271 extralibs="-lpoll -lgnugetopt -lm"
280 SHFLAGS="-dynamiclib"
284 LDFLAGS="-Wl,-d,-search_paths_first"
285 FFSLDFLAGS=-Wl,-bind_at_load
288 # Note: the rest of the mingw32 config is done afterwards as mingw32
289 # can be forced on command line for linux cross compilation
300 test -f /usr/include/inttypes.h || \
301 test -f /usr/local/include/inttypes.h || \
302 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
303 "/usr/local/include/inttypes.h !!!"
306 LDFLAGS="$LDFLAGS -rdynamic"
309 ranlib="echo ignoring ranlib"
317 ranlib="echo ignoring ranlib"
318 strip="echo ignoring strip"
320 LDFLAGS="-Zomf -Zstack 16384 -s"
339 # From mplayer configure. We need TARGET_OS available
340 # to the Makefile, so it can distinguish between flavors
341 # of AltiVec on PowerPC
342 TARGET_OS=`( uname -s ) 2>&1`
344 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
352 [cC][yY][gG][wW][iI][nN]*)
356 TARGET_OS="$TARGET_OS-UNKNOWN"
361 # XXX: we assume an absolute path is given when launching configure,
362 # except in './configure' case.
363 source_path="`echo $0 | sed -e 's#/configure##'`"
364 source_path_used="yes"
365 if test -z "$source_path" -o "$source_path" = "." ; then
367 source_path_used="no"
370 FFMPEG_CONFIGURATION=" "
372 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
377 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
379 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
381 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
383 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
385 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
387 --make=*) make=`echo $opt | cut -d '=' -f 2`
389 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
391 --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
393 --extra-libs=*) extralibs=${opt#--extra-libs=}
395 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
397 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
399 --powerpc-perf-enable) powerpc_perf="yes"
401 --disable-mmx) mmx="no"
403 --disable-altivec) altivec="no"
405 --enable-gprof) gprof="yes"
407 --disable-v4l) v4l="no"
409 --disable-audio-oss) audio_oss="no"
411 --disable-audio-beos) audio_beos="no"
413 --disable-dv1394) dv1394="no"
415 --disable-network) network="no"; ffserver="no"
417 --disable-zlib) zlib="no"
419 --enable-a52) a52="yes"
421 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
423 --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
425 --enable-pp) pp="yes"
427 --enable-shared-pp) shared_pp="yes"
429 --enable-mp3lame) mp3lame="yes"
431 --enable-ogg) ogg="yes"
433 --enable-vorbis) vorbis="yes"
435 --enable-theora) theora="yes"
437 --enable-faad) faad="yes"
439 --enable-faadbin) faadbin="yes"
441 --enable-faac) faac="yes"
443 --enable-xvid) xvid="yes"
445 --enable-x264) x264="yes"; extralibs="$extralibs -lx264"
447 --enable-dc1394) dc1394="yes"
449 --disable-vhook) vhook="no"
451 --disable-simple_idct) simpleidct="no"
453 --enable-mingw32) mingw32="yes"
455 --enable-shared) lshared="yes"
457 --disable-debug) debug="no"
459 --disable-opts) optimize="no"
461 --disable-mpegaudio-hp) mpegaudio_hp="no"
463 --disable-ffserver) ffserver="no"
465 --disable-ffplay) ffplay="no"
467 --enable-small) optimize="small"
469 --enable-amr_nb) amr_nb="yes"
471 --enable-amr_nb-fixed) amr_nb_fixed="yes"
473 --enable-amr_wb) amr_wb="yes"
475 --enable-amr_if2) amr_if2="yes"
477 --enable-sunmlib) sunmlib="yes"
479 --enable-pthreads) pthreads="yes"
481 --enable-gpl) gpl="yes"
483 --enable-memalign-hack) memalignhack="yes"
485 --disable-strip) dostrip="no"
490 if test "$theora" = "yes" ; then
491 if test "$ogg" = "no" ; then
492 echo "Ogg must be enabled to enable Theora"
498 if test "$vorbis" = "yes" ; then
499 if test "$ogg" = "no" ; then
500 echo "Ogg must be enabled to enable Vorbis"
506 if test "$gpl" != "yes"; then
507 if test "$pp" != "no" -o "$shared_pp" != "no"; then
508 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
512 if test "$a52" != "no" -o "$a52bin" != "no"; then
513 echo "liba52 is under GPL and --enable-gpl is not specified"
517 if test "$xvid" != "no"; then
518 echo "libxvidcore is under GPL and --enable-gpl is not specified"
522 if test "$x264" != "no"; then
523 echo "x264 is under GPL and --enable-gpl is not specified"
527 if test "$dts" != "no"; then
528 echo "libdts is under GPL and --enable-gpl is not specified"
532 if test "$faad" != "no" -o "$faadbin" != "no"; then
535 int main( void ) { return 0; }
538 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
541 #ifndef FAAD2_VERSION
544 int main( void ) { return 0; }
546 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
547 echo "faad2 is under GPL and --enable-gpl is not specified"
553 echo "faad test failed"
558 if test "$fail" = "yes"; then
564 if test $mmx = "default"; then
565 if test $cpu = "x86" -o $cpu = "x86_64"; then
573 needmdynamicnopic="no"
574 if test $targetos = Darwin; then
575 if test -n "`$cc -v 2>&1 | grep xlc`"; then
576 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
578 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
579 case "$gcc_version" in
581 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
584 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
585 if test "$lshared" = no; then
586 needmdynamicnopic="yes"
590 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
591 if test "$lshared" = no; then
592 needmdynamicnopic="yes"
599 # Can only do AltiVec on PowerPC
600 if test $altivec = "default"; then
601 if test $cpu = "powerpc"; then
608 # Add processor-specific flags
611 if test $tune != "generic"; then
613 601|ppc601|PowerPC601)
614 CFLAGS="$CFLAGS -mcpu=601"
615 if test $altivec = "yes"; then
616 echo "WARNING: tuning for PPC601 but altivec enabled !";
620 603*|ppc603*|PowerPC603*)
621 CFLAGS="$CFLAGS -mcpu=603"
622 if test $altivec = "yes"; then
623 echo "WARNING: tuning for PPC603 but altivec enabled !";
627 604*|ppc604*|PowerPC604*)
628 CFLAGS="$CFLAGS -mcpu=604"
629 if test $altivec = "yes"; then
630 echo "WARNING: tuning for PPC604 but altivec enabled !";
634 G3|g3|75*|ppc75*|PowerPC75*)
635 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
636 if test $altivec = "yes"; then
637 echo "WARNING: tuning for PPC75x but altivec enabled !";
641 G4|g4|745*|ppc745*|PowerPC745*)
642 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
643 if test $altivec = "no"; then
644 echo "WARNING: tuning for PPC745x but altivec disabled !";
648 74*|ppc74*|PowerPC74*)
649 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
650 if test $altivec = "no"; then
651 echo "WARNING: tuning for PPC74xx but altivec disabled !";
655 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
656 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
657 if test $altivec = "no"; then
658 echo "WARNING: tuning for PPC970 but altivec disabled !";
664 echo "WARNING: unknown CPU "$tune", ignored"
669 # AltiVec flags: The FSF version of GCC differs from the Apple version
670 if test $cpu = "powerpc"; then
671 if test $altivec = "yes"; then
672 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
673 CFLAGS="$CFLAGS -faltivec"
675 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
680 # See if we have <altivec.h>
683 int main( void ) { return 0; }
687 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
691 # See does our compiler support Motorola AltiVec C API
692 if test $altivec = "yes"; then
693 if test $_altivec_h = "yes"; then
697 vector signed int v1, v2, v3;
705 vector signed int v1, v2, v3;
711 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
714 # Can only do mmi on mips
715 if test $mmi = "default"; then
716 if test $cpu = "mips"; then
723 # See does our compiler support mmi
724 if test $mmi = "yes"; then
727 __asm__ ("lq \$2, 0(\$2)");
731 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
734 if test "$mingw32" = "yes" ; then
746 prefix="/c/Program Files/FFmpeg"
750 cc="${cross_prefix}${cc}"
751 ar="${cross_prefix}${ar}"
752 ranlib="${cross_prefix}${ranlib}"
753 strip="${cross_prefix}${strip}"
755 if test -z "$cross_prefix" ; then
758 # big/little endian test
760 #include <inttypes.h>
761 int main(int argc, char ** argv){
762 volatile uint32_t i=0x01234567;
763 return (*((uint8_t*)(&i))) == 0x67;
767 if $cc -o $TMPE $TMPC 2>/dev/null ; then
768 $TMPE && bigendian="yes"
770 echo big/little test failed
775 # if cross compiling, cannot launch a program, so make a static guess
776 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
785 #include <inttypes.h>
786 int main(int argc, char ** argv){
791 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
796 #include <inttypes.h>
797 int main(int argc, char ** argv){
798 volatile uint_fast64_t i=0x01234567;
803 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
806 # check availability of some header files
810 int main( void ) { return 0; }
815 if $cc -o $TMPE $TMPC 2> /dev/null ; then
818 # check for memalign - atmos
824 string = memalign(64, sizeof(char));
828 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
831 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
832 echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
838 int main( void ) { localtime_r(NULL, NULL); }
842 if $cc -o $TMPE $TMPC 2> /dev/null ; then
846 if test "$zlib" = "yes"; then
847 # check for zlib - mmu_man
851 if (zlibVersion() != ZLIB_VERSION)
852 puts("zlib version differs !!!");
857 $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
858 # $TMPE 2> /dev/null > /dev/null || zlib="no"
859 # XXX: more tests needed - runtime test
861 if test "$zlib" = "yes"; then
862 extralibs="$extralibs -lz"
865 # test for lrintf in math.h
867 #define _ISOC9X_SOURCE 1
869 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
873 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
875 # allanc@chickenandporn.com: cannot execute cross-compiled
876 # code on the host. Only execute if not cross-compiling.
877 if test -z "$cross_prefix" ; then
878 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
883 for restrict_keyword in restrict __restrict__ __restrict; do
884 echo "void foo(char * $restrict_keyword p);" > $TMPC
885 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
886 _restrict=$restrict_keyword
891 # test gcc version to see if vector builtins can be used
892 # currently only used on i386 for MMX builtins
894 #include <xmmintrin.h>
896 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
899 #error no vector builtins
905 if $cc -o $TMPO $TMPC 2> /dev/null ; then
909 # dlopen/dlfcn.h probing
913 int main( void ) { return (int) dlopen("foo", 0); }
918 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
923 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
930 int main( void ) { return (int) dlopen("foo", 0); }
933 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
937 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
942 if test "$vhook" = "default" ; then
946 ##########################################
950 #include <X11/Xlib.h>
952 int main( void ) { return (int) imlib_load_font("foo"); }
956 if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
960 ##########################################
964 #include <ft2build.h>
965 int main( void ) { return (int) FT_Init_FreeType(0); }
969 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
970 if (freetype-config --version) >/dev/null 2>&1 ; then
971 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
977 ##########################################
982 #undef main /* We don't want SDL to override our main() */
983 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
988 if (sdl-config --version) >/dev/null 2>&1 ; then
989 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
990 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
991 if test "$_sdlversion" -lt 121 ; then
999 ##########################################
1003 if (texi2html -version) >/dev/null 2>&1; then
1007 if test "$network" = "yes" ; then
1008 ##########################################
1012 #include <sys/types.h>
1013 #include <sys/socket.h>
1014 #include <netinet/in.h>
1017 struct sockaddr_storage saddr;
1018 struct ipv6_mreq mreq6;
1019 getaddrinfo(0,0,0,0);
1020 getnameinfo(0,0,0,0,0,0,0);
1021 IN6_IS_ADDR_MULTICAST(0);
1026 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1031 case "`$cc -v 2>&1 | grep version`" in
1033 CFLAGS="-Wall -Wno-switch $CFLAGS"
1039 if test "$sdl" = "no" ; then
1043 if test "$debug" = "yes"; then
1047 if test "$optimize" = "small"; then
1048 # CFLAGS=${CFLAGS//-O3/-Os}
1049 CFLAGS="$CFLAGS -Os"
1052 if test "$optimize" = "yes"; then
1053 if test -n "`$cc -v 2>&1 | grep xlc`"; then
1054 CFLAGS="$CFLAGS -O5"
1055 LDFLAGS="$LDFLAGS -O5"
1057 CFLAGS="-O3 $CFLAGS"
1061 if test x"$bindir" = x""; then
1062 bindir="${prefix}/bin"
1065 if test x"$mandir" = x""; then
1066 mandir="${prefix}/man"
1069 echo "Install prefix $prefix"
1070 echo "Source path $source_path"
1071 echo "C compiler $cc"
1073 echo "CPU $cpu ($tune)"
1074 echo "Big Endian $bigendian"
1075 echo "inttypes.h $inttypes"
1076 echo "broken inttypes.h $emu_fast_int"
1077 if test $cpu = "x86" -o $cpu = "x86_64"; then
1078 echo "MMX enabled $mmx"
1079 echo "Vector Builtins $builtin_vector"
1081 if test $cpu = "mips"; then
1082 echo "MMI enabled $mmi"
1084 if test $cpu = "powerpc"; then
1085 echo "AltiVec enabled $altivec"
1087 echo "gprof enabled $gprof"
1088 echo "zlib enabled $zlib"
1089 echo "mp3lame enabled $mp3lame"
1090 echo "ogg enabled $ogg"
1091 echo "vorbis enabled $vorbis"
1092 echo "theora enabled $theora"
1093 echo "faad enabled $faad"
1094 echo "faadbin enabled $faadbin"
1095 echo "faac enabled $faac"
1096 echo "xvid enabled $xvid"
1097 echo "x264 enabled $x264"
1098 echo "a52 support $a52"
1099 echo "a52 dlopened $a52bin"
1100 echo "dts support $dts"
1101 echo "pp support $pp"
1102 echo "debug symbols $debug"
1103 echo "strip symbols $dostrip"
1104 echo "optimize $optimize"
1105 echo "shared pp $shared_pp"
1106 echo "Video hooking $vhook"
1107 echo "SDL support $sdl"
1108 if test $sdl_too_old = "yes"; then
1109 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1112 if test "$vhook" = "yes" ; then
1113 echo "Imlib2 support $imlib2"
1114 echo "freetype support $freetype2"
1116 echo "Sun medialib support" $sunmlib
1117 echo "pthreads support" $pthreads
1118 echo "AMR-NB float support" $amr_nb
1119 echo "AMR-NB fixed support" $amr_nb_fixed
1120 echo "AMR-WB float support" $amr_wb
1121 echo "AMR-WB IF2 support" $amr_if2
1122 echo "network support $network"
1123 if test "$network" = "yes" ; then
1124 echo "IPv6 support $ipv6"
1126 if test "$gpl" = "no" ; then
1127 echo "License: LGPL"
1132 echo "Creating config.mak and config.h"
1135 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1136 echo "# Automatically generated by configure - do not modify" > config.mak
1137 echo "/* Automatically generated by configure - do not modify */" > $TMPH
1138 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1140 echo "prefix=$prefix" >> config.mak
1141 echo "bindir=$bindir" >> config.mak
1142 echo "mandir=$mandir" >> config.mak
1143 echo "MAKE=$make" >> config.mak
1144 echo "CC=$cc" >> config.mak
1145 echo "AR=$ar" >> config.mak
1146 echo "RANLIB=$ranlib" >> config.mak
1147 if test "$dostrip" = "yes" ; then
1148 echo "STRIP=$strip" >> config.mak
1149 echo "INSTALLSTRIP=-s" >> config.mak
1151 echo "STRIP=echo ignoring strip" >> config.mak
1152 echo "INSTALLSTRIP=" >> config.mak
1155 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1156 # shared modules on OS/X (vhook/Makefile).
1158 if test "$needmdynamicnopic" = yes; then
1159 CFLAGS="$CFLAGS -mdynamic-no-pic"
1162 echo "OPTFLAGS=$CFLAGS" >> config.mak
1163 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1164 echo "LDFLAGS=$LDFLAGS" >> config.mak
1165 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1166 echo "SHFLAGS=$SHFLAGS" >> config.mak
1167 echo "LIBPREF=$LIBPREF" >> config.mak
1168 echo "LIBSUF=$LIBSUF" >> config.mak
1169 echo "SLIBPREF=$SLIBPREF" >> config.mak
1170 echo "SLIBSUF=$SLIBSUF" >> config.mak
1171 echo "EXESUF=$EXESUF" >> config.mak
1172 echo "TARGET_OS=$TARGET_OS" >> config.mak
1173 if test "$cpu" = "x86" ; then
1174 echo "TARGET_ARCH_X86=yes" >> config.mak
1175 echo "#define ARCH_X86 1" >> $TMPH
1176 elif test "$cpu" = "x86_64" ; then
1177 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1178 echo "#define ARCH_X86_64 1" >> $TMPH
1179 elif test "$cpu" = "armv4l" ; then
1180 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1181 echo "#define ARCH_ARMV4L 1" >> $TMPH
1182 elif test "$cpu" = "alpha" ; then
1183 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1184 echo "#define ARCH_ALPHA 1" >> $TMPH
1185 elif test "$cpu" = "sparc64" ; then
1186 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1187 echo "#define ARCH_SPARC64 1" >> $TMPH
1188 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1189 echo "#define ARCH_SPARC 1" >> $TMPH
1190 elif test "$cpu" = "sparc" ; then
1191 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1192 echo "#define ARCH_SPARC 1" >> $TMPH
1193 elif test "$cpu" = "powerpc" ; then
1194 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1195 echo "#define ARCH_POWERPC 1" >> $TMPH
1196 if test $POWERPCMODE = "32bits"; then
1197 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1199 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1201 if test "$powerpc_perf" = "yes"; then
1202 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1204 elif test "$cpu" = "mips" ; then
1205 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1206 echo "#define ARCH_MIPS 1" >> $TMPH
1207 elif test "$cpu" = "sh4" ; then
1208 echo "TARGET_ARCH_SH4=yes" >> config.mak
1209 echo "#define ARCH_SH4 1" >> $TMPH
1211 echo "#define TUNECPU $TUNECPU" >> $TMPH
1212 if test "$bigendian" = "yes" ; then
1213 echo "WORDS_BIGENDIAN=yes" >> config.mak
1214 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1216 if test "$inttypes" != "yes" ; then
1217 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1219 if test "$emu_fast_int" = "yes" ; then
1220 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1222 if test "$mmx" = "yes" ; then
1223 echo "TARGET_MMX=yes" >> config.mak
1224 echo "#define HAVE_MMX 1" >> $TMPH
1225 echo "#define __CPU__ 586" >> $TMPH
1227 if test "$builtin_vector" = "yes" ; then
1228 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1229 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1231 if test "$mmi" = "yes" ; then
1232 echo "TARGET_MMI=yes" >> config.mak
1233 echo "#define HAVE_MMI 1" >> $TMPH
1235 if test "$altivec" = "yes" ; then
1236 echo "TARGET_ALTIVEC=yes" >> config.mak
1237 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1238 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1239 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1240 if test "$_altivec_h" = "yes" ; then
1241 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1243 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1246 if test "$gprof" = "yes" ; then
1247 echo "TARGET_GPROF=yes" >> config.mak
1248 echo "#define HAVE_GPROF 1" >> $TMPH
1250 if test "$localtime_r" = "yes" ; then
1251 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1253 if test "$imlib2" = "yes" ; then
1254 echo "HAVE_IMLIB2=yes" >> config.mak
1256 if test "$freetype2" = "yes" ; then
1257 echo "HAVE_FREETYPE2=yes" >> config.mak
1259 if test "$sunmlib" = "yes" ; then
1260 echo "HAVE_MLIB=yes" >> config.mak
1261 echo "#define HAVE_MLIB 1" >> $TMPH
1262 extralibs="$extralibs -lmlib"
1264 if test "$pthreads" = "yes" ; then
1265 echo "HAVE_PTHREADS=yes" >> config.mak
1266 echo "#define HAVE_PTHREADS 1" >> $TMPH
1267 echo "#define HAVE_THREADS 1" >> $TMPH
1268 if test $targetos != FreeBSD; then
1269 extralibs="$extralibs -lpthread"
1272 if test "$sdl" = "yes" ; then
1273 echo "CONFIG_SDL=yes" >> config.mak
1274 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1275 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1277 if test "$texi2html" = "yes"; then
1278 echo "BUILD_DOC=yes" >> config.mak
1280 if test "$have_lrintf" = "yes" ; then
1281 echo "#define HAVE_LRINTF 1" >> $TMPH
1283 if test "$vhook" = "yes" ; then
1284 echo "BUILD_VHOOK=yes" >> config.mak
1285 echo "#define HAVE_VHOOK 1" >> $TMPH
1286 extralibs="$extralibs $ldl"
1288 if test "$lshared" = "yes" ; then
1289 echo "BUILD_SHARED=yes" >> config.mak
1290 echo "PIC=-fPIC" >> config.mak
1292 echo "EXTRALIBS=$extralibs" >> config.mak
1293 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1295 echo "VERSION=$version" >>config.mak
1296 # if you do not want to use encoders, disable that.
1297 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1298 echo "CONFIG_ENCODERS=yes" >> config.mak
1300 # if you do not want to use decoders, disable that.
1301 echo "#define CONFIG_DECODERS 1" >> $TMPH
1302 echo "CONFIG_DECODERS=yes" >> config.mak
1305 if test "$a52" = "yes" ; then
1306 echo "#define CONFIG_AC3 1" >> $TMPH
1307 echo "CONFIG_AC3=yes" >> config.mak
1309 if test "$a52bin" = "yes" ; then
1310 echo "#define CONFIG_A52BIN 1" >> $TMPH
1311 echo "CONFIG_A52BIN=yes" >> config.mak
1316 if test "$dts" = "yes" ; then
1317 echo "#define CONFIG_DTS 1" >> $TMPH
1318 echo "CONFIG_DTS=yes" >> config.mak
1322 if test "$pp" = "yes" ; then
1323 echo "#define CONFIG_PP 1" >> $TMPH
1324 echo "CONFIG_PP=yes" >> config.mak
1326 if test "$shared_pp" = "yes" ; then
1327 echo "#define SHARED_PP 1" >> $TMPH
1328 echo "SHARED_PP=yes" >> config.mak
1332 # mpeg audio high precision mode
1333 if test "$mpegaudio_hp" = "yes" ; then
1334 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1337 if test "$v4l" = "yes" ; then
1338 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1339 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1342 if test "$dv1394" = "yes" ; then
1343 echo "#define CONFIG_DV1394 1" >> $TMPH
1344 echo "CONFIG_DV1394=yes" >> config.mak
1347 if test "$dc1394" = "yes" ; then
1348 echo "#define CONFIG_DC1394 1" >> $TMPH
1349 echo "CONFIG_DC1394=yes" >> config.mak
1352 if test "$dlopen" = "yes" ; then
1353 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1356 if test "$dlfcn" = "yes" ; then
1357 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1360 if test "$audio_oss" = "yes" ; then
1361 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1362 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1365 if test "$audio_beos" = "yes" ; then
1366 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1367 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1370 if test "$network" = "yes" ; then
1371 echo "#define CONFIG_NETWORK 1" >> $TMPH
1372 echo "CONFIG_NETWORK=yes" >> config.mak
1375 if test "$ipv6" = "yes" ; then
1376 echo "#define CONFIG_IPV6 1" >> $TMPH
1379 if test "$zlib" = "yes" ; then
1380 echo "#define CONFIG_ZLIB 1" >> $TMPH
1381 echo "CONFIG_ZLIB=yes" >> config.mak
1384 if test "$mp3lame" = "yes" ; then
1385 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1386 echo "CONFIG_MP3LAME=yes" >> config.mak
1389 if test "$ogg" = "yes" ; then
1390 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1391 echo "CONFIG_LIBOGG=yes" >> config.mak
1394 if test "$vorbis" = "yes" ; then
1395 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1396 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1399 if test "$theora" = "yes" ; then
1400 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1401 echo "CONFIG_LIBTHEORA=yes" >> config.mak
1404 if test "$faad" = "yes" ; then
1405 echo "#define CONFIG_FAAD 1" >> $TMPH
1406 echo "CONFIG_FAAD=yes" >> config.mak
1409 if test "$faadbin" = "yes" ; then
1410 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1411 echo "CONFIG_FAADBIN=yes" >> config.mak
1414 if test "$faac" = "yes" ; then
1415 echo "#define CONFIG_FAAC 1" >> $TMPH
1416 echo "CONFIG_FAAC=yes" >> config.mak
1419 if test "$xvid" = "yes" ; then
1420 echo "#define CONFIG_XVID 1" >> $TMPH
1421 echo "CONFIG_XVID=yes" >> config.mak
1424 if test "$x264" = "yes" ; then
1425 echo "#define CONFIG_X264 1" >> $TMPH
1426 echo "CONFIG_X264=yes" >> config.mak
1429 if test "$mingw32" = "yes" ; then
1430 echo "#define CONFIG_WIN32 1" >> $TMPH
1431 echo "CONFIG_WIN32=yes" >> config.mak
1432 echo "HAVE_W32THREADS=yes" >> config.mak
1433 echo "#define HAVE_W32THREADS 1" >> $TMPH
1434 echo "#define HAVE_THREADS 1" >> $TMPH
1435 echo "#ifndef __MINGW32__" >> $TMPH
1436 echo "#define __MINGW32__ 1" >> $TMPH
1437 echo "#endif" >> $TMPH
1440 if test "$os2" = "yes" ; then
1441 echo "#define CONFIG_OS2 1" >> $TMPH
1442 echo "CONFIG_OS2=yes" >> config.mak
1445 if test "$TARGET_OS" = "SunOS" ; then
1446 echo "#define CONFIG_SUNOS 1" >> $TMPH
1449 if test "$TARGET_OS" = "BeOS" ; then
1450 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1451 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1452 echo "#define HAVE_THREADS 1" >> $TMPH
1455 if test "$darwin" = "yes"; then
1456 echo "#define CONFIG_DARWIN 1" >> $TMPH
1457 echo "CONFIG_DARWIN=yes" >> config.mak
1460 if test "$_malloc_h" = "yes" ; then
1461 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1463 echo "#undef HAVE_MALLOC_H" >> $TMPH
1466 if test "$_memalign" = "yes" ; then
1467 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1469 echo "#undef HAVE_MEMALIGN" >> $TMPH
1472 if test "$memalignhack" = "yes" ; then
1473 echo "#define MEMALIGN_HACK 1" >> $TMPH
1477 if test "$netserver" = "yes" ; then
1478 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1479 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1482 if test "$need_inet_aton" = "yes" ; then
1483 echo "NEED_INET_ATON=yes" >> config.mak
1486 if test "$simpleidct" = "yes" ; then
1487 echo "#define SIMPLE_IDCT 1" >> $TMPH
1490 if test "$ffserver" = "yes" ; then
1491 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1492 echo "CONFIG_FFSERVER=yes" >> config.mak
1495 if test "$ffplay" = "yes" ; then
1496 echo "CONFIG_FFPLAY=yes" >> config.mak
1499 if test "$gpl" = "yes" ; then
1500 echo "#define CONFIG_GPL 1" >> $TMPH
1501 echo "CONFIG_GPL=yes" >> config.mak
1504 echo "#define restrict $_restrict" >> $TMPH
1506 if test "$optimize" = "small"; then
1507 echo "#define always_inline" >> $TMPH
1510 # build tree in object directory if source path is different from current one
1511 if test "$source_path_used" = "yes" ; then
1512 DIRS="doc libavformat libavcodec libavcodec/alpha libavcodec/armv4l \
1513 libavcodec/i386 libavcodec/sparc libavcodec/mlib \
1514 libavcodec/ppc libavcodec/liba52 libavcodec/libpostproc tests vhook"
1515 FILES="Makefile libavformat/Makefile libavcodec/Makefile \
1516 libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
1517 doc/Makefile doc/texi2pod.pl"
1518 for dir in $DIRS ; do
1521 for f in $FILES ; do
1522 ln -sf "$source_path/$f" $f
1524 echo "SRC_PATH=$source_path" >> config.mak
1526 echo "SRC_PATH='$source_path'" >> config.mak
1529 if test "$amr_wb" = "yes" ; then
1530 echo "#define AMR_WB 1" >> $TMPH
1531 echo "AMR_WB=yes" >> config.mak
1533 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1535 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1536 echo "and extracted the source to libavcodec/amrwb_float"
1540 if test "$amr_nb" = "yes" ; then
1541 echo "#define AMR_NB 1" >> $TMPH
1542 echo "AMR_NB=yes" >> config.mak
1544 if test "$amr_nb_fixed" = "yes" ; then
1545 echo "AMR_NB_FIXED=yes" >> config.mak
1546 echo "#define AMR_NB_FIXED 1" >> $TMPH
1547 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1548 echo "REL-5 version 5.1.0 from "
1549 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1550 echo "and extracted src to libavcodec/amr"
1551 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1552 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1555 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1556 echo "REL-5 V5.1.0 from "
1557 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1558 echo "and extracted the source to libavcodec/amr_float"
1559 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1563 if test "$amr_if2" = "yes" ; then
1564 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1569 diff $TMPH config.h >/dev/null 2>&1
1570 if test $? -ne 0 ; then
1571 mv -f $TMPH config.h
1573 echo "config.h is unchanged"
1576 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH