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-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
37 echo "Advanced options (experts only):"
38 echo " --source-path=PATH path of source code [$source_path]"
39 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
40 echo " --cc=CC use C compiler CC [$cc]"
41 echo " --make=MAKE use specified make [$make]"
42 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
43 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
44 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
45 echo " --cpu=CPU force cpu to CPU [$cpu]"
46 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
47 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
48 echo " --disable-mmx disable mmx usage"
49 echo " --disable-altivec disable AltiVec usage"
50 echo " --disable-audio-oss disable OSS audio support [default=no]"
51 echo " --disable-audio-beos disable BeOS audio support [default=no]"
52 echo " --disable-v4l disable video4linux grabbing [default=no]"
53 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
54 echo " --disable-network disable network support [default=no]"
55 echo " --disable-zlib disable zlib [default=no]"
56 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
57 echo " --disable-vhook disable video hooking support"
58 echo " --enable-gprof enable profiling with gprof [$gprof]"
59 echo " --disable-debug disable debugging symbols"
60 echo " --disable-opts disable compiler optimizations"
61 echo " --disable-mpegaudio-hp faster (but less accurate)"
62 echo " mpegaudio decoding [default=no]"
63 echo " --disable-ffserver disable ffserver build"
64 echo " --disable-ffplay disable ffplay build"
65 echo " --disable-risky disables patent encumbered codecs"
66 echo " --enable-small optimize for size instead of speed"
67 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
69 echo "NOTE: The object files are build at the place where configure is launched"
73 # set temporary file name
74 if test ! -z "$TMPDIR" ; then
76 elif test ! -z "$TEMPDIR" ; then
82 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
83 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
84 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
85 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
86 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
105 i386|i486|i586|i686|i86pc|BePC)
108 # armv4l is a subset of armv5tel
115 "Power Macintosh"|ppc)
172 LDFLAGS=-Wl,--warn-common
192 prefix="/boot/home/config"
193 # helps building libavcodec
194 CFLAGS="-DPIC -fomit-frame-pointer"
195 # 3 gcc releases known for BeOS, each with ugly bugs
196 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
197 case "$gcc_version" in
198 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
201 *20010315*) echo "BeBits gcc"
202 CFLAGS="$CFLAGS -fno-expensive-optimizations"
206 # disable linux things
212 # no need for libm, but the inet stuff
214 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
215 extralibs="-lbind -lsocket"
229 extralibs="$extralibs -lsocket -lnsl"
237 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
243 extralibs="-lpoll -lgnugetopt -lm"
252 SHFLAGS="-dynamiclib"
257 FFSLDFLAGS=-Wl,-bind_at_load
260 # Note: the rest of the mingw32 config is done afterwards as mingw32
261 # can be forced on command line for linux cross compilation
270 test -f /usr/include/inttypes.h || \
271 test -f /usr/local/include/inttypes.h || \
272 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
273 "/usr/include/inttypes.h !!!"
276 LDFLAGS="$LDFLAGS -rdynamic"
279 ranlib="echo ignoring ranlib"
287 ranlib="echo ignoring ranlib"
288 strip="echo ignoring strip"
290 LDFLAGS="-Zomf -Zstack 16384 -s"
309 # From mplayer configure. We need TARGET_OS available
310 # to the Makefile, so it can distinguish between flavors
311 # of AltiVec on PowerPC
312 TARGET_OS=`( uname -s ) 2>&1`
314 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
322 [cC][yY][gG][wW][iI][nN]*)
326 TARGET_OS="$TARGET_OS-UNKNOWN"
331 # XXX: we assume an absolute path is given when launching configure,
332 # except in './configure' case.
333 source_path="`echo $0 | sed -e 's#/configure##'`"
334 source_path_used="yes"
335 if test -z "$source_path" -o "$source_path" = "." ; then
337 source_path_used="no"
342 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
344 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
346 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
348 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
350 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
352 --make=*) make=`echo $opt | cut -d '=' -f 2`
354 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
356 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
358 --extra-libs=*) extralibs=${opt#--extra-libs=}
360 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
362 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
364 --powerpc-perf-enable) powerpc_perf="yes"
366 --disable-mmx) mmx="no"
368 --disable-altivec) altivec="no"
370 --enable-gprof) gprof="yes"
372 --disable-v4l) v4l="no"
374 --disable-audio-oss) audio_oss="no"
376 --disable-audio-beos) audio_beos="no"
378 --disable-dv1394) dv1394="no"
380 --disable-network) network="no"; ffserver="no"
382 --disable-zlib) zlib="no"
384 --enable-a52) a52="yes"
386 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
388 --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
390 --enable-pp) pp="yes"
392 --enable-shared-pp) shared_pp="yes"
394 --enable-mp3lame) mp3lame="yes"
396 --enable-vorbis) vorbis="yes"
398 --enable-faad) faad="yes"
400 --enable-faadbin) faadbin="yes"
402 --enable-faac) faac="yes"
404 --enable-xvid) xvid="yes"
406 --disable-vhook) vhook="no"
408 --disable-simple_idct) simpleidct="no"
410 --enable-mingw32) mingw32="yes"
412 --enable-shared) lshared="yes"
414 --disable-debug) debug="no"
416 --disable-opts) optimize="no"
418 --disable-mpegaudio-hp) mpegaudio_hp="no"
420 --disable-ffserver) ffserver="no"
422 --disable-ffplay) ffplay="no"
424 --disable-risky) risky="no"
426 --enable-small) optimize="small"
428 --enable-amr_nb) amr_nb="yes"
430 --enable-amr_nb-fixed) amr_nb_fixed="yes"
432 --enable-amr_wb) amr_wb="yes"
434 --enable-sunmlib) sunmlib="yes"
436 --enable-pthreads) pthreads="yes"
438 --enable-gpl) gpl="yes"
440 --enable-memalign-hack) memalignhack="yes"
445 if test "$gpl" != "yes"; then
446 if test "$pp" != "no" -o "$shared_pp" != "no"; then
447 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
451 if test "$a52" != "no" -o "$a52bin" != "no"; then
452 echo "liba52 is under GPL and --enable-gpl is not specified"
456 if test "$xvid" != "no"; then
457 echo "libxvidcore is under GPL and --enable-gpl is not specified"
461 if test "$dts" != "no"; then
462 echo "libdts is under GPL and --enable-gpl is not specified"
466 if test "$faad" != "no" -o "$faadbin" != "no"; then
469 int main( void ) { return 0; }
472 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
475 #ifndef FAAD2_VERSION
478 int main( void ) { return 0; }
480 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
481 echo "faad2 is under GPL and --enable-gpl is not specified"
487 echo "faad test failed"
492 if test "$fail" = "yes"; then
498 if test $mmx = "default"; then
499 if test $cpu = "x86"; then
507 needmdynamicnopic="no"
508 if test $targetos = Darwin; then
509 if test -n "`$cc -v 2>&1 | grep xlc`"; then
510 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
512 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
513 case "$gcc_version" in
515 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
518 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
519 if test "$lshared" = no; then
520 needmdynamicnopic="yes"
524 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
525 if test "$lshared" = no; then
526 needmdynamicnopic="yes"
533 # Can only do AltiVec on PowerPC
534 if test $altivec = "default"; then
535 if test $cpu = "powerpc"; then
542 # Add processor-specific flags
545 if test $tune != "generic"; then
547 601|ppc601|PowerPC601)
548 CFLAGS="$CFLAGS -mcpu=601"
549 if test $altivec = "yes"; then
550 echo "WARNING: tuning for PPC601 but altivec enabled !";
554 603*|ppc603*|PowerPC603*)
555 CFLAGS="$CFLAGS -mcpu=603"
556 if test $altivec = "yes"; then
557 echo "WARNING: tuning for PPC603 but altivec enabled !";
561 604*|ppc604*|PowerPC604*)
562 CFLAGS="$CFLAGS -mcpu=604"
563 if test $altivec = "yes"; then
564 echo "WARNING: tuning for PPC604 but altivec enabled !";
568 G3|g3|75*|ppc75*|PowerPC75*)
569 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
570 if test $altivec = "yes"; then
571 echo "WARNING: tuning for PPC75x but altivec enabled !";
575 G4|g4|745*|ppc745*|PowerPC745*)
576 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
577 if test $altivec = "no"; then
578 echo "WARNING: tuning for PPC745x but altivec disabled !";
582 74*|ppc74*|PowerPC74*)
583 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
584 if test $altivec = "no"; then
585 echo "WARNING: tuning for PPC74xx but altivec disabled !";
589 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
590 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
591 if test $altivec = "no"; then
592 echo "WARNING: tuning for PPC970 but altivec disabled !";
598 echo "WARNING: unknown CPU "$tune", ignored"
603 # AltiVec flags: The FSF version of GCC differs from the Apple version
604 if test $cpu = "powerpc"; then
605 if test $altivec = "yes"; then
606 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
607 CFLAGS="$CFLAGS -faltivec"
609 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
614 # See if we have <altivec.h>
617 int main( void ) { return 0; }
621 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
625 # See does our compiler support Motorola AltiVec C API
626 if test $altivec = "yes"; then
627 if test $_altivec_h = "yes"; then
631 vector signed int v1, v2, v3;
639 vector signed int v1, v2, v3;
645 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
648 # Can only do mmi on mips
649 if test $mmi = "default"; then
650 if test $cpu = "mips"; then
657 # See does our compiler support mmi
658 if test $mmi = "yes"; then
661 __asm__ ("lq \$2, 0(\$2)");
665 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
668 if test "$mingw32" = "yes" ; then
679 prefix="/c/Program Files/FFmpeg"
683 cc="${cross_prefix}${cc}"
684 ar="${cross_prefix}${ar}"
685 ranlib="${cross_prefix}${ranlib}"
686 strip="${cross_prefix}${strip}"
688 if test -z "$cross_prefix" ; then
691 # big/little endian test
693 #include <inttypes.h>
694 int main(int argc, char ** argv){
695 volatile uint32_t i=0x01234567;
696 return (*((uint8_t*)(&i))) == 0x67;
700 if $cc -o $TMPE $TMPC 2>/dev/null ; then
701 $TMPE && bigendian="yes"
703 echo big/little test failed
708 # if cross compiling, cannot launch a program, so make a static guess
709 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
718 #include <inttypes.h>
719 int main(int argc, char ** argv){
724 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
729 #include <inttypes.h>
730 int main(int argc, char ** argv){
731 volatile uint_fast64_t i=0x01234567;
736 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
739 # check availability of some header files
743 int main( void ) { return 0; }
748 if $cc -o $TMPE $TMPC 2> /dev/null ; then
751 # check for memalign - atmos
756 string = memalign(64, sizeof(char));
760 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
765 int main( void ) { localtime_r(NULL, NULL); }
769 if $cc -o $TMPE $TMPC 2> /dev/null ; then
773 if test "$zlib" = "yes"; then
774 # check for zlib - mmu_man
778 if (zlibVersion() != ZLIB_VERSION)
779 puts("zlib version differs !!!");
784 $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
785 # $TMPE 2> /dev/null > /dev/null || zlib="no"
786 # XXX: more tests needed - runtime test
788 if test "$zlib" = "yes"; then
789 extralibs="$extralibs -lz"
792 # test for lrintf in math.h
794 #define _ISOC9X_SOURCE 1
796 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
800 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
802 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
806 for restrict_keyword in restrict __restrict__ __restrict; do
807 echo "void foo(char * $restrict_keyword p);" > $TMPC
808 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
809 _restrict=$restrict_keyword
814 # test gcc version to see if vector builtins can be used
815 # currently only used on i386 for MMX builtins
818 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
821 #error no vector builtins
827 if $cc -o $TMPO $TMPC 2> /dev/null ; then
831 # dlopen/dlfcn.h probing
835 int main( void ) { return (int) dlopen("foo", 0); }
840 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
845 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
852 int main( void ) { return (int) dlopen("foo", 0); }
855 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
859 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
864 if test "$vhook" = "default" ; then
868 ##########################################
872 #include <X11/Xlib.h>
874 int main( void ) { return (int) imlib_load_font("foo"); }
878 if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
882 ##########################################
886 #include <ft2build.h>
887 int main( void ) { return (int) FT_Init_FreeType(0); }
891 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
892 if (freetype-config --version) >/dev/null 2>&1 ; then
893 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
899 ##########################################
904 #undef main /* We don't want SDL to override our main() */
905 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
910 if (sdl-config --version) >/dev/null 2>&1 ; then
911 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
912 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
913 if test "$_sdlversion" -lt 121 ; then
921 ##########################################
925 if (texi2html -version) >/dev/null 2>&1; then
929 case "`$cc -v 2>&1 | grep version`" in
931 CFLAGS="-Wall $CFLAGS"
937 if test "$sdl" = "no" ; then
941 if test "$debug" = "yes"; then
945 if test "$optimize" = "small"; then
946 # CFLAGS=${CFLAGS//-O3/-Os}
950 if test "$optimize" = "yes"; then
951 if test -n "`$cc -v 2>&1 | grep xlc`"; then
953 LDFLAGS="$LDFLAGS -O5"
959 if test x"$bindir" = x""; then
960 bindir="${prefix}/bin"
963 if test x"$mandir" = x""; then
964 mandir="${prefix}/man"
967 echo "Install prefix $prefix"
968 echo "Source path $source_path"
969 echo "C compiler $cc"
971 echo "CPU $cpu ($tune)"
972 echo "Big Endian $bigendian"
973 echo "inttypes.h $inttypes"
974 echo "broken inttypes.h $emu_fast_int"
975 if test $cpu = "x86"; then
976 echo "MMX enabled $mmx"
977 echo "Vector Builtins $builtin_vector"
979 if test $cpu = "mips"; then
980 echo "MMI enabled $mmi"
982 if test $cpu = "powerpc"; then
983 echo "AltiVec enabled $altivec"
985 echo "gprof enabled $gprof"
986 echo "zlib enabled $zlib"
987 echo "mp3lame enabled $mp3lame"
988 echo "vorbis enabled $vorbis"
989 echo "faad enabled $faad"
990 echo "faadbin enabled $faadbin"
991 echo "faac enabled $faac"
992 echo "xvid enabled $xvid"
993 echo "a52 support $a52"
994 echo "a52 dlopened $a52bin"
995 echo "dts support $dts"
996 echo "pp support $pp"
997 echo "debug symbols $debug"
998 echo "optimize $optimize"
999 echo "shared pp $shared_pp"
1000 echo "Video hooking $vhook"
1001 echo "SDL support $sdl"
1002 if test $sdl_too_old = "yes"; then
1003 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1005 echo "risky / patent encumbered codecs $risky"
1007 if test "$vhook" = "yes" ; then
1008 echo "Imlib2 support $imlib2"
1009 echo "freetype support $freetype2"
1011 echo "Sun medialib support" $sunmlib
1012 echo "pthreads support" $pthreads
1013 echo "AMR-NB float support" $amr_nb
1014 echo "AMR-NB fixed support" $amr_nb_fixed
1015 echo "AMR-WB float support" $amr_wb
1016 if test "$gpl" = "no" ; then
1017 echo "License: LGPL"
1022 echo "Creating config.mak and config.h"
1024 echo "# Automatically generated by configure - do not modify" > config.mak
1025 echo "/* Automatically generated by configure - do not modify */" > $TMPH
1027 echo "prefix=$prefix" >> config.mak
1028 echo "bindir=$bindir" >> config.mak
1029 echo "mandir=$mandir" >> config.mak
1030 echo "MAKE=$make" >> config.mak
1031 echo "CC=$cc" >> config.mak
1032 echo "AR=$ar" >> config.mak
1033 echo "RANLIB=$ranlib" >> config.mak
1034 echo "STRIP=$strip" >> config.mak
1036 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1037 # shared modules on OS/X (vhook/Makefile).
1039 if test "$needmdynamicnopic" = yes; then
1040 CFLAGS="$CFLAGS -mdynamic-no-pic"
1043 echo "OPTFLAGS=$CFLAGS" >> config.mak
1044 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1045 echo "LDFLAGS=$LDFLAGS" >> config.mak
1046 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1047 echo "SHFLAGS=$SHFLAGS" >> config.mak
1048 echo "LIBPREF=$LIBPREF" >> config.mak
1049 echo "LIBSUF=$LIBSUF" >> config.mak
1050 echo "SLIBPREF=$SLIBPREF" >> config.mak
1051 echo "SLIBSUF=$SLIBSUF" >> config.mak
1052 echo "EXESUF=$EXESUF" >> config.mak
1053 echo "TARGET_OS=$TARGET_OS" >> config.mak
1054 if test "$cpu" = "x86" ; then
1055 echo "TARGET_ARCH_X86=yes" >> config.mak
1056 echo "#define ARCH_X86 1" >> $TMPH
1057 elif test "$cpu" = "armv4l" ; then
1058 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1059 echo "#define ARCH_ARMV4L 1" >> $TMPH
1060 elif test "$cpu" = "alpha" ; then
1061 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1062 echo "#define ARCH_ALPHA 1" >> $TMPH
1063 elif test "$cpu" = "sparc64" ; then
1064 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1065 echo "#define ARCH_SPARC64 1" >> $TMPH
1066 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1067 echo "#define ARCH_SPARC 1" >> $TMPH
1068 elif test "$cpu" = "sparc" ; then
1069 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1070 echo "#define ARCH_SPARC 1" >> $TMPH
1071 elif test "$cpu" = "powerpc" ; then
1072 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1073 echo "#define ARCH_POWERPC 1" >> $TMPH
1074 if test $POWERPCMODE = "32bits"; then
1075 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1077 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1079 if test "$powerpc_perf" = "yes"; then
1080 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1082 elif test "$cpu" = "mips" ; then
1083 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1084 echo "#define ARCH_MIPS 1" >> $TMPH
1085 elif test "$cpu" = "sh4" ; then
1086 echo "TARGET_ARCH_SH4=yes" >> config.mak
1087 echo "#define ARCH_SH4 1" >> $TMPH
1089 echo "#define TUNECPU $TUNECPU" >> $TMPH
1090 if test "$bigendian" = "yes" ; then
1091 echo "WORDS_BIGENDIAN=yes" >> config.mak
1092 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1094 if test "$inttypes" != "yes" ; then
1095 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1097 if test "$emu_fast_int" = "yes" ; then
1098 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1100 if test "$mmx" = "yes" ; then
1101 echo "TARGET_MMX=yes" >> config.mak
1102 echo "#define HAVE_MMX 1" >> $TMPH
1103 echo "#define __CPU__ 586" >> $TMPH
1105 if test "$builtin_vector" = "yes" ; then
1106 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1107 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1109 if test "$mmi" = "yes" ; then
1110 echo "TARGET_MMI=yes" >> config.mak
1111 echo "#define HAVE_MMI 1" >> $TMPH
1113 if test "$altivec" = "yes" ; then
1114 echo "TARGET_ALTIVEC=yes" >> config.mak
1115 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1116 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1117 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1118 if test "$_altivec_h" = "yes" ; then
1119 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1121 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1124 if test "$gprof" = "yes" ; then
1125 echo "TARGET_GPROF=yes" >> config.mak
1126 echo "#define HAVE_GPROF 1" >> $TMPH
1128 if test "$localtime_r" = "yes" ; then
1129 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1131 if test "$imlib2" = "yes" ; then
1132 echo "HAVE_IMLIB2=yes" >> config.mak
1134 if test "$freetype2" = "yes" ; then
1135 echo "HAVE_FREETYPE2=yes" >> config.mak
1137 if test "$sunmlib" = "yes" ; then
1138 echo "HAVE_MLIB=yes" >> config.mak
1139 echo "#define HAVE_MLIB 1" >> $TMPH
1140 extralibs="$extralibs -lmlib"
1142 if test "$pthreads" = "yes" ; then
1143 echo "HAVE_PTHREADS=yes" >> config.mak
1144 echo "#define HAVE_PTHREADS 1" >> $TMPH
1145 if test $targetos != FreeBSD; then
1146 extralibs="$extralibs -lpthread"
1149 if test "$sdl" = "yes" ; then
1150 echo "CONFIG_SDL=yes" >> config.mak
1151 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1152 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1154 if test "$texi2html" = "yes"; then
1155 echo "BUILD_DOC=yes" >> config.mak
1157 if test "$have_lrintf" = "yes" ; then
1158 echo "#define HAVE_LRINTF 1" >> $TMPH
1160 if test "$vhook" = "yes" ; then
1161 echo "BUILD_VHOOK=yes" >> config.mak
1162 echo "#define HAVE_VHOOK 1" >> $TMPH
1163 extralibs="$extralibs $ldl"
1165 if test "$lshared" = "yes" ; then
1166 echo "BUILD_SHARED=yes" >> config.mak
1167 echo "PIC=-fPIC" >> config.mak
1169 echo "EXTRALIBS=$extralibs" >> config.mak
1170 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1172 echo "VERSION=$version" >>config.mak
1173 # if you do not want to use encoders, disable that.
1174 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1175 echo "CONFIG_ENCODERS=yes" >> config.mak
1177 # if you do not want to use decoders, disable that.
1178 echo "#define CONFIG_DECODERS 1" >> $TMPH
1179 echo "CONFIG_DECODERS=yes" >> config.mak
1182 if test "$a52" = "yes" ; then
1183 echo "#define CONFIG_AC3 1" >> $TMPH
1184 echo "CONFIG_AC3=yes" >> config.mak
1186 if test "$a52bin" = "yes" ; then
1187 echo "#define CONFIG_A52BIN 1" >> $TMPH
1188 echo "CONFIG_A52BIN=yes" >> config.mak
1193 if test "$dts" = "yes" ; then
1194 echo "#define CONFIG_DTS 1" >> $TMPH
1195 echo "CONFIG_DTS=yes" >> config.mak
1199 if test "$pp" = "yes" ; then
1200 echo "#define CONFIG_PP 1" >> $TMPH
1201 echo "CONFIG_PP=yes" >> config.mak
1203 if test "$shared_pp" = "yes" ; then
1204 echo "#define SHARED_PP 1" >> $TMPH
1205 echo "SHARED_PP=yes" >> config.mak
1209 # mpeg audio high precision mode
1210 if test "$mpegaudio_hp" = "yes" ; then
1211 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1214 if test "$v4l" = "yes" ; then
1215 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1216 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1219 if test "$dv1394" = "yes" ; then
1220 echo "#define CONFIG_DV1394 1" >> $TMPH
1221 echo "CONFIG_DV1394=yes" >> config.mak
1224 if test "$dlopen" = "yes" ; then
1225 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1228 if test "$dlfcn" = "yes" ; then
1229 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1232 if test "$audio_oss" = "yes" ; then
1233 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1234 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1237 if test "$audio_beos" = "yes" ; then
1238 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1239 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1242 if test "$network" = "yes" ; then
1243 echo "#define CONFIG_NETWORK 1" >> $TMPH
1244 echo "CONFIG_NETWORK=yes" >> config.mak
1247 if test "$zlib" = "yes" ; then
1248 echo "#define CONFIG_ZLIB 1" >> $TMPH
1249 echo "CONFIG_ZLIB=yes" >> config.mak
1252 if test "$mp3lame" = "yes" ; then
1253 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1254 echo "CONFIG_MP3LAME=yes" >> config.mak
1257 if test "$vorbis" = "yes" ; then
1258 echo "#define CONFIG_VORBIS 1" >> $TMPH
1259 echo "CONFIG_VORBIS=yes" >> config.mak
1262 if test "$faad" = "yes" ; then
1263 echo "#define CONFIG_FAAD 1" >> $TMPH
1264 echo "CONFIG_FAAD=yes" >> config.mak
1267 if test "$faadbin" = "yes" ; then
1268 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1269 echo "CONFIG_FAADBIN=yes" >> config.mak
1272 if test "$faac" = "yes" ; then
1273 echo "#define CONFIG_FAAC 1" >> $TMPH
1274 echo "CONFIG_FAAC=yes" >> config.mak
1277 if test "$xvid" = "yes" ; then
1278 echo "#define CONFIG_XVID 1" >> $TMPH
1279 echo "CONFIG_XVID=yes" >> config.mak
1282 if test "$mingw32" = "yes" ; then
1283 echo "#define CONFIG_WIN32 1" >> $TMPH
1284 echo "CONFIG_WIN32=yes" >> config.mak
1285 echo "HAVE_W32THREADS=yes" >> config.mak
1286 echo "#define HAVE_W32THREADS 1" >> $TMPH
1287 echo "#ifndef __MINGW32__" >> $TMPH
1288 echo "#define __MINGW32__ 1" >> $TMPH
1289 echo "#endif" >> $TMPH
1292 if test "$os2" = "yes" ; then
1293 echo "#define CONFIG_OS2 1" >> $TMPH
1294 echo "CONFIG_OS2=yes" >> config.mak
1297 if test "$TARGET_OS" = "SunOS" ; then
1298 echo "#define CONFIG_SUNOS 1" >> $TMPH
1301 if test "$darwin" = "yes"; then
1302 echo "#define CONFIG_DARWIN 1" >> $TMPH
1303 echo "CONFIG_DARWIN=yes" >> config.mak
1306 if test "$_malloc_h" = "yes" ; then
1307 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1309 echo "#undef HAVE_MALLOC_H" >> $TMPH
1312 if test "$_memalign" = "yes" ; then
1313 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1315 echo "#undef HAVE_MEMALIGN" >> $TMPH
1318 if test "$memalignhack" = "yes" ; then
1319 echo "#define MEMALIGN_HACK 1" >> $TMPH
1323 if test "$netserver" = "yes" ; then
1324 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1325 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1328 if test "$need_inet_aton" = "yes" ; then
1329 echo "NEED_INET_ATON=yes" >> config.mak
1332 if test "$simpleidct" = "yes" ; then
1333 echo "#define SIMPLE_IDCT 1" >> $TMPH
1336 if test "$ffserver" = "yes" ; then
1337 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1338 echo "CONFIG_FFSERVER=yes" >> config.mak
1341 if test "$ffplay" = "yes" ; then
1342 echo "CONFIG_FFPLAY=yes" >> config.mak
1345 if test "$risky" = "yes" ; then
1346 echo "#define CONFIG_RISKY 1" >> $TMPH
1347 echo "CONFIG_RISKY=yes" >> config.mak
1350 if test "$gpl" = "yes" ; then
1351 echo "#define CONFIG_GPL 1" >> $TMPH
1352 echo "CONFIG_GPL=yes" >> config.mak
1355 echo "#define restrict $_restrict" >> $TMPH
1357 if test "$optimize" = "small"; then
1358 echo "#define always_inline" >> $TMPH
1361 # build tree in object directory if source path is different from current one
1362 if test "$source_path_used" = "yes" ; then
1363 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1364 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1365 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1366 for dir in $DIRS ; do
1369 for f in $FILES ; do
1370 ln -sf $source_path/$f $f
1373 echo "SRC_PATH=$source_path" >> config.mak
1375 if test "$amr_wb" = "yes" ; then
1376 echo "#define AMR_WB 1" >> $TMPH
1377 echo "AMR_WB=yes" >> config.mak
1379 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1381 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1382 echo "and extracted the source to libavcodec/amrwb_float"
1386 if test "$amr_nb" = "yes" ; then
1387 echo "#define AMR_NB 1" >> $TMPH
1388 echo "AMR_NB=yes" >> config.mak
1390 if test "$amr_nb_fixed" = "yes" ; then
1391 echo "AMR_NB_FIXED=yes" >> config.mak
1392 echo "#define AMR_NB_FIXED 1" >> $TMPH
1393 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1394 echo "REL-5 version 5.1.0 from "
1395 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1396 echo "and extracted src to libavcodec/amr"
1397 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1398 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1401 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1402 echo "REL-5 V5.1.0 from "
1403 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1404 echo "and extracted the source to libavcodec/amr_float"
1405 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1411 diff $TMPH config.h >/dev/null 2>&1
1412 if test $? -ne 0 ; then
1413 mv -f $TMPH config.h
1415 echo "config.h is unchanged"
1418 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH