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 " --disable-risky disables patent encumbered codecs"
67 echo " --enable-small optimize for size instead of speed"
68 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
69 echo " --disable-strip disable stripping of executables and shared libraries"
71 echo "NOTE: The object files are build at the place where configure is launched"
75 # set temporary file name
76 if test ! -z "$TMPDIR" ; then
78 elif test ! -z "$TEMPDIR" ; then
84 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
85 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
86 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
87 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
88 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
107 i386|i486|i586|i686|i86pc|BePC)
111 if [ "`$cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
112 -z "`echo $CFLAGS | grep -- -m32`" ]; then
118 # armv4l is a subset of armv5tel
125 "Power Macintosh"|ppc)
184 LDFLAGS=-Wl,--warn-common
204 prefix="/boot/home/config"
205 # helps building libavcodec
206 CFLAGS="-DPIC -fomit-frame-pointer"
207 # 3 gcc releases known for BeOS, each with ugly bugs
208 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
209 case "$gcc_version" in
210 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
213 *20010315*) echo "BeBits gcc"
214 CFLAGS="$CFLAGS -fno-expensive-optimizations"
218 # disable linux things
224 # no need for libm, but the inet stuff
226 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
227 extralibs="-lbind -lsocket"
241 extralibs="$extralibs -lsocket -lnsl"
249 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
255 extralibs="-lpoll -lgnugetopt -lm"
264 SHFLAGS="-dynamiclib"
269 FFSLDFLAGS=-Wl,-bind_at_load
272 # Note: the rest of the mingw32 config is done afterwards as mingw32
273 # 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)
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="${opt#--extra-cflags=}"
373 --extra-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 --disable-risky) risky="no"
445 --enable-small) optimize="small"
447 --enable-amr_nb) amr_nb="yes"
449 --enable-amr_nb-fixed) amr_nb_fixed="yes"
451 --enable-amr_wb) amr_wb="yes"
453 --enable-sunmlib) sunmlib="yes"
455 --enable-pthreads) pthreads="yes"
457 --enable-gpl) gpl="yes"
459 --enable-memalign-hack) memalignhack="yes"
461 --disable-strip) dostrip="no"
466 if test "$gpl" != "yes"; then
467 if test "$pp" != "no" -o "$shared_pp" != "no"; then
468 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
472 if test "$a52" != "no" -o "$a52bin" != "no"; then
473 echo "liba52 is under GPL and --enable-gpl is not specified"
477 if test "$xvid" != "no"; then
478 echo "libxvidcore is under GPL and --enable-gpl is not specified"
482 if test "$dts" != "no"; then
483 echo "libdts is under GPL and --enable-gpl is not specified"
487 if test "$faad" != "no" -o "$faadbin" != "no"; then
490 int main( void ) { return 0; }
493 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
496 #ifndef FAAD2_VERSION
499 int main( void ) { return 0; }
501 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
502 echo "faad2 is under GPL and --enable-gpl is not specified"
508 echo "faad test failed"
513 if test "$fail" = "yes"; then
519 if test $mmx = "default"; then
520 if test $cpu = "x86" -o $cpu = "x86_64"; then
528 needmdynamicnopic="no"
529 if test $targetos = Darwin; then
530 if test -n "`$cc -v 2>&1 | grep xlc`"; then
531 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
533 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
534 case "$gcc_version" in
536 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
539 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
540 if test "$lshared" = no; then
541 needmdynamicnopic="yes"
545 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
546 if test "$lshared" = no; then
547 needmdynamicnopic="yes"
554 # Can only do AltiVec on PowerPC
555 if test $altivec = "default"; then
556 if test $cpu = "powerpc"; then
563 # Add processor-specific flags
566 if test $tune != "generic"; then
568 601|ppc601|PowerPC601)
569 CFLAGS="$CFLAGS -mcpu=601"
570 if test $altivec = "yes"; then
571 echo "WARNING: tuning for PPC601 but altivec enabled !";
575 603*|ppc603*|PowerPC603*)
576 CFLAGS="$CFLAGS -mcpu=603"
577 if test $altivec = "yes"; then
578 echo "WARNING: tuning for PPC603 but altivec enabled !";
582 604*|ppc604*|PowerPC604*)
583 CFLAGS="$CFLAGS -mcpu=604"
584 if test $altivec = "yes"; then
585 echo "WARNING: tuning for PPC604 but altivec enabled !";
589 G3|g3|75*|ppc75*|PowerPC75*)
590 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
591 if test $altivec = "yes"; then
592 echo "WARNING: tuning for PPC75x but altivec enabled !";
596 G4|g4|745*|ppc745*|PowerPC745*)
597 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
598 if test $altivec = "no"; then
599 echo "WARNING: tuning for PPC745x but altivec disabled !";
603 74*|ppc74*|PowerPC74*)
604 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
605 if test $altivec = "no"; then
606 echo "WARNING: tuning for PPC74xx but altivec disabled !";
610 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
611 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
612 if test $altivec = "no"; then
613 echo "WARNING: tuning for PPC970 but altivec disabled !";
619 echo "WARNING: unknown CPU "$tune", ignored"
624 # AltiVec flags: The FSF version of GCC differs from the Apple version
625 if test $cpu = "powerpc"; then
626 if test $altivec = "yes"; then
627 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
628 CFLAGS="$CFLAGS -faltivec"
630 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
635 # See if we have <altivec.h>
638 int main( void ) { return 0; }
642 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
646 # See does our compiler support Motorola AltiVec C API
647 if test $altivec = "yes"; then
648 if test $_altivec_h = "yes"; then
652 vector signed int v1, v2, v3;
660 vector signed int v1, v2, v3;
666 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
669 # Can only do mmi on mips
670 if test $mmi = "default"; then
671 if test $cpu = "mips"; then
678 # See does our compiler support mmi
679 if test $mmi = "yes"; then
682 __asm__ ("lq \$2, 0(\$2)");
686 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
689 if test "$mingw32" = "yes" ; then
701 prefix="/c/Program Files/FFmpeg"
705 cc="${cross_prefix}${cc}"
706 ar="${cross_prefix}${ar}"
707 ranlib="${cross_prefix}${ranlib}"
708 strip="${cross_prefix}${strip}"
710 if test -z "$cross_prefix" ; then
713 # big/little endian test
715 #include <inttypes.h>
716 int main(int argc, char ** argv){
717 volatile uint32_t i=0x01234567;
718 return (*((uint8_t*)(&i))) == 0x67;
722 if $cc -o $TMPE $TMPC 2>/dev/null ; then
723 $TMPE && bigendian="yes"
725 echo big/little test failed
730 # if cross compiling, cannot launch a program, so make a static guess
731 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
740 #include <inttypes.h>
741 int main(int argc, char ** argv){
746 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
751 #include <inttypes.h>
752 int main(int argc, char ** argv){
753 volatile uint_fast64_t i=0x01234567;
758 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
761 # check availability of some header files
765 int main( void ) { return 0; }
770 if $cc -o $TMPE $TMPC 2> /dev/null ; then
773 # check for memalign - atmos
778 string = memalign(64, sizeof(char));
782 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
785 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
786 echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
792 int main( void ) { localtime_r(NULL, NULL); }
796 if $cc -o $TMPE $TMPC 2> /dev/null ; then
800 if test "$zlib" = "yes"; then
801 # check for zlib - mmu_man
805 if (zlibVersion() != ZLIB_VERSION)
806 puts("zlib version differs !!!");
811 $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
812 # $TMPE 2> /dev/null > /dev/null || zlib="no"
813 # XXX: more tests needed - runtime test
815 if test "$zlib" = "yes"; then
816 extralibs="$extralibs -lz"
819 # test for lrintf in math.h
821 #define _ISOC9X_SOURCE 1
823 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
827 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
829 # allanc@chickenandporn.com: cannot execute cross-compiled
830 # code on the host. Only execute if not cross-compiling.
831 if test -z "$cross_prefix" ; then
832 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
837 for restrict_keyword in restrict __restrict__ __restrict; do
838 echo "void foo(char * $restrict_keyword p);" > $TMPC
839 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
840 _restrict=$restrict_keyword
845 # test gcc version to see if vector builtins can be used
846 # currently only used on i386 for MMX builtins
848 #include <xmmintrin.h>
850 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
853 #error no vector builtins
859 if $cc -o $TMPO $TMPC 2> /dev/null ; then
863 # dlopen/dlfcn.h probing
867 int main( void ) { return (int) dlopen("foo", 0); }
872 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
877 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
884 int main( void ) { return (int) dlopen("foo", 0); }
887 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
891 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
896 if test "$vhook" = "default" ; then
900 ##########################################
904 #include <X11/Xlib.h>
906 int main( void ) { return (int) imlib_load_font("foo"); }
910 if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
914 ##########################################
918 #include <ft2build.h>
919 int main( void ) { return (int) FT_Init_FreeType(0); }
923 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
924 if (freetype-config --version) >/dev/null 2>&1 ; then
925 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
931 ##########################################
936 #undef main /* We don't want SDL to override our main() */
937 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
942 if (sdl-config --version) >/dev/null 2>&1 ; then
943 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
944 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
945 if test "$_sdlversion" -lt 121 ; then
953 ##########################################
957 if (texi2html -version) >/dev/null 2>&1; then
961 case "`$cc -v 2>&1 | grep version`" in
963 CFLAGS="-Wall $CFLAGS"
969 if test "$sdl" = "no" ; then
973 if test "$debug" = "yes"; then
977 if test "$optimize" = "small"; then
978 # CFLAGS=${CFLAGS//-O3/-Os}
982 if test "$optimize" = "yes"; then
983 if test -n "`$cc -v 2>&1 | grep xlc`"; then
985 LDFLAGS="$LDFLAGS -O5"
991 if test x"$bindir" = x""; then
992 bindir="${prefix}/bin"
995 if test x"$mandir" = x""; then
996 mandir="${prefix}/man"
999 echo "Install prefix $prefix"
1000 echo "Source path $source_path"
1001 echo "C compiler $cc"
1003 echo "CPU $cpu ($tune)"
1004 echo "Big Endian $bigendian"
1005 echo "inttypes.h $inttypes"
1006 echo "broken inttypes.h $emu_fast_int"
1007 if test $cpu = "x86" -o $cpu = "x86_64"; then
1008 echo "MMX enabled $mmx"
1009 echo "Vector Builtins $builtin_vector"
1011 if test $cpu = "mips"; then
1012 echo "MMI enabled $mmi"
1014 if test $cpu = "powerpc"; then
1015 echo "AltiVec enabled $altivec"
1017 echo "gprof enabled $gprof"
1018 echo "zlib enabled $zlib"
1019 echo "mp3lame enabled $mp3lame"
1020 echo "vorbis enabled $vorbis"
1021 echo "faad enabled $faad"
1022 echo "faadbin enabled $faadbin"
1023 echo "faac enabled $faac"
1024 echo "xvid enabled $xvid"
1025 echo "a52 support $a52"
1026 echo "a52 dlopened $a52bin"
1027 echo "dts support $dts"
1028 echo "pp support $pp"
1029 echo "debug symbols $debug"
1030 echo "strip symbols $dostrip"
1031 echo "optimize $optimize"
1032 echo "shared pp $shared_pp"
1033 echo "Video hooking $vhook"
1034 echo "SDL support $sdl"
1035 if test $sdl_too_old = "yes"; then
1036 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1038 echo "risky / patent encumbered codecs $risky"
1040 if test "$vhook" = "yes" ; then
1041 echo "Imlib2 support $imlib2"
1042 echo "freetype support $freetype2"
1044 echo "Sun medialib support" $sunmlib
1045 echo "pthreads support" $pthreads
1046 echo "AMR-NB float support" $amr_nb
1047 echo "AMR-NB fixed support" $amr_nb_fixed
1048 echo "AMR-WB float support" $amr_wb
1049 if test "$gpl" = "no" ; then
1050 echo "License: LGPL"
1055 echo "Creating config.mak and config.h"
1058 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1059 echo "# Automatically generated by configure - do not modify" > config.mak
1060 echo "/* Automatically generated by configure - do not modify */" > $TMPH
1061 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1063 echo "prefix=$prefix" >> config.mak
1064 echo "bindir=$bindir" >> config.mak
1065 echo "mandir=$mandir" >> config.mak
1066 echo "MAKE=$make" >> config.mak
1067 echo "CC=$cc" >> config.mak
1068 echo "AR=$ar" >> config.mak
1069 echo "RANLIB=$ranlib" >> config.mak
1070 if test "$dostrip" = "yes" ; then
1071 echo "STRIP=$strip" >> config.mak
1072 echo "INSTALLSTRIP=-s" >> config.mak
1074 echo "STRIP=echo ignoring strip" >> config.mak
1075 echo "INSTALLSTRIP=" >> config.mak
1078 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1079 # shared modules on OS/X (vhook/Makefile).
1081 if test "$needmdynamicnopic" = yes; then
1082 CFLAGS="$CFLAGS -mdynamic-no-pic"
1085 echo "OPTFLAGS=$CFLAGS" >> config.mak
1086 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1087 echo "LDFLAGS=$LDFLAGS" >> config.mak
1088 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1089 echo "SHFLAGS=$SHFLAGS" >> config.mak
1090 echo "LIBPREF=$LIBPREF" >> config.mak
1091 echo "LIBSUF=$LIBSUF" >> config.mak
1092 echo "SLIBPREF=$SLIBPREF" >> config.mak
1093 echo "SLIBSUF=$SLIBSUF" >> config.mak
1094 echo "EXESUF=$EXESUF" >> config.mak
1095 echo "TARGET_OS=$TARGET_OS" >> config.mak
1096 if test "$cpu" = "x86" ; then
1097 echo "TARGET_ARCH_X86=yes" >> config.mak
1098 echo "#define ARCH_X86 1" >> $TMPH
1099 elif test "$cpu" = "x86_64" ; then
1100 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1101 echo "#define ARCH_X86_64 1" >> $TMPH
1102 elif test "$cpu" = "armv4l" ; then
1103 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1104 echo "#define ARCH_ARMV4L 1" >> $TMPH
1105 elif test "$cpu" = "alpha" ; then
1106 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1107 echo "#define ARCH_ALPHA 1" >> $TMPH
1108 elif test "$cpu" = "sparc64" ; then
1109 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1110 echo "#define ARCH_SPARC64 1" >> $TMPH
1111 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1112 echo "#define ARCH_SPARC 1" >> $TMPH
1113 elif test "$cpu" = "sparc" ; then
1114 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1115 echo "#define ARCH_SPARC 1" >> $TMPH
1116 elif test "$cpu" = "powerpc" ; then
1117 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1118 echo "#define ARCH_POWERPC 1" >> $TMPH
1119 if test $POWERPCMODE = "32bits"; then
1120 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1122 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1124 if test "$powerpc_perf" = "yes"; then
1125 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1127 elif test "$cpu" = "mips" ; then
1128 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1129 echo "#define ARCH_MIPS 1" >> $TMPH
1130 elif test "$cpu" = "sh4" ; then
1131 echo "TARGET_ARCH_SH4=yes" >> config.mak
1132 echo "#define ARCH_SH4 1" >> $TMPH
1134 echo "#define TUNECPU $TUNECPU" >> $TMPH
1135 if test "$bigendian" = "yes" ; then
1136 echo "WORDS_BIGENDIAN=yes" >> config.mak
1137 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1139 if test "$inttypes" != "yes" ; then
1140 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1142 if test "$emu_fast_int" = "yes" ; then
1143 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1145 if test "$mmx" = "yes" ; then
1146 echo "TARGET_MMX=yes" >> config.mak
1147 echo "#define HAVE_MMX 1" >> $TMPH
1148 echo "#define __CPU__ 586" >> $TMPH
1150 if test "$builtin_vector" = "yes" ; then
1151 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1152 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1154 if test "$mmi" = "yes" ; then
1155 echo "TARGET_MMI=yes" >> config.mak
1156 echo "#define HAVE_MMI 1" >> $TMPH
1158 if test "$altivec" = "yes" ; then
1159 echo "TARGET_ALTIVEC=yes" >> config.mak
1160 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1161 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1162 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1163 if test "$_altivec_h" = "yes" ; then
1164 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1166 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1169 if test "$gprof" = "yes" ; then
1170 echo "TARGET_GPROF=yes" >> config.mak
1171 echo "#define HAVE_GPROF 1" >> $TMPH
1173 if test "$localtime_r" = "yes" ; then
1174 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1176 if test "$imlib2" = "yes" ; then
1177 echo "HAVE_IMLIB2=yes" >> config.mak
1179 if test "$freetype2" = "yes" ; then
1180 echo "HAVE_FREETYPE2=yes" >> config.mak
1182 if test "$sunmlib" = "yes" ; then
1183 echo "HAVE_MLIB=yes" >> config.mak
1184 echo "#define HAVE_MLIB 1" >> $TMPH
1185 extralibs="$extralibs -lmlib"
1187 if test "$pthreads" = "yes" ; then
1188 echo "HAVE_PTHREADS=yes" >> config.mak
1189 echo "#define HAVE_PTHREADS 1" >> $TMPH
1190 if test $targetos != FreeBSD; then
1191 extralibs="$extralibs -lpthread"
1194 if test "$sdl" = "yes" ; then
1195 echo "CONFIG_SDL=yes" >> config.mak
1196 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1197 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1199 if test "$texi2html" = "yes"; then
1200 echo "BUILD_DOC=yes" >> config.mak
1202 if test "$have_lrintf" = "yes" ; then
1203 echo "#define HAVE_LRINTF 1" >> $TMPH
1205 if test "$vhook" = "yes" ; then
1206 echo "BUILD_VHOOK=yes" >> config.mak
1207 echo "#define HAVE_VHOOK 1" >> $TMPH
1208 extralibs="$extralibs $ldl"
1210 if test "$lshared" = "yes" ; then
1211 echo "BUILD_SHARED=yes" >> config.mak
1212 echo "PIC=-fPIC" >> config.mak
1214 echo "EXTRALIBS=$extralibs" >> config.mak
1215 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1217 echo "VERSION=$version" >>config.mak
1218 # if you do not want to use encoders, disable that.
1219 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1220 echo "CONFIG_ENCODERS=yes" >> config.mak
1222 # if you do not want to use decoders, disable that.
1223 echo "#define CONFIG_DECODERS 1" >> $TMPH
1224 echo "CONFIG_DECODERS=yes" >> config.mak
1227 if test "$a52" = "yes" ; then
1228 echo "#define CONFIG_AC3 1" >> $TMPH
1229 echo "CONFIG_AC3=yes" >> config.mak
1231 if test "$a52bin" = "yes" ; then
1232 echo "#define CONFIG_A52BIN 1" >> $TMPH
1233 echo "CONFIG_A52BIN=yes" >> config.mak
1238 if test "$dts" = "yes" ; then
1239 echo "#define CONFIG_DTS 1" >> $TMPH
1240 echo "CONFIG_DTS=yes" >> config.mak
1244 if test "$pp" = "yes" ; then
1245 echo "#define CONFIG_PP 1" >> $TMPH
1246 echo "CONFIG_PP=yes" >> config.mak
1248 if test "$shared_pp" = "yes" ; then
1249 echo "#define SHARED_PP 1" >> $TMPH
1250 echo "SHARED_PP=yes" >> config.mak
1254 # mpeg audio high precision mode
1255 if test "$mpegaudio_hp" = "yes" ; then
1256 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1259 if test "$v4l" = "yes" ; then
1260 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1261 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1264 if test "$dv1394" = "yes" ; then
1265 echo "#define CONFIG_DV1394 1" >> $TMPH
1266 echo "CONFIG_DV1394=yes" >> config.mak
1269 if test "$dc1394" = "yes" ; then
1270 echo "#define CONFIG_DC1394 1" >> $TMPH
1271 echo "CONFIG_DC1394=yes" >> config.mak
1274 if test "$dlopen" = "yes" ; then
1275 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1278 if test "$dlfcn" = "yes" ; then
1279 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1282 if test "$audio_oss" = "yes" ; then
1283 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1284 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1287 if test "$audio_beos" = "yes" ; then
1288 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1289 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1292 if test "$network" = "yes" ; then
1293 echo "#define CONFIG_NETWORK 1" >> $TMPH
1294 echo "CONFIG_NETWORK=yes" >> config.mak
1297 if test "$zlib" = "yes" ; then
1298 echo "#define CONFIG_ZLIB 1" >> $TMPH
1299 echo "CONFIG_ZLIB=yes" >> config.mak
1302 if test "$mp3lame" = "yes" ; then
1303 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1304 echo "CONFIG_MP3LAME=yes" >> config.mak
1307 if test "$vorbis" = "yes" ; then
1308 echo "#define CONFIG_VORBIS 1" >> $TMPH
1309 echo "CONFIG_VORBIS=yes" >> config.mak
1312 if test "$faad" = "yes" ; then
1313 echo "#define CONFIG_FAAD 1" >> $TMPH
1314 echo "CONFIG_FAAD=yes" >> config.mak
1317 if test "$faadbin" = "yes" ; then
1318 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1319 echo "CONFIG_FAADBIN=yes" >> config.mak
1322 if test "$faac" = "yes" ; then
1323 echo "#define CONFIG_FAAC 1" >> $TMPH
1324 echo "CONFIG_FAAC=yes" >> config.mak
1327 if test "$xvid" = "yes" ; then
1328 echo "#define CONFIG_XVID 1" >> $TMPH
1329 echo "CONFIG_XVID=yes" >> config.mak
1332 if test "$mingw32" = "yes" ; then
1333 echo "#define CONFIG_WIN32 1" >> $TMPH
1334 echo "CONFIG_WIN32=yes" >> config.mak
1335 echo "HAVE_W32THREADS=yes" >> config.mak
1336 echo "#define HAVE_W32THREADS 1" >> $TMPH
1337 echo "#ifndef __MINGW32__" >> $TMPH
1338 echo "#define __MINGW32__ 1" >> $TMPH
1339 echo "#endif" >> $TMPH
1342 if test "$os2" = "yes" ; then
1343 echo "#define CONFIG_OS2 1" >> $TMPH
1344 echo "CONFIG_OS2=yes" >> config.mak
1347 if test "$TARGET_OS" = "SunOS" ; then
1348 echo "#define CONFIG_SUNOS 1" >> $TMPH
1351 if test "$darwin" = "yes"; then
1352 echo "#define CONFIG_DARWIN 1" >> $TMPH
1353 echo "CONFIG_DARWIN=yes" >> config.mak
1356 if test "$_malloc_h" = "yes" ; then
1357 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1359 echo "#undef HAVE_MALLOC_H" >> $TMPH
1362 if test "$_memalign" = "yes" ; then
1363 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1365 echo "#undef HAVE_MEMALIGN" >> $TMPH
1368 if test "$memalignhack" = "yes" ; then
1369 echo "#define MEMALIGN_HACK 1" >> $TMPH
1373 if test "$netserver" = "yes" ; then
1374 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1375 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1378 if test "$need_inet_aton" = "yes" ; then
1379 echo "NEED_INET_ATON=yes" >> config.mak
1382 if test "$simpleidct" = "yes" ; then
1383 echo "#define SIMPLE_IDCT 1" >> $TMPH
1386 if test "$ffserver" = "yes" ; then
1387 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1388 echo "CONFIG_FFSERVER=yes" >> config.mak
1391 if test "$ffplay" = "yes" ; then
1392 echo "CONFIG_FFPLAY=yes" >> config.mak
1395 if test "$risky" = "yes" ; then
1396 echo "#define CONFIG_RISKY 1" >> $TMPH
1397 echo "CONFIG_RISKY=yes" >> config.mak
1400 if test "$gpl" = "yes" ; then
1401 echo "#define CONFIG_GPL 1" >> $TMPH
1402 echo "CONFIG_GPL=yes" >> config.mak
1405 echo "#define restrict $_restrict" >> $TMPH
1407 if test "$optimize" = "small"; then
1408 echo "#define always_inline" >> $TMPH
1411 # build tree in object directory if source path is different from current one
1412 if test "$source_path_used" = "yes" ; then
1413 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1414 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1415 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1416 for dir in $DIRS ; do
1419 for f in $FILES ; do
1420 ln -sf $source_path/$f $f
1423 echo "SRC_PATH=$source_path" >> config.mak
1425 if test "$amr_wb" = "yes" ; then
1426 echo "#define AMR_WB 1" >> $TMPH
1427 echo "AMR_WB=yes" >> config.mak
1429 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1431 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1432 echo "and extracted the source to libavcodec/amrwb_float"
1436 if test "$amr_nb" = "yes" ; then
1437 echo "#define AMR_NB 1" >> $TMPH
1438 echo "AMR_NB=yes" >> config.mak
1440 if test "$amr_nb_fixed" = "yes" ; then
1441 echo "AMR_NB_FIXED=yes" >> config.mak
1442 echo "#define AMR_NB_FIXED 1" >> $TMPH
1443 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1444 echo "REL-5 version 5.1.0 from "
1445 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1446 echo "and extracted src to libavcodec/amr"
1447 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1448 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1451 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1452 echo "REL-5 V5.1.0 from "
1453 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1454 echo "and extracted the source to libavcodec/amr_float"
1455 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1461 diff $TMPH config.h >/dev/null 2>&1
1462 if test $? -ne 0 ; then
1463 mv -f $TMPH config.h
1465 echo "config.h is unchanged"
1468 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH