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-mingw32 enable mingw32 native/cross windows compile"
23 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
24 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
25 echo " --enable-pp enable GPL'ed post processing support [default=no]"
26 echo " --enable-shared-pp use libpostproc.so [default=no]"
27 echo " --enable-shared build shared libraries [default=no]"
28 echo " --enable-amr_nb enable amr_nb float audio codec"
29 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
30 echo " --enable-sunmlib use Sun medialib [default=no]"
32 echo "Advanced options (experts only):"
33 echo " --source-path=PATH path of source code [$source_path]"
34 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
35 echo " --cc=CC use C compiler CC [$cc]"
36 echo " --make=MAKE use specified make [$make]"
37 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
38 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
39 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
40 echo " --cpu=CPU force cpu to CPU [$cpu]"
41 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
42 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
43 echo " --disable-mmx disable mmx usage"
44 echo " --disable-altivec disable AltiVec usage"
45 echo " --disable-audio-oss disable OSS audio support [default=no]"
46 echo " --disable-audio-beos disable BeOS audio support [default=no]"
47 echo " --disable-v4l disable video4linux grabbing [default=no]"
48 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
49 echo " --disable-network disable network support [default=no]"
50 echo " --disable-zlib disable zlib [default=no]"
51 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
52 echo " --disable-vhook disable video hooking support"
53 echo " --enable-gprof enable profiling with gprof [$gprof]"
54 echo " --disable-debug disable debugging symbols"
55 echo " --disable-opts disable compiler optimizations"
56 echo " --disable-mpegaudio-hp faster (but less accurate)"
57 echo " mpegaudio decoding [default=no]"
58 echo " --disable-ffserver disable ffserver build"
59 echo " --disable-ffplay disable ffplay build"
60 echo " --disable-risky disables patent encumbered codecs"
61 echo " --enable-small optimize for size instead of speed"
63 echo "NOTE: The object files are build at the place where configure is launched"
67 # set temporary file name
68 if test ! -z "$TMPDIR" ; then
70 elif test ! -z "$TEMPDIR" ; then
76 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
77 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
78 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
79 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
80 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
99 i386|i486|i586|i686|i86pc|BePC)
102 # armv4l is a subset of armv5tel
109 "Power Macintosh"|ppc)
159 LDFLAGS=-Wl,--warn-common
176 prefix="/boot/home/config"
177 # helps building libavcodec
178 CFLAGS="-DPIC -fomit-frame-pointer"
179 # 3 gcc releases known for BeOS, each with ugly bugs
180 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
181 case "$gcc_version" in
182 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
185 *20010315*) echo "BeBits gcc"
186 CFLAGS="$CFLAGS -fno-expensive-optimizations"
190 # disable linux things
196 # no need for libm, but the inet stuff
198 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
199 extralibs="-lbind -lsocket"
213 extralibs="$extralibs -lsocket -lnsl"
220 LDFLAGS="$LDFLAGS -export-dynamic"
226 extralibs="-lpoll -lgnugetopt -lm"
235 SHFLAGS="-dynamiclib"
240 FFSLDFLAGS=-Wl,-bind_at_load
243 # Note: the rest of the mingw32 config is done afterwards as mingw32
244 # can be forced on command line for linux cross compilation
253 test -f /usr/include/inttypes.h || \
254 test -f /usr/local/include/inttypes.h || \
255 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
256 "/usr/include/inttypes.h !!!"
259 LDFLAGS="$LDFLAGS -rdynamic"
264 ranlib="echo ignoring ranlib"
265 strip="echo ignoring strip"
267 LDFLAGS="-Zomf -Zstack 16384 -s"
286 # From mplayer configure. We need TARGET_OS available
287 # to the Makefile, so it can distinguish between flavors
288 # of AltiVec on PowerPC
289 TARGET_OS=`( uname -s ) 2>&1`
291 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
299 [cC][yY][gG][wW][iI][nN]*)
303 TARGET_OS="$TARGET_OS-UNKNOWN"
308 # XXX: we assume an absolute path is given when launching configure,
309 # except in './configure' case.
310 source_path="`echo $0 | sed -e 's#/configure##'`"
311 source_path_used="yes"
312 if test -z "$source_path" -o "$source_path" = "." ; then
314 source_path_used="no"
319 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
321 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
323 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
325 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
327 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
329 --make=*) make=`echo $opt | cut -d '=' -f 2`
331 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
333 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
335 --extra-libs=*) extralibs=${opt#--extra-libs=}
337 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
339 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
341 --powerpc-perf-enable) powerpc_perf="yes"
343 --disable-mmx) mmx="no"
345 --disable-altivec) altivec="no"
347 --enable-gprof) gprof="yes"
349 --disable-v4l) v4l="no"
351 --disable-audio-oss) audio_oss="no"
353 --disable-audio-beos) audio_beos="no"
355 --disable-dv1394) dv1394="no"
357 --disable-network) network="no"
359 --disable-zlib) zlib="no"
361 --enable-a52) a52="yes"
363 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
365 --enable-pp) pp="yes"
367 --enable-shared-pp) shared_pp="yes"
369 --enable-mp3lame) mp3lame="yes"
371 --enable-vorbis) vorbis="yes"
373 --enable-faad) faad="yes"
375 --enable-faadbin) faadbin="yes"
377 --enable-faac) faac="yes"
379 --disable-vhook) vhook="no"
381 --disable-simple_idct) simpleidct="no"
383 --enable-mingw32) mingw32="yes"
385 --enable-shared) lshared="yes"
387 --disable-debug) debug="no"
389 --disable-opts) optimize="no"
391 --disable-mpegaudio-hp) mpegaudio_hp="no"
393 --disable-ffserver) ffserver="no"
395 --disable-ffplay) ffplay="no"
397 --disable-risky) risky="no"
399 --enable-small) optimize="small"
401 --enable-amr_nb) amr_nb="yes"
403 --enable-amr_nb-fixed) amr_nb_fixed="yes"
405 --enable-sunmlib) sunmlib="yes"
411 if test $mmx = "default"; then
412 if test $cpu = "x86"; then
420 if test $targetos = Darwin; then
421 if test -n "`$cc -v 2>&1 | grep xlc`"; then
422 CFLAGS="-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
424 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
425 case "$gcc_version" in
427 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
430 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
433 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL -Wno-sign-compare"
436 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
442 # Can only do AltiVec on PowerPC
443 if test $altivec = "default"; then
444 if test $cpu = "powerpc"; then
451 # Add processor-specific flags
453 if test $tune != "generic"; then
455 601|ppc601|PowerPC601)
456 CFLAGS="$CFLAGS -mcpu=601"
457 if test $altivec = "yes"; then
458 echo "WARNING: tuning for PPC601 but altivec enabled !";
462 603*|ppc603*|PowerPC603*)
463 CFLAGS="$CFLAGS -mcpu=603"
464 if test $altivec = "yes"; then
465 echo "WARNING: tuning for PPC603 but altivec enabled !";
469 604*|ppc604*|PowerPC604*)
470 CFLAGS="$CFLAGS -mcpu=604"
471 if test $altivec = "yes"; then
472 echo "WARNING: tuning for PPC604 but altivec enabled !";
476 G3|g3|75*|ppc75*|PowerPC75*)
477 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
478 if test $altivec = "yes"; then
479 echo "WARNING: tuning for PPC75x but altivec enabled !";
483 G4|g4|745*|ppc745*|PowerPC745*)
484 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
485 if test $altivec = "no"; then
486 echo "WARNING: tuning for PPC745x but altivec disabled !";
490 74*|ppc74*|PowerPC74*)
491 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
492 if test $altivec = "no"; then
493 echo "WARNING: tuning for PPC74xx but altivec disabled !";
497 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
498 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
499 if test $altivec = "no"; then
500 echo "WARNING: tuning for PPC970 but altivec disabled !";
505 echo "WARNING: unknown CPU "$tune", ignored"
510 # AltiVec flags: The FSF version of GCC differs from the Apple version
511 if test $cpu = "powerpc"; then
512 if test $altivec = "yes"; then
513 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
514 CFLAGS="$CFLAGS -faltivec"
516 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
521 # See if we have <altivec.h>
524 int main( void ) { return 0; }
528 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
532 # See does our compiler support Motorola AltiVec C API
533 if test $altivec = "yes"; then
534 if test $_altivec_h = "yes"; then
538 vector signed int v1, v2, v3;
546 vector signed int v1, v2, v3;
552 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
555 # Can only do mmi on mips
556 if test $mmi = "default"; then
557 if test $cpu = "mips"; then
564 # See does our compiler support mmi
565 if test $mmi = "yes"; then
568 __asm__ ("lq \$2, 0(\$2)");
572 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
575 if test "$mingw32" = "yes" ; then
586 prefix="/c/Program Files/FFmpeg"
590 cc="${cross_prefix}${cc}"
591 ar="${cross_prefix}${ar}"
592 ranlib="${cross_prefix}${ranlib}"
593 strip="${cross_prefix}${strip}"
595 if test -z "$cross_prefix" ; then
598 # big/little endian test
600 #include <inttypes.h>
601 int main(int argc, char ** argv){
602 volatile uint32_t i=0x01234567;
603 return (*((uint8_t*)(&i))) == 0x67;
607 if $cc -o $TMPE $TMPC 2>/dev/null ; then
608 $TMPE && bigendian="yes"
610 echo big/little test failed
615 # if cross compiling, cannot launch a program, so make a static guess
616 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
623 # check availability of some header files
627 int main( void ) { return 0; }
632 if $cc -o $TMPE $TMPC 2> /dev/null ; then
635 # check for memalign - atmos
640 string = memalign(64, sizeof(char));
644 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
649 int main( void ) { localtime_r(NULL, NULL); }
653 if $cc -o $TMPE $TMPC 2> /dev/null ; then
657 if test "$zlib" = "yes"; then
658 # check for zlib - mmu_man
662 if (zlibVersion() != ZLIB_VERSION)
663 puts("zlib version differs !!!");
668 $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
669 # $TMPE 2> /dev/null > /dev/null || zlib="no"
670 # XXX: more tests needed - runtime test
672 if test "$zlib" = "yes"; then
673 extralibs="$extralibs -lz"
676 # test for lrintf in math.h
678 #define _ISOC9X_SOURCE 1
680 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
684 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
686 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
690 for restrict_keyword in restrict __restrict__ __restrict; do
691 echo "void foo(char * $restrict_keyword p);" > $TMPC
692 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
693 _restrict=$restrict_keyword
698 # test gcc version to see if vector builtins can be used
699 # currently only used on i386 for MMX builtins
702 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
705 #error no vector builtins
711 if $cc -o $TMPO $TMPC 2> /dev/null ; then
715 # dlopen/dlfcn.h probing
719 int main( void ) { return (int) dlopen("foo", 0); }
724 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
729 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
736 int main( void ) { return (int) dlopen("foo", 0); }
739 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
743 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
748 if test "$vhook" = "default" ; then
752 ##########################################
756 #include <X11/Xlib.h>
758 int main( void ) { return (int) imlib_load_font("foo"); }
762 if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
766 ##########################################
770 #include <ft2build.h>
771 int main( void ) { return (int) FT_Init_FreeType(0); }
775 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
776 if test "`which freetype-config`" != ""; then
777 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
783 ##########################################
788 #undef main /* We don't want SDL to override our main() */
789 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
794 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
795 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
796 if test "$_sdlversion" -lt 121 ; then
803 case "`$cc -v 2>&1 | grep version`" in
805 CFLAGS="-Wall $CFLAGS"
811 if test "$sdl" = "no" ; then
815 if test "$debug" = "yes"; then
819 if test "$optimize" = "small"; then
820 # CFLAGS=${CFLAGS//-O3/-Os}
824 if test "$optimize" = "yes"; then
825 if test -n "`$cc -v 2>&1 | grep xlc`"; then
827 LDFLAGS="$LDFLAGS -O5"
833 if test x"$bindir" = x""; then
834 bindir="${prefix}/bin"
837 if test x"$mandir" = x""; then
838 mandir="${prefix}/man"
841 echo "Install prefix $prefix"
842 echo "Source path $source_path"
843 echo "C compiler $cc"
845 echo "CPU $cpu ($tune)"
846 echo "Big Endian $bigendian"
847 if test $cpu = "x86"; then
848 echo "MMX enabled $mmx"
849 echo "Vector Builtins $builtin_vector"
851 if test $cpu = "mips"; then
852 echo "MMI enabled $mmi"
854 if test $cpu = "powerpc"; then
855 echo "AltiVec enabled $altivec"
857 echo "gprof enabled $gprof"
858 echo "zlib enabled $zlib"
859 echo "mp3lame enabled $mp3lame"
860 echo "vorbis enabled $vorbis"
861 echo "faad enabled $faad"
862 echo "faadbin enabled $faadbin"
863 echo "faac enabled $faac"
864 echo "a52 support $a52"
865 echo "a52 dlopened $a52bin"
866 echo "pp support $pp"
867 echo "debug symbols $debug"
868 echo "optimize $optimize"
869 echo "shared pp $shared_pp"
870 echo "Video hooking $vhook"
871 echo "SDL support $sdl"
872 if test $sdl_too_old = "yes"; then
873 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
875 echo "risky / patent encumbered codecs $risky"
877 if test "$vhook" = "yes" ; then
878 echo "Imlib2 support $imlib2"
879 echo "freetype support $freetype2"
881 echo "Sun medialib support" $sunmlib
882 echo "AMR-NB float support" $amr_nb
883 echo "AMR-NB fixed support" $amr_nb_fixed
884 echo "AMR-WB float support" $amr_wb
886 echo "Creating config.mak and config.h"
888 echo "# Automatically generated by configure - do not modify" > config.mak
889 echo "/* Automatically generated by configure - do not modify */" > $TMPH
891 echo "prefix=$prefix" >> config.mak
892 echo "bindir=$bindir" >> config.mak
893 echo "mandir=$mandir" >> config.mak
894 echo "MAKE=$make" >> config.mak
895 echo "CC=$cc" >> config.mak
896 echo "AR=$ar" >> config.mak
897 echo "RANLIB=$ranlib" >> config.mak
898 echo "STRIP=$strip" >> config.mak
899 echo "OPTFLAGS=$CFLAGS" >> config.mak
900 echo "LDFLAGS=$LDFLAGS" >> config.mak
901 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
902 echo "SHFLAGS=$SHFLAGS" >> config.mak
903 echo "LIBPREF=$LIBPREF" >> config.mak
904 echo "LIBSUF=$LIBSUF" >> config.mak
905 echo "SLIBPREF=$SLIBPREF" >> config.mak
906 echo "SLIBSUF=$SLIBSUF" >> config.mak
907 echo "EXESUF=$EXESUF" >> config.mak
908 echo "TARGET_OS=$TARGET_OS" >> config.mak
909 if test "$cpu" = "x86" ; then
910 echo "TARGET_ARCH_X86=yes" >> config.mak
911 echo "#define ARCH_X86 1" >> $TMPH
912 elif test "$cpu" = "armv4l" ; then
913 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
914 echo "#define ARCH_ARMV4L 1" >> $TMPH
915 elif test "$cpu" = "alpha" ; then
916 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
917 echo "#define ARCH_ALPHA 1" >> $TMPH
918 elif test "$cpu" = "sparc64" ; then
919 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
920 echo "#define ARCH_SPARC64 1" >> $TMPH
921 elif test "$cpu" = "powerpc" ; then
922 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
923 echo "#define ARCH_POWERPC 1" >> $TMPH
924 if test "$powerpc_perf" = "yes"; then
925 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
927 elif test "$cpu" = "mips" ; then
928 echo "TARGET_ARCH_MIPS=yes" >> config.mak
929 echo "#define ARCH_MIPS 1" >> $TMPH
930 elif test "$cpu" = "sh4" ; then
931 echo "TARGET_ARCH_SH4=yes" >> config.mak
932 echo "#define ARCH_SH4 1" >> $TMPH
934 echo "#define TUNECPU $TUNECPU" >> $TMPH
935 if test "$bigendian" = "yes" ; then
936 echo "WORDS_BIGENDIAN=yes" >> config.mak
937 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
939 if test "$mmx" = "yes" ; then
940 echo "TARGET_MMX=yes" >> config.mak
941 echo "#define HAVE_MMX 1" >> $TMPH
942 echo "#define __CPU__ 586" >> $TMPH
944 if test "$builtin_vector" = "yes" ; then
945 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
946 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
948 if test "$mmi" = "yes" ; then
949 echo "TARGET_MMI=yes" >> config.mak
950 echo "#define HAVE_MMI 1" >> $TMPH
952 if test "$altivec" = "yes" ; then
953 echo "TARGET_ALTIVEC=yes" >> config.mak
954 echo "#define HAVE_ALTIVEC 1" >> $TMPH
955 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
956 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
957 if test "$_altivec_h" = "yes" ; then
958 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
960 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
963 if test "$gprof" = "yes" ; then
964 echo "TARGET_GPROF=yes" >> config.mak
965 echo "#define HAVE_GPROF 1" >> $TMPH
967 if test "$localtime_r" = "yes" ; then
968 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
970 if test "$imlib2" = "yes" ; then
971 echo "HAVE_IMLIB2=yes" >> config.mak
973 if test "$freetype2" = "yes" ; then
974 echo "HAVE_FREETYPE2=yes" >> config.mak
976 if test "$sunmlib" = "yes" ; then
977 echo "HAVE_MLIB=yes" >> config.mak
978 echo "#define HAVE_MLIB 1" >> $TMPH
979 extralibs="$extralibs -lmlib"
981 if test "$sdl" = "yes" ; then
982 echo "CONFIG_SDL=yes" >> config.mak
983 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
984 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
986 if test "$have_lrintf" = "yes" ; then
987 echo "#define HAVE_LRINTF 1" >> $TMPH
989 if test "$vhook" = "yes" ; then
990 echo "BUILD_VHOOK=yes" >> config.mak
991 echo "#define HAVE_VHOOK 1" >> $TMPH
992 extralibs="$extralibs $ldl"
994 if test "$lshared" = "yes" ; then
995 echo "BUILD_SHARED=yes" >> config.mak
996 echo "PIC=-fPIC" >> config.mak
998 echo "EXTRALIBS=$extralibs" >> config.mak
999 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1001 echo "VERSION=$version" >>config.mak
1002 # if you do not want to use encoders, disable that.
1003 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1004 echo "CONFIG_ENCODERS=yes" >> config.mak
1006 # if you do not want to use decoders, disable that.
1007 echo "#define CONFIG_DECODERS 1" >> $TMPH
1008 echo "CONFIG_DECODERS=yes" >> config.mak
1011 if test "$a52" = "yes" ; then
1012 echo "#define CONFIG_AC3 1" >> $TMPH
1013 echo "CONFIG_AC3=yes" >> config.mak
1015 if test "$a52bin" = "yes" ; then
1016 echo "#define CONFIG_A52BIN 1" >> $TMPH
1017 echo "CONFIG_A52BIN=yes" >> config.mak
1022 if test "$pp" = "yes" ; then
1023 echo "#define CONFIG_PP 1" >> $TMPH
1024 echo "CONFIG_PP=yes" >> config.mak
1026 if test "$shared_pp" = "yes" ; then
1027 echo "#define SHARED_PP 1" >> $TMPH
1028 echo "SHARED_PP=yes" >> config.mak
1032 # mpeg audio high precision mode
1033 if test "$mpegaudio_hp" = "yes" ; then
1034 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1037 if test "$v4l" = "yes" ; then
1038 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1039 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1042 if test "$dv1394" = "yes" ; then
1043 echo "#define CONFIG_DV1394 1" >> $TMPH
1044 echo "CONFIG_DV1394=yes" >> config.mak
1047 if test "$dlopen" = "yes" ; then
1048 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1051 if test "$dlfcn" = "yes" ; then
1052 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1055 if test "$audio_oss" = "yes" ; then
1056 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1057 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1060 if test "$audio_beos" = "yes" ; then
1061 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1062 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1065 if test "$network" = "yes" ; then
1066 echo "#define CONFIG_NETWORK 1" >> $TMPH
1067 echo "CONFIG_NETWORK=yes" >> config.mak
1070 if test "$zlib" = "yes" ; then
1071 echo "#define CONFIG_ZLIB 1" >> $TMPH
1072 echo "CONFIG_ZLIB=yes" >> config.mak
1075 if test "$mp3lame" = "yes" ; then
1076 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1077 echo "CONFIG_MP3LAME=yes" >> config.mak
1080 if test "$vorbis" = "yes" ; then
1081 echo "#define CONFIG_VORBIS 1" >> $TMPH
1082 echo "CONFIG_VORBIS=yes" >> config.mak
1085 if test "$faad" = "yes" ; then
1086 echo "#define CONFIG_FAAD 1" >> $TMPH
1087 echo "CONFIG_FAAD=yes" >> config.mak
1090 if test "$faadbin" = "yes" ; then
1091 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1092 echo "CONFIG_FAADBIN=yes" >> config.mak
1095 if test "$faac" = "yes" ; then
1096 echo "#define CONFIG_FAAC 1" >> $TMPH
1097 echo "CONFIG_FAAC=yes" >> config.mak
1100 if test "$mingw32" = "yes" ; then
1101 echo "#define CONFIG_WIN32 1" >> $TMPH
1102 echo "CONFIG_WIN32=yes" >> config.mak
1103 echo "#ifndef __MINGW32__" >> $TMPH
1104 echo "#define __MINGW32__ 1" >> $TMPH
1105 echo "#endif" >> $TMPH
1108 if test "$os2" = "yes" ; then
1109 echo "#define CONFIG_OS2 1" >> $TMPH
1110 echo "CONFIG_OS2=yes" >> config.mak
1113 if test "$TARGET_OS" = "SunOS" ; then
1114 echo "#define CONFIG_SUNOS 1" >> $TMPH
1117 if test "$darwin" = "yes"; then
1118 echo "#define CONFIG_DARWIN 1" >> $TMPH
1119 echo "CONFIG_DARWIN=yes" >> config.mak
1122 if test "$_malloc_h" = "yes" ; then
1123 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1125 echo "#undef HAVE_MALLOC_H" >> $TMPH
1128 if test "$_memalign" = "yes" ; then
1129 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1131 echo "#undef HAVE_MEMALIGN" >> $TMPH
1134 if test "$netserver" = "yes" ; then
1135 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1136 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1139 if test "$need_inet_aton" = "yes" ; then
1140 echo "NEED_INET_ATON=yes" >> config.mak
1143 if test "$simpleidct" = "yes" ; then
1144 echo "#define SIMPLE_IDCT 1" >> $TMPH
1147 if test "$ffserver" = "yes" ; then
1148 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1149 echo "CONFIG_FFSERVER=yes" >> config.mak
1152 if test "$ffplay" = "yes" ; then
1153 echo "CONFIG_FFPLAY=yes" >> config.mak
1156 if test "$risky" = "yes" ; then
1157 echo "#define CONFIG_RISKY 1" >> $TMPH
1158 echo "CONFIG_RISKY=yes" >> config.mak
1161 echo "#define restrict $_restrict" >> $TMPH
1163 # build tree in object directory if source path is different from current one
1164 if test "$source_path_used" = "yes" ; then
1165 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1166 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1167 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1168 for dir in $DIRS ; do
1171 for f in $FILES ; do
1172 ln -sf $source_path/$f $f
1175 echo "SRC_PATH=$source_path" >> config.mak
1177 if test "$amr_wb" = "yes" ; then
1178 echo "#define AMR_WB 1" >> $TMPH
1179 echo "AMR_WB=yes" >> config.mak
1181 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1183 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1184 echo "and extracted the source to libavcodec/amrwb_float"
1188 if test "$amr_nb" = "yes" ; then
1189 echo "#define AMR_NB 1" >> $TMPH
1190 echo "AMR_NB=yes" >> config.mak
1192 if test "$amr_nb_fixed" = "yes" ; then
1193 echo "AMR_NB_FIXED=yes" >> config.mak
1194 echo "#define AMR_NB_FIXED 1" >> $TMPH
1195 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1196 echo "REL-5 version 5.1.0 from "
1197 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1198 echo "and extracted src to libavcodec/amr"
1199 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1200 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1203 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1204 echo "REL-5 V5.1.0 from "
1205 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1206 echo "and extracted the source to libavcodec/amr_float"
1212 diff $TMPH config.h >/dev/null 2>&1
1213 if test $? -ne 0 ; then
1214 mv -f $TMPH config.h
1216 echo "config.h is unchanged"
1219 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH