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-vorbis enable vorbis support via libvorbisenc [default=no]"
19 echo " --enable-faad enable faad support via libfaad [default=no]"
20 echo " --enable-faadbin build faad support with runtime linking [default=no]"
21 echo " --enable-faac enable faac support via libfaac [default=no]"
22 echo " --enable-xvid enable xvid support via xvidcore [default=no]"
23 echo " --enable-mingw32 enable mingw32 native/cross windows compile"
24 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
25 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
26 echo " --enable-dts enable GPL'ed DTS support [default=no]"
27 echo " --enable-pp enable GPL'ed post processing support [default=no]"
28 echo " --enable-shared-pp use libpostproc.so [default=no]"
29 echo " --enable-shared build shared libraries [default=no]"
30 echo " --enable-amr_nb enable amr_nb float audio codec"
31 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
32 echo " --enable-amr_wb enable amr_wb float audio codec"
33 echo " --enable-sunmlib use Sun medialib [default=no]"
34 echo " --enable-pthreads use pthreads [default=no]"
35 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [default=no]"
36 echo " --enable-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
38 echo "Advanced options (experts only):"
39 echo " --source-path=PATH path of source code [$source_path]"
40 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
41 echo " --cc=CC use C compiler CC [$cc]"
42 echo " --make=MAKE use specified make [$make]"
43 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
44 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
45 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
46 echo " --cpu=CPU force cpu to CPU [$cpu]"
47 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
48 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
49 echo " --disable-mmx disable mmx usage"
50 echo " --disable-altivec disable AltiVec usage"
51 echo " --disable-audio-oss disable OSS audio support [default=no]"
52 echo " --disable-audio-beos disable BeOS audio support [default=no]"
53 echo " --disable-v4l disable video4linux grabbing [default=no]"
54 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
55 echo " --disable-network disable network support [default=no]"
56 echo " --disable-zlib disable zlib [default=no]"
57 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
58 echo " --disable-vhook disable video hooking support"
59 echo " --enable-gprof enable profiling with gprof [$gprof]"
60 echo " --disable-debug disable debugging symbols"
61 echo " --disable-opts disable compiler optimizations"
62 echo " --disable-mpegaudio-hp faster (but less accurate)"
63 echo " mpegaudio decoding [default=no]"
64 echo " --disable-ffserver disable ffserver build"
65 echo " --disable-ffplay disable ffplay build"
66 echo " --enable-small optimize for size instead of speed"
67 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
68 echo " --disable-strip disable stripping of executables and shared libraries"
70 echo "NOTE: The object files are build at the place where configure is launched"
74 # set temporary file name
75 if test ! -z "$TMPDIR" ; then
77 elif test ! -z "$TEMPDIR" ; then
83 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
84 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
85 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
86 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
87 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
106 i386|i486|i586|i686|i86pc|BePC)
110 if [ "`$cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
111 -z "`echo $CFLAGS | grep -- -m32`" ]; then
117 # armv4l is a subset of armv5tel
124 "Power Macintosh"|ppc)
183 LDFLAGS=-Wl,--warn-common
202 prefix="/boot/home/config"
203 # helps building libavcodec
204 CFLAGS="-DPIC -fomit-frame-pointer"
205 # 3 gcc releases known for BeOS, each with ugly bugs
206 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
207 case "$gcc_version" in
208 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
211 *20010315*) echo "BeBits gcc"
212 CFLAGS="$CFLAGS -fno-expensive-optimizations"
216 # disable linux things
222 # no need for libm, but the inet stuff
224 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
225 extralibs="-lbind -lsocket"
239 extralibs="$extralibs -lsocket -lnsl"
247 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
253 extralibs="-lpoll -lgnugetopt -lm"
262 SHFLAGS="-dynamiclib"
266 LDFLAGS="-Wl,-d,-search_paths_first"
267 FFSLDFLAGS=-Wl,-bind_at_load
270 # Note: the rest of the mingw32 config is done afterwards as mingw32
271 # can be forced on command line for linux cross compilation
282 test -f /usr/include/inttypes.h || \
283 test -f /usr/local/include/inttypes.h || \
284 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
285 "/usr/local/include/inttypes.h !!!"
288 LDFLAGS="$LDFLAGS -rdynamic"
291 ranlib="echo ignoring ranlib"
299 ranlib="echo ignoring ranlib"
300 strip="echo ignoring strip"
302 LDFLAGS="-Zomf -Zstack 16384 -s"
321 # From mplayer configure. We need TARGET_OS available
322 # to the Makefile, so it can distinguish between flavors
323 # of AltiVec on PowerPC
324 TARGET_OS=`( uname -s ) 2>&1`
326 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
334 [cC][yY][gG][wW][iI][nN]*)
338 TARGET_OS="$TARGET_OS-UNKNOWN"
343 # XXX: we assume an absolute path is given when launching configure,
344 # except in './configure' case.
345 source_path="`echo $0 | sed -e 's#/configure##'`"
346 source_path_used="yes"
347 if test -z "$source_path" -o "$source_path" = "." ; then
349 source_path_used="no"
352 FFMPEG_CONFIGURATION=" "
354 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
359 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
361 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
363 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
365 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
367 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
369 --make=*) make=`echo $opt | cut -d '=' -f 2`
371 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
373 --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
375 --extra-libs=*) extralibs=${opt#--extra-libs=}
377 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
379 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
381 --powerpc-perf-enable) powerpc_perf="yes"
383 --disable-mmx) mmx="no"
385 --disable-altivec) altivec="no"
387 --enable-gprof) gprof="yes"
389 --disable-v4l) v4l="no"
391 --disable-audio-oss) audio_oss="no"
393 --disable-audio-beos) audio_beos="no"
395 --disable-dv1394) dv1394="no"
397 --disable-network) network="no"; ffserver="no"
399 --disable-zlib) zlib="no"
401 --enable-a52) a52="yes"
403 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
405 --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
407 --enable-pp) pp="yes"
409 --enable-shared-pp) shared_pp="yes"
411 --enable-mp3lame) mp3lame="yes"
413 --enable-vorbis) vorbis="yes"
415 --enable-faad) faad="yes"
417 --enable-faadbin) faadbin="yes"
419 --enable-faac) faac="yes"
421 --enable-xvid) xvid="yes"
423 --enable-dc1394) dc1394="yes"
425 --disable-vhook) vhook="no"
427 --disable-simple_idct) simpleidct="no"
429 --enable-mingw32) mingw32="yes"
431 --enable-shared) lshared="yes"
433 --disable-debug) debug="no"
435 --disable-opts) optimize="no"
437 --disable-mpegaudio-hp) mpegaudio_hp="no"
439 --disable-ffserver) ffserver="no"
441 --disable-ffplay) ffplay="no"
443 --enable-small) optimize="small"
445 --enable-amr_nb) amr_nb="yes"
447 --enable-amr_nb-fixed) amr_nb_fixed="yes"
449 --enable-amr_wb) amr_wb="yes"
451 --enable-sunmlib) sunmlib="yes"
453 --enable-pthreads) pthreads="yes"
455 --enable-gpl) gpl="yes"
457 --enable-memalign-hack) memalignhack="yes"
459 --disable-strip) dostrip="no"
464 if test "$gpl" != "yes"; then
465 if test "$pp" != "no" -o "$shared_pp" != "no"; then
466 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
470 if test "$a52" != "no" -o "$a52bin" != "no"; then
471 echo "liba52 is under GPL and --enable-gpl is not specified"
475 if test "$xvid" != "no"; then
476 echo "libxvidcore is under GPL and --enable-gpl is not specified"
480 if test "$dts" != "no"; then
481 echo "libdts is under GPL and --enable-gpl is not specified"
485 if test "$faad" != "no" -o "$faadbin" != "no"; then
488 int main( void ) { return 0; }
491 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
494 #ifndef FAAD2_VERSION
497 int main( void ) { return 0; }
499 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
500 echo "faad2 is under GPL and --enable-gpl is not specified"
506 echo "faad test failed"
511 if test "$fail" = "yes"; then
517 if test $mmx = "default"; then
518 if test $cpu = "x86" -o $cpu = "x86_64"; then
526 needmdynamicnopic="no"
527 if test $targetos = Darwin; then
528 if test -n "`$cc -v 2>&1 | grep xlc`"; then
529 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
531 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
532 case "$gcc_version" in
534 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
537 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
538 if test "$lshared" = no; then
539 needmdynamicnopic="yes"
543 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
544 if test "$lshared" = no; then
545 needmdynamicnopic="yes"
552 # Can only do AltiVec on PowerPC
553 if test $altivec = "default"; then
554 if test $cpu = "powerpc"; then
561 # Add processor-specific flags
564 if test $tune != "generic"; then
566 601|ppc601|PowerPC601)
567 CFLAGS="$CFLAGS -mcpu=601"
568 if test $altivec = "yes"; then
569 echo "WARNING: tuning for PPC601 but altivec enabled !";
573 603*|ppc603*|PowerPC603*)
574 CFLAGS="$CFLAGS -mcpu=603"
575 if test $altivec = "yes"; then
576 echo "WARNING: tuning for PPC603 but altivec enabled !";
580 604*|ppc604*|PowerPC604*)
581 CFLAGS="$CFLAGS -mcpu=604"
582 if test $altivec = "yes"; then
583 echo "WARNING: tuning for PPC604 but altivec enabled !";
587 G3|g3|75*|ppc75*|PowerPC75*)
588 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
589 if test $altivec = "yes"; then
590 echo "WARNING: tuning for PPC75x but altivec enabled !";
594 G4|g4|745*|ppc745*|PowerPC745*)
595 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
596 if test $altivec = "no"; then
597 echo "WARNING: tuning for PPC745x but altivec disabled !";
601 74*|ppc74*|PowerPC74*)
602 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
603 if test $altivec = "no"; then
604 echo "WARNING: tuning for PPC74xx but altivec disabled !";
608 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
609 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
610 if test $altivec = "no"; then
611 echo "WARNING: tuning for PPC970 but altivec disabled !";
617 echo "WARNING: unknown CPU "$tune", ignored"
622 # AltiVec flags: The FSF version of GCC differs from the Apple version
623 if test $cpu = "powerpc"; then
624 if test $altivec = "yes"; then
625 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
626 CFLAGS="$CFLAGS -faltivec"
628 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
633 # See if we have <altivec.h>
636 int main( void ) { return 0; }
640 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
644 # See does our compiler support Motorola AltiVec C API
645 if test $altivec = "yes"; then
646 if test $_altivec_h = "yes"; then
650 vector signed int v1, v2, v3;
658 vector signed int v1, v2, v3;
664 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
667 # Can only do mmi on mips
668 if test $mmi = "default"; then
669 if test $cpu = "mips"; then
676 # See does our compiler support mmi
677 if test $mmi = "yes"; then
680 __asm__ ("lq \$2, 0(\$2)");
684 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
687 if test "$mingw32" = "yes" ; then
699 prefix="/c/Program Files/FFmpeg"
703 cc="${cross_prefix}${cc}"
704 ar="${cross_prefix}${ar}"
705 ranlib="${cross_prefix}${ranlib}"
706 strip="${cross_prefix}${strip}"
708 if test -z "$cross_prefix" ; then
711 # big/little endian test
713 #include <inttypes.h>
714 int main(int argc, char ** argv){
715 volatile uint32_t i=0x01234567;
716 return (*((uint8_t*)(&i))) == 0x67;
720 if $cc -o $TMPE $TMPC 2>/dev/null ; then
721 $TMPE && bigendian="yes"
723 echo big/little test failed
728 # if cross compiling, cannot launch a program, so make a static guess
729 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
738 #include <inttypes.h>
739 int main(int argc, char ** argv){
744 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
749 #include <inttypes.h>
750 int main(int argc, char ** argv){
751 volatile uint_fast64_t i=0x01234567;
756 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
759 # check availability of some header files
763 int main( void ) { return 0; }
768 if $cc -o $TMPE $TMPC 2> /dev/null ; then
771 # check for memalign - atmos
777 string = memalign(64, sizeof(char));
781 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
784 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
785 echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
791 int main( void ) { localtime_r(NULL, NULL); }
795 if $cc -o $TMPE $TMPC 2> /dev/null ; then
799 if test "$zlib" = "yes"; then
800 # check for zlib - mmu_man
804 if (zlibVersion() != ZLIB_VERSION)
805 puts("zlib version differs !!!");
810 $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
811 # $TMPE 2> /dev/null > /dev/null || zlib="no"
812 # XXX: more tests needed - runtime test
814 if test "$zlib" = "yes"; then
815 extralibs="$extralibs -lz"
818 # test for lrintf in math.h
820 #define _ISOC9X_SOURCE 1
822 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
826 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
828 # allanc@chickenandporn.com: cannot execute cross-compiled
829 # code on the host. Only execute if not cross-compiling.
830 if test -z "$cross_prefix" ; then
831 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
836 for restrict_keyword in restrict __restrict__ __restrict; do
837 echo "void foo(char * $restrict_keyword p);" > $TMPC
838 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
839 _restrict=$restrict_keyword
844 # test gcc version to see if vector builtins can be used
845 # currently only used on i386 for MMX builtins
847 #include <xmmintrin.h>
849 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
852 #error no vector builtins
858 if $cc -o $TMPO $TMPC 2> /dev/null ; then
862 # dlopen/dlfcn.h probing
866 int main( void ) { return (int) dlopen("foo", 0); }
871 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
876 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
883 int main( void ) { return (int) dlopen("foo", 0); }
886 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
890 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
895 if test "$vhook" = "default" ; then
899 ##########################################
903 #include <X11/Xlib.h>
905 int main( void ) { return (int) imlib_load_font("foo"); }
909 if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
913 ##########################################
917 #include <ft2build.h>
918 int main( void ) { return (int) FT_Init_FreeType(0); }
922 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
923 if (freetype-config --version) >/dev/null 2>&1 ; then
924 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
930 ##########################################
935 #undef main /* We don't want SDL to override our main() */
936 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
941 if (sdl-config --version) >/dev/null 2>&1 ; then
942 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
943 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
944 if test "$_sdlversion" -lt 121 ; then
952 ##########################################
956 if (texi2html -version) >/dev/null 2>&1; then
960 if test "$network" = "yes" ; then
961 ##########################################
965 #include <sys/types.h>
966 #include <sys/socket.h>
967 #include <netinet/in.h>
970 struct sockaddr_storage saddr;
971 struct ipv6_mreq mreq6;
972 getaddrinfo(0,0,0,0);
973 getnameinfo(0,0,0,0,0,0,0);
974 IN6_IS_ADDR_MULTICAST(0);
979 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
984 case "`$cc -v 2>&1 | grep version`" in
986 CFLAGS="-Wall -Wno-switch $CFLAGS"
992 if test "$sdl" = "no" ; then
996 if test "$debug" = "yes"; then
1000 if test "$optimize" = "small"; then
1001 # CFLAGS=${CFLAGS//-O3/-Os}
1002 CFLAGS="$CFLAGS -Os"
1005 if test "$optimize" = "yes"; then
1006 if test -n "`$cc -v 2>&1 | grep xlc`"; then
1007 CFLAGS="$CFLAGS -O5"
1008 LDFLAGS="$LDFLAGS -O5"
1010 CFLAGS="-O3 $CFLAGS"
1014 if test x"$bindir" = x""; then
1015 bindir="${prefix}/bin"
1018 if test x"$mandir" = x""; then
1019 mandir="${prefix}/man"
1022 echo "Install prefix $prefix"
1023 echo "Source path $source_path"
1024 echo "C compiler $cc"
1026 echo "CPU $cpu ($tune)"
1027 echo "Big Endian $bigendian"
1028 echo "inttypes.h $inttypes"
1029 echo "broken inttypes.h $emu_fast_int"
1030 if test $cpu = "x86" -o $cpu = "x86_64"; then
1031 echo "MMX enabled $mmx"
1032 echo "Vector Builtins $builtin_vector"
1034 if test $cpu = "mips"; then
1035 echo "MMI enabled $mmi"
1037 if test $cpu = "powerpc"; then
1038 echo "AltiVec enabled $altivec"
1040 echo "gprof enabled $gprof"
1041 echo "zlib enabled $zlib"
1042 echo "mp3lame enabled $mp3lame"
1043 echo "vorbis enabled $vorbis"
1044 echo "faad enabled $faad"
1045 echo "faadbin enabled $faadbin"
1046 echo "faac enabled $faac"
1047 echo "xvid enabled $xvid"
1048 echo "a52 support $a52"
1049 echo "a52 dlopened $a52bin"
1050 echo "dts support $dts"
1051 echo "pp support $pp"
1052 echo "debug symbols $debug"
1053 echo "strip symbols $dostrip"
1054 echo "optimize $optimize"
1055 echo "shared pp $shared_pp"
1056 echo "Video hooking $vhook"
1057 echo "SDL support $sdl"
1058 if test $sdl_too_old = "yes"; then
1059 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1062 if test "$vhook" = "yes" ; then
1063 echo "Imlib2 support $imlib2"
1064 echo "freetype support $freetype2"
1066 echo "Sun medialib support" $sunmlib
1067 echo "pthreads support" $pthreads
1068 echo "AMR-NB float support" $amr_nb
1069 echo "AMR-NB fixed support" $amr_nb_fixed
1070 echo "AMR-WB float support" $amr_wb
1071 echo "network support $network"
1072 if test "$network" = "yes" ; then
1073 echo "IPv6 support $ipv6"
1075 if test "$gpl" = "no" ; then
1076 echo "License: LGPL"
1081 echo "Creating config.mak and config.h"
1084 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1085 echo "# Automatically generated by configure - do not modify" > config.mak
1086 echo "/* Automatically generated by configure - do not modify */" > $TMPH
1087 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1089 echo "prefix=$prefix" >> config.mak
1090 echo "bindir=$bindir" >> config.mak
1091 echo "mandir=$mandir" >> config.mak
1092 echo "MAKE=$make" >> config.mak
1093 echo "CC=$cc" >> config.mak
1094 echo "AR=$ar" >> config.mak
1095 echo "RANLIB=$ranlib" >> config.mak
1096 if test "$dostrip" = "yes" ; then
1097 echo "STRIP=$strip" >> config.mak
1098 echo "INSTALLSTRIP=-s" >> config.mak
1100 echo "STRIP=echo ignoring strip" >> config.mak
1101 echo "INSTALLSTRIP=" >> config.mak
1104 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1105 # shared modules on OS/X (vhook/Makefile).
1107 if test "$needmdynamicnopic" = yes; then
1108 CFLAGS="$CFLAGS -mdynamic-no-pic"
1111 echo "OPTFLAGS=$CFLAGS" >> config.mak
1112 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1113 echo "LDFLAGS=$LDFLAGS" >> config.mak
1114 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1115 echo "SHFLAGS=$SHFLAGS" >> config.mak
1116 echo "LIBPREF=$LIBPREF" >> config.mak
1117 echo "LIBSUF=$LIBSUF" >> config.mak
1118 echo "SLIBPREF=$SLIBPREF" >> config.mak
1119 echo "SLIBSUF=$SLIBSUF" >> config.mak
1120 echo "EXESUF=$EXESUF" >> config.mak
1121 echo "TARGET_OS=$TARGET_OS" >> config.mak
1122 if test "$cpu" = "x86" ; then
1123 echo "TARGET_ARCH_X86=yes" >> config.mak
1124 echo "#define ARCH_X86 1" >> $TMPH
1125 elif test "$cpu" = "x86_64" ; then
1126 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1127 echo "#define ARCH_X86_64 1" >> $TMPH
1128 elif test "$cpu" = "armv4l" ; then
1129 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1130 echo "#define ARCH_ARMV4L 1" >> $TMPH
1131 elif test "$cpu" = "alpha" ; then
1132 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1133 echo "#define ARCH_ALPHA 1" >> $TMPH
1134 elif test "$cpu" = "sparc64" ; then
1135 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1136 echo "#define ARCH_SPARC64 1" >> $TMPH
1137 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1138 echo "#define ARCH_SPARC 1" >> $TMPH
1139 elif test "$cpu" = "sparc" ; then
1140 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1141 echo "#define ARCH_SPARC 1" >> $TMPH
1142 elif test "$cpu" = "powerpc" ; then
1143 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1144 echo "#define ARCH_POWERPC 1" >> $TMPH
1145 if test $POWERPCMODE = "32bits"; then
1146 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1148 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1150 if test "$powerpc_perf" = "yes"; then
1151 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1153 elif test "$cpu" = "mips" ; then
1154 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1155 echo "#define ARCH_MIPS 1" >> $TMPH
1156 elif test "$cpu" = "sh4" ; then
1157 echo "TARGET_ARCH_SH4=yes" >> config.mak
1158 echo "#define ARCH_SH4 1" >> $TMPH
1160 echo "#define TUNECPU $TUNECPU" >> $TMPH
1161 if test "$bigendian" = "yes" ; then
1162 echo "WORDS_BIGENDIAN=yes" >> config.mak
1163 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1165 if test "$inttypes" != "yes" ; then
1166 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1168 if test "$emu_fast_int" = "yes" ; then
1169 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1171 if test "$mmx" = "yes" ; then
1172 echo "TARGET_MMX=yes" >> config.mak
1173 echo "#define HAVE_MMX 1" >> $TMPH
1174 echo "#define __CPU__ 586" >> $TMPH
1176 if test "$builtin_vector" = "yes" ; then
1177 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1178 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1180 if test "$mmi" = "yes" ; then
1181 echo "TARGET_MMI=yes" >> config.mak
1182 echo "#define HAVE_MMI 1" >> $TMPH
1184 if test "$altivec" = "yes" ; then
1185 echo "TARGET_ALTIVEC=yes" >> config.mak
1186 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1187 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1188 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1189 if test "$_altivec_h" = "yes" ; then
1190 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1192 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1195 if test "$gprof" = "yes" ; then
1196 echo "TARGET_GPROF=yes" >> config.mak
1197 echo "#define HAVE_GPROF 1" >> $TMPH
1199 if test "$localtime_r" = "yes" ; then
1200 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1202 if test "$imlib2" = "yes" ; then
1203 echo "HAVE_IMLIB2=yes" >> config.mak
1205 if test "$freetype2" = "yes" ; then
1206 echo "HAVE_FREETYPE2=yes" >> config.mak
1208 if test "$sunmlib" = "yes" ; then
1209 echo "HAVE_MLIB=yes" >> config.mak
1210 echo "#define HAVE_MLIB 1" >> $TMPH
1211 extralibs="$extralibs -lmlib"
1213 if test "$pthreads" = "yes" ; then
1214 echo "HAVE_PTHREADS=yes" >> config.mak
1215 echo "#define HAVE_PTHREADS 1" >> $TMPH
1216 echo "#define HAVE_THREADS 1" >> $TMPH
1217 if test $targetos != FreeBSD; then
1218 extralibs="$extralibs -lpthread"
1221 if test "$sdl" = "yes" ; then
1222 echo "CONFIG_SDL=yes" >> config.mak
1223 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1224 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1226 if test "$texi2html" = "yes"; then
1227 echo "BUILD_DOC=yes" >> config.mak
1229 if test "$have_lrintf" = "yes" ; then
1230 echo "#define HAVE_LRINTF 1" >> $TMPH
1232 if test "$vhook" = "yes" ; then
1233 echo "BUILD_VHOOK=yes" >> config.mak
1234 echo "#define HAVE_VHOOK 1" >> $TMPH
1235 extralibs="$extralibs $ldl"
1237 if test "$lshared" = "yes" ; then
1238 echo "BUILD_SHARED=yes" >> config.mak
1239 echo "PIC=-fPIC" >> config.mak
1241 echo "EXTRALIBS=$extralibs" >> config.mak
1242 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1244 echo "VERSION=$version" >>config.mak
1245 # if you do not want to use encoders, disable that.
1246 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1247 echo "CONFIG_ENCODERS=yes" >> config.mak
1249 # if you do not want to use decoders, disable that.
1250 echo "#define CONFIG_DECODERS 1" >> $TMPH
1251 echo "CONFIG_DECODERS=yes" >> config.mak
1254 if test "$a52" = "yes" ; then
1255 echo "#define CONFIG_AC3 1" >> $TMPH
1256 echo "CONFIG_AC3=yes" >> config.mak
1258 if test "$a52bin" = "yes" ; then
1259 echo "#define CONFIG_A52BIN 1" >> $TMPH
1260 echo "CONFIG_A52BIN=yes" >> config.mak
1265 if test "$dts" = "yes" ; then
1266 echo "#define CONFIG_DTS 1" >> $TMPH
1267 echo "CONFIG_DTS=yes" >> config.mak
1271 if test "$pp" = "yes" ; then
1272 echo "#define CONFIG_PP 1" >> $TMPH
1273 echo "CONFIG_PP=yes" >> config.mak
1275 if test "$shared_pp" = "yes" ; then
1276 echo "#define SHARED_PP 1" >> $TMPH
1277 echo "SHARED_PP=yes" >> config.mak
1281 # mpeg audio high precision mode
1282 if test "$mpegaudio_hp" = "yes" ; then
1283 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1286 if test "$v4l" = "yes" ; then
1287 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1288 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1291 if test "$dv1394" = "yes" ; then
1292 echo "#define CONFIG_DV1394 1" >> $TMPH
1293 echo "CONFIG_DV1394=yes" >> config.mak
1296 if test "$dc1394" = "yes" ; then
1297 echo "#define CONFIG_DC1394 1" >> $TMPH
1298 echo "CONFIG_DC1394=yes" >> config.mak
1301 if test "$dlopen" = "yes" ; then
1302 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1305 if test "$dlfcn" = "yes" ; then
1306 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1309 if test "$audio_oss" = "yes" ; then
1310 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1311 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1314 if test "$audio_beos" = "yes" ; then
1315 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1316 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1319 if test "$network" = "yes" ; then
1320 echo "#define CONFIG_NETWORK 1" >> $TMPH
1321 echo "CONFIG_NETWORK=yes" >> config.mak
1324 if test "$ipv6" = "yes" ; then
1325 echo "#define CONFIG_IPV6 1" >> $TMPH
1328 if test "$zlib" = "yes" ; then
1329 echo "#define CONFIG_ZLIB 1" >> $TMPH
1330 echo "CONFIG_ZLIB=yes" >> config.mak
1333 if test "$mp3lame" = "yes" ; then
1334 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1335 echo "CONFIG_MP3LAME=yes" >> config.mak
1338 if test "$vorbis" = "yes" ; then
1339 echo "#define CONFIG_VORBIS 1" >> $TMPH
1340 echo "CONFIG_VORBIS=yes" >> config.mak
1343 if test "$faad" = "yes" ; then
1344 echo "#define CONFIG_FAAD 1" >> $TMPH
1345 echo "CONFIG_FAAD=yes" >> config.mak
1348 if test "$faadbin" = "yes" ; then
1349 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1350 echo "CONFIG_FAADBIN=yes" >> config.mak
1353 if test "$faac" = "yes" ; then
1354 echo "#define CONFIG_FAAC 1" >> $TMPH
1355 echo "CONFIG_FAAC=yes" >> config.mak
1358 if test "$xvid" = "yes" ; then
1359 echo "#define CONFIG_XVID 1" >> $TMPH
1360 echo "CONFIG_XVID=yes" >> config.mak
1363 if test "$mingw32" = "yes" ; then
1364 echo "#define CONFIG_WIN32 1" >> $TMPH
1365 echo "CONFIG_WIN32=yes" >> config.mak
1366 echo "HAVE_W32THREADS=yes" >> config.mak
1367 echo "#define HAVE_W32THREADS 1" >> $TMPH
1368 echo "#define HAVE_THREADS 1" >> $TMPH
1369 echo "#ifndef __MINGW32__" >> $TMPH
1370 echo "#define __MINGW32__ 1" >> $TMPH
1371 echo "#endif" >> $TMPH
1374 if test "$os2" = "yes" ; then
1375 echo "#define CONFIG_OS2 1" >> $TMPH
1376 echo "CONFIG_OS2=yes" >> config.mak
1379 if test "$TARGET_OS" = "SunOS" ; then
1380 echo "#define CONFIG_SUNOS 1" >> $TMPH
1383 if test "$TARGET_OS" = "BeOS" ; then
1384 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1385 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1386 echo "#define HAVE_THREADS 1" >> $TMPH
1389 if test "$darwin" = "yes"; then
1390 echo "#define CONFIG_DARWIN 1" >> $TMPH
1391 echo "CONFIG_DARWIN=yes" >> config.mak
1394 if test "$_malloc_h" = "yes" ; then
1395 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1397 echo "#undef HAVE_MALLOC_H" >> $TMPH
1400 if test "$_memalign" = "yes" ; then
1401 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1403 echo "#undef HAVE_MEMALIGN" >> $TMPH
1406 if test "$memalignhack" = "yes" ; then
1407 echo "#define MEMALIGN_HACK 1" >> $TMPH
1411 if test "$netserver" = "yes" ; then
1412 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1413 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1416 if test "$need_inet_aton" = "yes" ; then
1417 echo "NEED_INET_ATON=yes" >> config.mak
1420 if test "$simpleidct" = "yes" ; then
1421 echo "#define SIMPLE_IDCT 1" >> $TMPH
1424 if test "$ffserver" = "yes" ; then
1425 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1426 echo "CONFIG_FFSERVER=yes" >> config.mak
1429 if test "$ffplay" = "yes" ; then
1430 echo "CONFIG_FFPLAY=yes" >> config.mak
1433 if test "$gpl" = "yes" ; then
1434 echo "#define CONFIG_GPL 1" >> $TMPH
1435 echo "CONFIG_GPL=yes" >> config.mak
1438 echo "#define restrict $_restrict" >> $TMPH
1440 if test "$optimize" = "small"; then
1441 echo "#define always_inline" >> $TMPH
1444 # build tree in object directory if source path is different from current one
1445 if test "$source_path_used" = "yes" ; then
1446 DIRS="doc libavformat libavcodec libavcodec/alpha libavcodec/armv4l \
1447 libavcodec/i386 libavcodec/sparc libavcodec/mlib \
1448 libavcodec/ppc libavcodec/liba52 libavcodec/libpostproc tests vhook"
1449 FILES="Makefile libavformat/Makefile libavcodec/Makefile \
1450 libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
1451 doc/Makefile doc/texi2pod.pl"
1452 for dir in $DIRS ; do
1455 for f in $FILES ; do
1456 ln -sf "$source_path/$f" $f
1458 echo "SRC_PATH=$source_path" >> config.mak
1460 echo "SRC_PATH='$source_path'" >> config.mak
1463 if test "$amr_wb" = "yes" ; then
1464 echo "#define AMR_WB 1" >> $TMPH
1465 echo "AMR_WB=yes" >> config.mak
1467 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1469 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1470 echo "and extracted the source to libavcodec/amrwb_float"
1474 if test "$amr_nb" = "yes" ; then
1475 echo "#define AMR_NB 1" >> $TMPH
1476 echo "AMR_NB=yes" >> config.mak
1478 if test "$amr_nb_fixed" = "yes" ; then
1479 echo "AMR_NB_FIXED=yes" >> config.mak
1480 echo "#define AMR_NB_FIXED 1" >> $TMPH
1481 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1482 echo "REL-5 version 5.1.0 from "
1483 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1484 echo "and extracted src to libavcodec/amr"
1485 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1486 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1489 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1490 echo "REL-5 V5.1.0 from "
1491 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1492 echo "and extracted the source to libavcodec/amr_float"
1493 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1499 diff $TMPH config.h >/dev/null 2>&1
1500 if test $? -ne 0 ; then
1501 mv -f $TMPH config.h
1503 echo "config.h is unchanged"
1506 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH