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 man documentation 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-xvid enable xvid support via xvidcore [default=no]"
26 echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
27 echo " --enable-mingw32 enable mingw32 native/cross windows compile"
28 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
29 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
30 echo " --enable-dts enable GPL'ed DTS support [default=no]"
31 echo " --enable-pp enable GPL'ed post processing support [default=no]"
32 echo " --enable-shared-pp use libpostproc.so [default=no]"
33 echo " --enable-shared build shared libraries [default=no]"
34 echo " --enable-amr_nb enable amr_nb float audio codec"
35 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
36 echo " --enable-amr_wb enable amr_wb float audio codec"
37 echo " --enable-sunmlib use Sun medialib [default=no]"
38 echo " --enable-pthreads use pthreads [default=no]"
39 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [default=no]"
40 echo " --enable-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
42 echo "Advanced options (experts only):"
43 echo " --source-path=PATH path of source code [$source_path]"
44 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
45 echo " --cc=CC use C compiler CC [$cc]"
46 echo " --make=MAKE use specified make [$make]"
47 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
48 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
49 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
50 echo " --build-suffix=SUFFIX suffix for application specific build []"
51 echo " --cpu=CPU force cpu to CPU [$cpu]"
52 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
53 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
54 echo " --disable-mmx disable mmx usage"
55 echo " --disable-altivec disable AltiVec usage"
56 echo " --disable-audio-oss disable OSS audio support [default=no]"
57 echo " --disable-audio-beos disable BeOS audio support [default=no]"
58 echo " --disable-v4l disable video4linux grabbing [default=no]"
59 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
60 echo " --disable-network disable network support [default=no]"
61 echo " --disable-zlib disable zlib [default=no]"
62 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
63 echo " --disable-vhook disable video hooking support"
64 echo " --enable-gprof enable profiling with gprof [$gprof]"
65 echo " --disable-debug disable debugging symbols"
66 echo " --disable-opts disable compiler optimizations"
67 echo " --disable-mpegaudio-hp faster (but less accurate)"
68 echo " mpegaudio decoding [default=no]"
69 echo " --disable-ffserver disable ffserver build"
70 echo " --disable-ffplay disable ffplay build"
71 echo " --enable-small optimize for size instead of speed"
72 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
73 echo " --disable-strip disable stripping of executables and shared libraries"
74 echo " --enable-codec=codec enables codec"
75 echo " --disable-codec=codec disables codec"
76 echo " --disable-encoders disables all encoders"
78 echo "NOTE: The object files are build at the place where configure is launched"
82 # set temporary file name
83 if test ! -z "$TMPDIR" ; then
85 elif test ! -z "$TEMPDIR" ; then
91 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
92 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
93 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
94 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
95 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
115 i386|i486|i586|i686|i86pc|BePC)
119 if [ "`$cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
120 -z "`echo $CFLAGS | grep -- -m32`" ]; then
126 # armv4l is a subset of armv5tel
133 "Power Macintosh"|ppc)
195 LDFLAGS=-Wl,--warn-common
216 prefix="/boot/home/config"
217 # helps building libavcodec
218 CFLAGS="-DPIC -fomit-frame-pointer"
219 # 3 gcc releases known for BeOS, each with ugly bugs
220 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
221 case "$gcc_version" in
222 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
225 *20010315*) echo "BeBits gcc"
226 CFLAGS="$CFLAGS -fno-expensive-optimizations"
230 # disable linux things
236 # no need for libm, but the inet stuff
238 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
239 extralibs="-lbind -lsocket"
253 extralibs="$extralibs -lsocket -lnsl"
260 LDFLAGS="$LDFLAGS -export-dynamic"
262 2.*) extralibs="-lossaudio"
272 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
278 extralibs="-lpoll -lgnugetopt -lm"
287 SHFLAGS="-dynamiclib"
291 LDFLAGS="-Wl,-d,-search_paths_first"
292 FFSLDFLAGS=-Wl,-bind_at_load
295 # Note: the rest of the mingw32 config is done afterwards as mingw32
296 # can be forced on command line for linux cross compilation
307 test -f /usr/include/inttypes.h || \
308 test -f /usr/local/include/inttypes.h || \
309 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
310 "/usr/local/include/inttypes.h !!!"
313 LDFLAGS="$LDFLAGS -rdynamic"
316 ranlib="echo ignoring ranlib"
324 ranlib="echo ignoring ranlib"
325 strip="echo ignoring strip"
327 LDFLAGS="-Zomf -Zstack 16384 -s"
328 SHFLAGS="-Zdll -Zomf"
348 # From mplayer configure. We need TARGET_OS available
349 # to the Makefile, so it can distinguish between flavors
350 # of AltiVec on PowerPC
351 TARGET_OS=`( uname -s ) 2>&1`
353 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
361 [cC][yY][gG][wW][iI][nN]*)
365 TARGET_OS="$TARGET_OS-UNKNOWN"
370 # XXX: we assume an absolute path is given when launching configure,
371 # except in './configure' case.
372 source_path="`echo $0 | sed -e 's#/configure##'`"
373 source_path_used="yes"
374 if test -z "$source_path" -o "$source_path" = "." ; then
376 source_path_used="no"
379 FFMPEG_CONFIGURATION=" "
381 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
384 CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
388 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
390 --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`
392 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
394 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
396 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
398 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
400 --make=*) make=`echo $opt | cut -d '=' -f 2`
402 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
404 --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
406 --extra-libs=*) extralibs=${opt#--extra-libs=}
408 --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
410 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
412 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
414 --powerpc-perf-enable) powerpc_perf="yes"
416 --disable-mmx) mmx="no"
418 --disable-altivec) altivec="no"
420 --enable-gprof) gprof="yes"
422 --disable-v4l) v4l="no"
424 --disable-audio-oss) audio_oss="no"
426 --disable-audio-beos) audio_beos="no"
428 --disable-dv1394) dv1394="no"
430 --disable-network) network="no"; ffserver="no"
432 --disable-zlib) zlib="no"
434 --enable-a52) a52="yes"
436 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
438 --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
440 --enable-pp) pp="yes"
442 --enable-shared-pp) shared_pp="yes"
444 --enable-mp3lame) mp3lame="yes"
446 --enable-libogg) libogg="yes"
448 --enable-vorbis) vorbis="yes"
450 --enable-theora) theora="yes"
452 --enable-faad) faad="yes"
454 --enable-faadbin) faadbin="yes"
456 --enable-faac) faac="yes"
458 --enable-xvid) xvid="yes"
460 --enable-x264) x264="yes"; extralibs="$extralibs -lx264"
462 --enable-dc1394) dc1394="yes"
464 --disable-vhook) vhook="no"
466 --disable-simple_idct) simpleidct="no"
468 --enable-mingw32) mingw32="yes"
470 --enable-shared) lshared="yes"
472 --disable-debug) debug="no"
474 --disable-opts) optimize="no"
476 --disable-mpegaudio-hp) mpegaudio_hp="no"
478 --disable-ffserver) ffserver="no"
480 --disable-ffplay) ffplay="no"
482 --enable-small) optimize="small"
484 --enable-amr_nb) amr_nb="yes"
486 --enable-amr_nb-fixed) amr_nb_fixed="yes"
488 --enable-amr_wb) amr_wb="yes"
490 --enable-amr_if2) amr_if2="yes"
492 --enable-sunmlib) sunmlib="yes"
494 --enable-pthreads) pthreads="yes"
496 --enable-gpl) gpl="yes"
498 --enable-memalign-hack) memalignhack="yes"
500 --disable-strip) dostrip="no"
502 --enable-codec=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-codec=}"
504 --disable-codec=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-codec=}##\"`"
506 --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
511 if test "$theora" = "yes" ; then
512 if test "$libogg" = "no"; then
513 echo "libogg must be enabled to enable Theora"
519 if test "$vorbis" = "yes" ; then
520 if test "$libogg" = "no"; then
521 echo "libogg must be enabled to enable Vorbis"
527 if test "$gpl" != "yes"; then
528 if test "$pp" != "no" -o "$shared_pp" != "no"; then
529 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
533 if test "$a52" != "no" -o "$a52bin" != "no"; then
534 echo "liba52 is under GPL and --enable-gpl is not specified"
538 if test "$xvid" != "no"; then
539 echo "libxvidcore is under GPL and --enable-gpl is not specified"
543 if test "$x264" != "no"; then
544 echo "x264 is under GPL and --enable-gpl is not specified"
548 if test "$dts" != "no"; then
549 echo "libdts is under GPL and --enable-gpl is not specified"
553 if test "$faad" != "no" -o "$faadbin" != "no"; then
556 int main( void ) { return 0; }
559 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
562 #ifndef FAAD2_VERSION
565 int main( void ) { return 0; }
567 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
568 echo "faad2 is under GPL and --enable-gpl is not specified"
574 echo "faad test failed"
579 if test "$fail" = "yes"; then
585 if test $mmx = "default"; then
586 if test $cpu = "x86" -o $cpu = "x86_64"; then
594 needmdynamicnopic="no"
595 if test $targetos = Darwin; then
596 if test -n "`$cc -v 2>&1 | grep xlc`"; then
597 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
599 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
600 case "$gcc_version" in
602 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
605 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
606 if test "$lshared" = no; then
607 needmdynamicnopic="yes"
611 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
612 if test "$lshared" = no; then
613 needmdynamicnopic="yes"
620 # Can only do AltiVec on PowerPC
621 if test $altivec = "default"; then
622 if test $cpu = "powerpc"; then
629 # Add processor-specific flags
632 if test $tune != "generic"; then
634 601|ppc601|PowerPC601)
635 CFLAGS="$CFLAGS -mcpu=601"
636 if test $altivec = "yes"; then
637 echo "WARNING: tuning for PPC601 but altivec enabled !";
641 603*|ppc603*|PowerPC603*)
642 CFLAGS="$CFLAGS -mcpu=603"
643 if test $altivec = "yes"; then
644 echo "WARNING: tuning for PPC603 but altivec enabled !";
648 604*|ppc604*|PowerPC604*)
649 CFLAGS="$CFLAGS -mcpu=604"
650 if test $altivec = "yes"; then
651 echo "WARNING: tuning for PPC604 but altivec enabled !";
655 G3|g3|75*|ppc75*|PowerPC75*)
656 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
657 if test $altivec = "yes"; then
658 echo "WARNING: tuning for PPC75x but altivec enabled !";
662 G4|g4|745*|ppc745*|PowerPC745*)
663 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
664 if test $altivec = "no"; then
665 echo "WARNING: tuning for PPC745x but altivec disabled !";
669 74*|ppc74*|PowerPC74*)
670 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
671 if test $altivec = "no"; then
672 echo "WARNING: tuning for PPC74xx but altivec disabled !";
676 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
677 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
678 if test $altivec = "no"; then
679 echo "WARNING: tuning for PPC970 but altivec disabled !";
685 echo "WARNING: unknown CPU "$tune", ignored"
690 # AltiVec flags: The FSF version of GCC differs from the Apple version
691 if test $cpu = "powerpc"; then
692 if test $altivec = "yes"; then
693 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
694 CFLAGS="$CFLAGS -faltivec"
696 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
701 # See if we have <altivec.h>
704 int main( void ) { return 0; }
708 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
712 # See does our compiler support Motorola AltiVec C API
713 if test $altivec = "yes"; then
714 if test $_altivec_h = "yes"; then
718 vector signed int v1, v2, v3;
726 vector signed int v1, v2, v3;
732 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
735 # Can only do mmi on mips
736 if test $mmi = "default"; then
737 if test $cpu = "mips"; then
744 # See does our compiler support mmi
745 if test $mmi = "yes"; then
748 __asm__ ("lq \$2, 0(\$2)");
752 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
755 if test "$mingw32" = "yes" ; then
767 prefix="/c/Program Files/FFmpeg"
771 cc="${cross_prefix}${cc}"
772 ar="${cross_prefix}${ar}"
773 ranlib="${cross_prefix}${ranlib}"
774 strip="${cross_prefix}${strip}"
776 if test -z "$cross_prefix" ; then
779 # big/little endian test
781 #include <inttypes.h>
782 int main(int argc, char ** argv){
783 volatile uint32_t i=0x01234567;
784 return (*((uint8_t*)(&i))) == 0x67;
788 if $cc -o $TMPE $TMPC 2>/dev/null ; then
789 $TMPE && bigendian="yes"
791 echo big/little test failed
796 # if cross compiling, cannot launch a program, so make a static guess
797 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
806 #include <inttypes.h>
807 int main(int argc, char ** argv){
812 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
817 #include <inttypes.h>
818 int main(int argc, char ** argv){
819 volatile uint_fast64_t i=0x01234567;
824 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
827 # check availability of some header files
831 int main( void ) { return 0; }
836 if $cc -o $TMPE $TMPC 2> /dev/null ; then
839 # check for memalign - atmos
845 string = memalign(64, sizeof(char));
849 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
852 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
853 echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
859 int main( void ) { localtime_r(NULL, NULL); }
863 if $cc -o $TMPE $TMPC 2> /dev/null ; then
867 if test "$zlib" = "yes"; then
868 # check for zlib - mmu_man
872 if (zlibVersion() != ZLIB_VERSION)
873 puts("zlib version differs !!!");
878 $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
879 # $TMPE 2> /dev/null > /dev/null || zlib="no"
880 # XXX: more tests needed - runtime test
882 if test "$zlib" = "yes"; then
883 extralibs="$extralibs -lz"
886 # test for lrintf in math.h
888 #define _ISOC9X_SOURCE 1
890 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
894 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
896 # allanc@chickenandporn.com: cannot execute cross-compiled
897 # code on the host. Only execute if not cross-compiling.
898 if test -z "$cross_prefix" ; then
899 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
904 for restrict_keyword in restrict __restrict__ __restrict; do
905 echo "void foo(char * $restrict_keyword p);" > $TMPC
906 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
907 _restrict=$restrict_keyword
912 # test gcc version to see if vector builtins can be used
913 # currently only used on i386 for MMX builtins
915 #include <xmmintrin.h>
917 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
920 #error no vector builtins
926 if $cc -o $TMPO $TMPC 2> /dev/null ; then
930 # dlopen/dlfcn.h probing
934 int main( void ) { return (int) dlopen("foo", 0); }
939 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
944 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
951 int main( void ) { return (int) dlopen("foo", 0); }
954 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
958 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
963 if test "$vhook" = "default" ; then
967 ##########################################
971 #include <X11/Xlib.h>
973 int main( void ) { return (int) imlib_load_font("foo"); }
977 if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
981 ##########################################
985 #include <ft2build.h>
986 int main( void ) { return (int) FT_Init_FreeType(0); }
990 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
991 if (freetype-config --version) >/dev/null 2>&1 ; then
992 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
998 ##########################################
1003 #undef main /* We don't want SDL to override our main() */
1004 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1009 if (sdl-config --version) >/dev/null 2>&1 ; then
1010 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
1011 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1012 if test "$_sdlversion" -lt 121 ; then
1020 ##########################################
1024 if (texi2html -version) >/dev/null 2>&1; then
1028 if test "$network" = "yes" ; then
1029 ##########################################
1033 #include <sys/types.h>
1034 #include <sys/socket.h>
1035 #include <netinet/in.h>
1038 struct sockaddr_storage saddr;
1039 struct ipv6_mreq mreq6;
1040 getaddrinfo(0,0,0,0);
1041 getnameinfo(0,0,0,0,0,0,0);
1042 IN6_IS_ADDR_MULTICAST(0);
1047 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1052 case "`$cc -v 2>&1 | grep version`" in
1054 CFLAGS="-Wall -Wno-switch $CFLAGS"
1060 if test "$sdl" = "no" ; then
1064 if test "$debug" = "yes"; then
1068 if test "$optimize" = "small"; then
1069 # CFLAGS=${CFLAGS//-O3/-Os}
1070 CFLAGS="$CFLAGS -Os"
1073 if test "$optimize" = "yes"; then
1074 if test -n "`$cc -v 2>&1 | grep xlc`"; then
1075 CFLAGS="$CFLAGS -O5"
1076 LDFLAGS="$LDFLAGS -O5"
1078 CFLAGS="-O3 $CFLAGS"
1082 if test x"$bindir" = x""; then
1083 bindir="${prefix}/bin"
1086 if test x"$libdir" = x""; then
1087 libdir="${prefix}/lib"
1090 if test x"$mandir" = x""; then
1091 mandir="${prefix}/man"
1094 echo "Install prefix $prefix"
1095 echo "Source path $source_path"
1096 echo "C compiler $cc"
1098 echo "CPU $cpu ($tune)"
1099 if test "$BUILDSUF" != ""; then
1100 echo "Build suffix $BUILDSUF"
1102 echo "Big Endian $bigendian"
1103 echo "inttypes.h $inttypes"
1104 echo "broken inttypes.h $emu_fast_int"
1105 if test $cpu = "x86" -o $cpu = "x86_64"; then
1106 echo "MMX enabled $mmx"
1107 echo "Vector Builtins $builtin_vector"
1109 if test $cpu = "mips"; then
1110 echo "MMI enabled $mmi"
1112 if test $cpu = "powerpc"; then
1113 echo "AltiVec enabled $altivec"
1115 echo "gprof enabled $gprof"
1116 echo "zlib enabled $zlib"
1117 echo "mp3lame enabled $mp3lame"
1118 echo "libogg enabled $libogg"
1119 echo "vorbis enabled $vorbis"
1120 echo "theora enabled $theora"
1121 echo "faad enabled $faad"
1122 echo "faadbin enabled $faadbin"
1123 echo "faac enabled $faac"
1124 echo "xvid enabled $xvid"
1125 echo "x264 enabled $x264"
1126 echo "a52 support $a52"
1127 echo "a52 dlopened $a52bin"
1128 echo "dts support $dts"
1129 echo "pp support $pp"
1130 echo "debug symbols $debug"
1131 echo "strip symbols $dostrip"
1132 echo "optimize $optimize"
1133 echo "shared pp $shared_pp"
1134 echo "Video hooking $vhook"
1135 echo "SDL support $sdl"
1136 if test $sdl_too_old = "yes"; then
1137 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1140 if test "$vhook" = "yes" ; then
1141 echo "Imlib2 support $imlib2"
1142 echo "freetype support $freetype2"
1144 echo "Sun medialib support" $sunmlib
1145 echo "pthreads support" $pthreads
1146 echo "AMR-NB float support" $amr_nb
1147 echo "AMR-NB fixed support" $amr_nb_fixed
1148 echo "AMR-WB float support" $amr_wb
1149 echo "AMR-WB IF2 support" $amr_if2
1150 echo "network support $network"
1151 if test "$network" = "yes" ; then
1152 echo "IPv6 support $ipv6"
1154 if test "$gpl" = "no" ; then
1155 echo "License: LGPL"
1160 echo "Creating config.mak and config.h"
1163 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1164 echo "# Automatically generated by configure - do not modify" > config.mak
1165 echo "/* Automatically generated by configure - do not modify */" > $TMPH
1166 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1168 echo "prefix=$prefix" >> config.mak
1169 echo "libdir=$libdir" >> config.mak
1170 echo "bindir=$bindir" >> config.mak
1171 echo "mandir=$mandir" >> config.mak
1172 echo "MAKE=$make" >> config.mak
1173 echo "CC=$cc" >> config.mak
1174 echo "AR=$ar" >> config.mak
1175 echo "RANLIB=$ranlib" >> config.mak
1176 if test "$dostrip" = "yes" ; then
1177 echo "STRIP=$strip" >> config.mak
1178 echo "INSTALLSTRIP=-s" >> config.mak
1180 echo "STRIP=echo ignoring strip" >> config.mak
1181 echo "INSTALLSTRIP=" >> config.mak
1184 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1185 # shared modules on OS/X (vhook/Makefile).
1187 if test "$needmdynamicnopic" = yes; then
1188 CFLAGS="$CFLAGS -mdynamic-no-pic"
1191 echo "OPTFLAGS=$CFLAGS" >> config.mak
1192 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1193 echo "LDFLAGS=$LDFLAGS" >> config.mak
1194 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1195 echo "SHFLAGS=$SHFLAGS" >> config.mak
1196 echo "BUILDSUF=$BUILDSUF" >> config.mak
1197 echo "LIBPREF=$LIBPREF" >> config.mak
1198 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1199 echo "SLIBPREF=$SLIBPREF" >> config.mak
1200 echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1201 echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1202 echo "TARGET_OS=$TARGET_OS" >> config.mak
1203 if test "$cpu" = "x86" ; then
1204 echo "TARGET_ARCH_X86=yes" >> config.mak
1205 echo "#define ARCH_X86 1" >> $TMPH
1206 elif test "$cpu" = "x86_64" ; then
1207 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1208 echo "#define ARCH_X86_64 1" >> $TMPH
1209 elif test "$cpu" = "armv4l" ; then
1210 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1211 echo "#define ARCH_ARMV4L 1" >> $TMPH
1212 elif test "$cpu" = "alpha" ; then
1213 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1214 echo "#define ARCH_ALPHA 1" >> $TMPH
1215 elif test "$cpu" = "sparc64" ; then
1216 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1217 echo "#define ARCH_SPARC64 1" >> $TMPH
1218 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1219 echo "#define ARCH_SPARC 1" >> $TMPH
1220 elif test "$cpu" = "sparc" ; then
1221 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1222 echo "#define ARCH_SPARC 1" >> $TMPH
1223 elif test "$cpu" = "powerpc" ; then
1224 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1225 echo "#define ARCH_POWERPC 1" >> $TMPH
1226 if test $POWERPCMODE = "32bits"; then
1227 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1229 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1231 if test "$powerpc_perf" = "yes"; then
1232 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1234 elif test "$cpu" = "mips" ; then
1235 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1236 echo "#define ARCH_MIPS 1" >> $TMPH
1237 elif test "$cpu" = "sh4" ; then
1238 echo "TARGET_ARCH_SH4=yes" >> config.mak
1239 echo "#define ARCH_SH4 1" >> $TMPH
1241 echo "#define TUNECPU $TUNECPU" >> $TMPH
1242 if test "$bigendian" = "yes" ; then
1243 echo "WORDS_BIGENDIAN=yes" >> config.mak
1244 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1246 if test "$inttypes" != "yes" ; then
1247 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1249 if test "$emu_fast_int" = "yes" ; then
1250 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1252 if test "$mmx" = "yes" ; then
1253 echo "TARGET_MMX=yes" >> config.mak
1254 echo "#define HAVE_MMX 1" >> $TMPH
1255 echo "#define __CPU__ 586" >> $TMPH
1257 if test "$builtin_vector" = "yes" ; then
1258 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1259 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1261 if test "$mmi" = "yes" ; then
1262 echo "TARGET_MMI=yes" >> config.mak
1263 echo "#define HAVE_MMI 1" >> $TMPH
1265 if test "$altivec" = "yes" ; then
1266 echo "TARGET_ALTIVEC=yes" >> config.mak
1267 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1268 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1269 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1270 if test "$_altivec_h" = "yes" ; then
1271 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1273 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1276 if test "$gprof" = "yes" ; then
1277 echo "TARGET_GPROF=yes" >> config.mak
1278 echo "#define HAVE_GPROF 1" >> $TMPH
1280 if test "$localtime_r" = "yes" ; then
1281 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1283 if test "$imlib2" = "yes" ; then
1284 echo "HAVE_IMLIB2=yes" >> config.mak
1286 if test "$freetype2" = "yes" ; then
1287 echo "HAVE_FREETYPE2=yes" >> config.mak
1289 if test "$sunmlib" = "yes" ; then
1290 echo "HAVE_MLIB=yes" >> config.mak
1291 echo "#define HAVE_MLIB 1" >> $TMPH
1292 extralibs="$extralibs -lmlib"
1294 if test "$pthreads" = "yes" ; then
1295 echo "HAVE_PTHREADS=yes" >> config.mak
1296 echo "#define HAVE_PTHREADS 1" >> $TMPH
1297 echo "#define HAVE_THREADS 1" >> $TMPH
1298 if test $targetos != FreeBSD; then
1299 extralibs="$extralibs -lpthread"
1302 if test "$sdl" = "yes" ; then
1303 echo "CONFIG_SDL=yes" >> config.mak
1304 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1305 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1307 if test "$texi2html" = "yes"; then
1308 echo "BUILD_DOC=yes" >> config.mak
1310 if test "$have_lrintf" = "yes" ; then
1311 echo "#define HAVE_LRINTF 1" >> $TMPH
1313 if test "$vhook" = "yes" ; then
1314 echo "BUILD_VHOOK=yes" >> config.mak
1315 echo "#define HAVE_VHOOK 1" >> $TMPH
1316 extralibs="$extralibs $ldl"
1318 if test "$lshared" = "yes" ; then
1319 echo "BUILD_SHARED=yes" >> config.mak
1320 echo "PIC=-fPIC -DPIC" >> config.mak
1322 echo "EXTRALIBS=$extralibs" >> config.mak
1323 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1325 echo "VERSION=$version" >>config.mak
1326 # if you do not want to use encoders, disable that.
1327 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1328 echo "CONFIG_ENCODERS=yes" >> config.mak
1330 # if you do not want to use decoders, disable that.
1331 echo "#define CONFIG_DECODERS 1" >> $TMPH
1332 echo "CONFIG_DECODERS=yes" >> config.mak
1335 if test "$a52" = "yes" ; then
1336 echo "#define CONFIG_AC3 1" >> $TMPH
1337 echo "CONFIG_AC3=yes" >> config.mak
1339 if test "$a52bin" = "yes" ; then
1340 echo "#define CONFIG_A52BIN 1" >> $TMPH
1341 echo "CONFIG_A52BIN=yes" >> config.mak
1346 if test "$dts" = "yes" ; then
1347 echo "#define CONFIG_DTS 1" >> $TMPH
1348 echo "CONFIG_DTS=yes" >> config.mak
1352 if test "$pp" = "yes" ; then
1353 echo "#define CONFIG_PP 1" >> $TMPH
1354 echo "CONFIG_PP=yes" >> config.mak
1356 if test "$shared_pp" = "yes" ; then
1357 echo "#define SHARED_PP 1" >> $TMPH
1358 echo "SHARED_PP=yes" >> config.mak
1362 # mpeg audio high precision mode
1363 if test "$mpegaudio_hp" = "yes" ; then
1364 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1367 if test "$v4l" = "yes" ; then
1368 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1369 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1372 if test "$dv1394" = "yes" ; then
1373 echo "#define CONFIG_DV1394 1" >> $TMPH
1374 echo "CONFIG_DV1394=yes" >> config.mak
1377 if test "$dc1394" = "yes" ; then
1378 echo "#define CONFIG_DC1394 1" >> $TMPH
1379 echo "CONFIG_DC1394=yes" >> config.mak
1382 if test "$dlopen" = "yes" ; then
1383 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1386 if test "$dlfcn" = "yes" ; then
1387 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1390 if test "$audio_oss" = "yes" ; then
1391 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1392 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1395 if test "$audio_beos" = "yes" ; then
1396 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1397 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1400 if test "$network" = "yes" ; then
1401 echo "#define CONFIG_NETWORK 1" >> $TMPH
1402 echo "CONFIG_NETWORK=yes" >> config.mak
1405 if test "$ipv6" = "yes" ; then
1406 echo "#define CONFIG_IPV6 1" >> $TMPH
1409 if test "$zlib" = "yes" ; then
1410 echo "#define CONFIG_ZLIB 1" >> $TMPH
1411 echo "CONFIG_ZLIB=yes" >> config.mak
1414 if test "$mp3lame" = "yes" ; then
1415 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1416 echo "CONFIG_MP3LAME=yes" >> config.mak
1419 if test "$libogg" = "yes" ; then
1420 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1421 echo "CONFIG_LIBOGG=yes" >> config.mak
1424 if test "$vorbis" = "yes" ; then
1425 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1426 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1429 if test "$theora" = "yes" ; then
1430 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1431 echo "CONFIG_LIBTHEORA=yes" >> config.mak
1434 if test "$faad" = "yes" ; then
1435 echo "#define CONFIG_FAAD 1" >> $TMPH
1436 echo "CONFIG_FAAD=yes" >> config.mak
1439 if test "$faadbin" = "yes" ; then
1440 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1441 echo "CONFIG_FAADBIN=yes" >> config.mak
1444 if test "$faac" = "yes" ; then
1445 echo "#define CONFIG_FAAC 1" >> $TMPH
1446 echo "CONFIG_FAAC=yes" >> config.mak
1449 if test "$xvid" = "yes" ; then
1450 echo "#define CONFIG_XVID 1" >> $TMPH
1451 echo "CONFIG_XVID=yes" >> config.mak
1454 if test "$x264" = "yes" ; then
1455 echo "#define CONFIG_X264 1" >> $TMPH
1456 echo "CONFIG_X264=yes" >> config.mak
1459 if test "$mingw32" = "yes" ; then
1460 echo "#define CONFIG_WIN32 1" >> $TMPH
1461 echo "CONFIG_WIN32=yes" >> config.mak
1462 echo "HAVE_W32THREADS=yes" >> config.mak
1463 echo "#define HAVE_W32THREADS 1" >> $TMPH
1464 echo "#define HAVE_THREADS 1" >> $TMPH
1465 echo "#ifndef __MINGW32__" >> $TMPH
1466 echo "#define __MINGW32__ 1" >> $TMPH
1467 echo "#endif" >> $TMPH
1470 if test "$os2" = "yes" ; then
1471 echo "#define CONFIG_OS2 1" >> $TMPH
1472 echo "CONFIG_OS2=yes" >> config.mak
1475 if test "$TARGET_OS" = "SunOS" ; then
1476 echo "#define CONFIG_SUNOS 1" >> $TMPH
1479 if test "$TARGET_OS" = "BeOS" ; then
1480 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1481 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1482 echo "#define HAVE_THREADS 1" >> $TMPH
1485 if test "$darwin" = "yes"; then
1486 echo "#define CONFIG_DARWIN 1" >> $TMPH
1487 echo "CONFIG_DARWIN=yes" >> config.mak
1490 if test "$_malloc_h" = "yes" ; then
1491 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1493 echo "#undef HAVE_MALLOC_H" >> $TMPH
1496 if test "$_memalign" = "yes" ; then
1497 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1499 echo "#undef HAVE_MEMALIGN" >> $TMPH
1502 if test "$memalignhack" = "yes" ; then
1503 echo "#define MEMALIGN_HACK 1" >> $TMPH
1507 if test "$netserver" = "yes" ; then
1508 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1509 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1512 if test "$need_inet_aton" = "yes" ; then
1513 echo "NEED_INET_ATON=yes" >> config.mak
1516 if test "$simpleidct" = "yes" ; then
1517 echo "#define SIMPLE_IDCT 1" >> $TMPH
1520 if test "$ffserver" = "yes" ; then
1521 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1522 echo "CONFIG_FFSERVER=yes" >> config.mak
1525 if test "$ffplay" = "yes" ; then
1526 echo "CONFIG_FFPLAY=yes" >> config.mak
1529 if test "$gpl" = "yes" ; then
1530 echo "#define CONFIG_GPL 1" >> $TMPH
1531 echo "CONFIG_GPL=yes" >> config.mak
1534 echo "#define restrict $_restrict" >> $TMPH
1536 if test "$optimize" = "small"; then
1537 echo "#define always_inline" >> $TMPH
1540 # build tree in object directory if source path is different from current one
1541 if test "$source_path_used" = "yes" ; then
1542 DIRS="doc libavformat libavcodec libavcodec/alpha libavcodec/armv4l \
1543 libavcodec/i386 libavcodec/sparc libavcodec/mlib \
1544 libavcodec/ppc libavcodec/liba52 libavcodec/libpostproc tests vhook"
1545 FILES="Makefile libavformat/Makefile libavcodec/Makefile \
1546 libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
1547 doc/Makefile doc/texi2pod.pl"
1548 for dir in $DIRS ; do
1551 for f in $FILES ; do
1552 ln -sf "$source_path/$f" $f
1554 echo "SRC_PATH=$source_path" >> config.mak
1556 echo "SRC_PATH='$source_path'" >> config.mak
1559 if test "$amr_wb" = "yes" ; then
1560 echo "#define AMR_WB 1" >> $TMPH
1561 echo "AMR_WB=yes" >> config.mak
1563 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1565 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1566 echo "and extracted the source to libavcodec/amrwb_float"
1570 if test "$amr_nb" = "yes" ; then
1571 echo "#define AMR_NB 1" >> $TMPH
1572 echo "AMR_NB=yes" >> config.mak
1574 if test "$amr_nb_fixed" = "yes" ; then
1575 echo "AMR_NB_FIXED=yes" >> config.mak
1576 echo "#define AMR_NB_FIXED 1" >> $TMPH
1577 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1578 echo "REL-5 version 5.1.0 from "
1579 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1580 echo "and extracted src to libavcodec/amr"
1581 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1582 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1585 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1586 echo "REL-5 V5.1.0 from "
1587 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1588 echo "and extracted the source to libavcodec/amr_float"
1589 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1593 if test "$amr_if2" = "yes" ; then
1594 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1599 for codec in $CODEC_LIST ; do
1600 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1601 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1604 diff $TMPH config.h >/dev/null 2>&1
1605 if test $? -ne 0 ; then
1606 mv -f $TMPH config.h
1608 echo "config.h is unchanged"
1611 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH