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"
262 ranlib="echo ignoring ranlib"
270 ranlib="echo ignoring ranlib"
271 strip="echo ignoring strip"
273 LDFLAGS="-Zomf -Zstack 16384 -s"
292 # From mplayer configure. We need TARGET_OS available
293 # to the Makefile, so it can distinguish between flavors
294 # of AltiVec on PowerPC
295 TARGET_OS=`( uname -s ) 2>&1`
297 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
305 [cC][yY][gG][wW][iI][nN]*)
309 TARGET_OS="$TARGET_OS-UNKNOWN"
314 # XXX: we assume an absolute path is given when launching configure,
315 # except in './configure' case.
316 source_path="`echo $0 | sed -e 's#/configure##'`"
317 source_path_used="yes"
318 if test -z "$source_path" -o "$source_path" = "." ; then
320 source_path_used="no"
325 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
327 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
329 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
331 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
333 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
335 --make=*) make=`echo $opt | cut -d '=' -f 2`
337 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
339 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
341 --extra-libs=*) extralibs=${opt#--extra-libs=}
343 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
345 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
347 --powerpc-perf-enable) powerpc_perf="yes"
349 --disable-mmx) mmx="no"
351 --disable-altivec) altivec="no"
353 --enable-gprof) gprof="yes"
355 --disable-v4l) v4l="no"
357 --disable-audio-oss) audio_oss="no"
359 --disable-audio-beos) audio_beos="no"
361 --disable-dv1394) dv1394="no"
363 --disable-network) network="no"
365 --disable-zlib) zlib="no"
367 --enable-a52) a52="yes"
369 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
371 --enable-pp) pp="yes"
373 --enable-shared-pp) shared_pp="yes"
375 --enable-mp3lame) mp3lame="yes"
377 --enable-vorbis) vorbis="yes"
379 --enable-faad) faad="yes"
381 --enable-faadbin) faadbin="yes"
383 --enable-faac) faac="yes"
385 --disable-vhook) vhook="no"
387 --disable-simple_idct) simpleidct="no"
389 --enable-mingw32) mingw32="yes"
391 --enable-shared) lshared="yes"
393 --disable-debug) debug="no"
395 --disable-opts) optimize="no"
397 --disable-mpegaudio-hp) mpegaudio_hp="no"
399 --disable-ffserver) ffserver="no"
401 --disable-ffplay) ffplay="no"
403 --disable-risky) risky="no"
405 --enable-small) optimize="small"
407 --enable-amr_nb) amr_nb="yes"
409 --enable-amr_nb-fixed) amr_nb_fixed="yes"
411 --enable-sunmlib) sunmlib="yes"
417 if test $mmx = "default"; then
418 if test $cpu = "x86"; then
426 if test $targetos = Darwin; then
427 if test -n "`$cc -v 2>&1 | grep xlc`"; then
428 CFLAGS="-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
430 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
431 case "$gcc_version" in
433 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
436 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
439 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL -Wno-sign-compare"
442 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
448 # Can only do AltiVec on PowerPC
449 if test $altivec = "default"; then
450 if test $cpu = "powerpc"; then
457 # Add processor-specific flags
459 if test $tune != "generic"; then
461 601|ppc601|PowerPC601)
462 CFLAGS="$CFLAGS -mcpu=601"
463 if test $altivec = "yes"; then
464 echo "WARNING: tuning for PPC601 but altivec enabled !";
468 603*|ppc603*|PowerPC603*)
469 CFLAGS="$CFLAGS -mcpu=603"
470 if test $altivec = "yes"; then
471 echo "WARNING: tuning for PPC603 but altivec enabled !";
475 604*|ppc604*|PowerPC604*)
476 CFLAGS="$CFLAGS -mcpu=604"
477 if test $altivec = "yes"; then
478 echo "WARNING: tuning for PPC604 but altivec enabled !";
482 G3|g3|75*|ppc75*|PowerPC75*)
483 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
484 if test $altivec = "yes"; then
485 echo "WARNING: tuning for PPC75x but altivec enabled !";
489 G4|g4|745*|ppc745*|PowerPC745*)
490 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
491 if test $altivec = "no"; then
492 echo "WARNING: tuning for PPC745x but altivec disabled !";
496 74*|ppc74*|PowerPC74*)
497 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
498 if test $altivec = "no"; then
499 echo "WARNING: tuning for PPC74xx but altivec disabled !";
503 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
504 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
505 if test $altivec = "no"; then
506 echo "WARNING: tuning for PPC970 but altivec disabled !";
511 echo "WARNING: unknown CPU "$tune", ignored"
516 # AltiVec flags: The FSF version of GCC differs from the Apple version
517 if test $cpu = "powerpc"; then
518 if test $altivec = "yes"; then
519 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
520 CFLAGS="$CFLAGS -faltivec"
522 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
527 # See if we have <altivec.h>
530 int main( void ) { return 0; }
534 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
538 # See does our compiler support Motorola AltiVec C API
539 if test $altivec = "yes"; then
540 if test $_altivec_h = "yes"; then
544 vector signed int v1, v2, v3;
552 vector signed int v1, v2, v3;
558 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
561 # Can only do mmi on mips
562 if test $mmi = "default"; then
563 if test $cpu = "mips"; then
570 # See does our compiler support mmi
571 if test $mmi = "yes"; then
574 __asm__ ("lq \$2, 0(\$2)");
578 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
581 if test "$mingw32" = "yes" ; then
592 prefix="/c/Program Files/FFmpeg"
596 cc="${cross_prefix}${cc}"
597 ar="${cross_prefix}${ar}"
598 ranlib="${cross_prefix}${ranlib}"
599 strip="${cross_prefix}${strip}"
601 if test -z "$cross_prefix" ; then
604 # big/little endian test
606 #include <inttypes.h>
607 int main(int argc, char ** argv){
608 volatile uint32_t i=0x01234567;
609 return (*((uint8_t*)(&i))) == 0x67;
613 if $cc -o $TMPE $TMPC 2>/dev/null ; then
614 $TMPE && bigendian="yes"
616 echo big/little test failed
621 # if cross compiling, cannot launch a program, so make a static guess
622 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
629 # check availability of some header files
633 int main( void ) { return 0; }
638 if $cc -o $TMPE $TMPC 2> /dev/null ; then
641 # check for memalign - atmos
646 string = memalign(64, sizeof(char));
650 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
655 int main( void ) { localtime_r(NULL, NULL); }
659 if $cc -o $TMPE $TMPC 2> /dev/null ; then
663 if test "$zlib" = "yes"; then
664 # check for zlib - mmu_man
668 if (zlibVersion() != ZLIB_VERSION)
669 puts("zlib version differs !!!");
674 $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
675 # $TMPE 2> /dev/null > /dev/null || zlib="no"
676 # XXX: more tests needed - runtime test
678 if test "$zlib" = "yes"; then
679 extralibs="$extralibs -lz"
682 # test for lrintf in math.h
684 #define _ISOC9X_SOURCE 1
686 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
690 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
692 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
696 for restrict_keyword in restrict __restrict__ __restrict; do
697 echo "void foo(char * $restrict_keyword p);" > $TMPC
698 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
699 _restrict=$restrict_keyword
704 # test gcc version to see if vector builtins can be used
705 # currently only used on i386 for MMX builtins
708 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
711 #error no vector builtins
717 if $cc -o $TMPO $TMPC 2> /dev/null ; then
721 # dlopen/dlfcn.h probing
725 int main( void ) { return (int) dlopen("foo", 0); }
730 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
735 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
742 int main( void ) { return (int) dlopen("foo", 0); }
745 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
749 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
754 if test "$vhook" = "default" ; then
758 ##########################################
762 #include <X11/Xlib.h>
764 int main( void ) { return (int) imlib_load_font("foo"); }
768 if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
772 ##########################################
776 #include <ft2build.h>
777 int main( void ) { return (int) FT_Init_FreeType(0); }
781 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
782 if test "`which freetype-config`" != ""; then
783 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
789 ##########################################
794 #undef main /* We don't want SDL to override our main() */
795 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
800 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
801 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
802 if test "$_sdlversion" -lt 121 ; then
809 case "`$cc -v 2>&1 | grep version`" in
811 CFLAGS="-Wall $CFLAGS"
817 if test "$sdl" = "no" ; then
821 if test "$debug" = "yes"; then
825 if test "$optimize" = "small"; then
826 # CFLAGS=${CFLAGS//-O3/-Os}
830 if test "$optimize" = "yes"; then
831 if test -n "`$cc -v 2>&1 | grep xlc`"; then
833 LDFLAGS="$LDFLAGS -O5"
839 if test x"$bindir" = x""; then
840 bindir="${prefix}/bin"
843 if test x"$mandir" = x""; then
844 mandir="${prefix}/man"
847 echo "Install prefix $prefix"
848 echo "Source path $source_path"
849 echo "C compiler $cc"
851 echo "CPU $cpu ($tune)"
852 echo "Big Endian $bigendian"
853 if test $cpu = "x86"; then
854 echo "MMX enabled $mmx"
855 echo "Vector Builtins $builtin_vector"
857 if test $cpu = "mips"; then
858 echo "MMI enabled $mmi"
860 if test $cpu = "powerpc"; then
861 echo "AltiVec enabled $altivec"
863 echo "gprof enabled $gprof"
864 echo "zlib enabled $zlib"
865 echo "mp3lame enabled $mp3lame"
866 echo "vorbis enabled $vorbis"
867 echo "faad enabled $faad"
868 echo "faadbin enabled $faadbin"
869 echo "faac enabled $faac"
870 echo "a52 support $a52"
871 echo "a52 dlopened $a52bin"
872 echo "pp support $pp"
873 echo "debug symbols $debug"
874 echo "optimize $optimize"
875 echo "shared pp $shared_pp"
876 echo "Video hooking $vhook"
877 echo "SDL support $sdl"
878 if test $sdl_too_old = "yes"; then
879 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
881 echo "risky / patent encumbered codecs $risky"
883 if test "$vhook" = "yes" ; then
884 echo "Imlib2 support $imlib2"
885 echo "freetype support $freetype2"
887 echo "Sun medialib support" $sunmlib
888 echo "AMR-NB float support" $amr_nb
889 echo "AMR-NB fixed support" $amr_nb_fixed
890 echo "AMR-WB float support" $amr_wb
892 echo "Creating config.mak and config.h"
894 echo "# Automatically generated by configure - do not modify" > config.mak
895 echo "/* Automatically generated by configure - do not modify */" > $TMPH
897 echo "prefix=$prefix" >> config.mak
898 echo "bindir=$bindir" >> config.mak
899 echo "mandir=$mandir" >> config.mak
900 echo "MAKE=$make" >> config.mak
901 echo "CC=$cc" >> config.mak
902 echo "AR=$ar" >> config.mak
903 echo "RANLIB=$ranlib" >> config.mak
904 echo "STRIP=$strip" >> config.mak
905 echo "OPTFLAGS=$CFLAGS" >> config.mak
906 echo "LDFLAGS=$LDFLAGS" >> config.mak
907 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
908 echo "SHFLAGS=$SHFLAGS" >> config.mak
909 echo "LIBPREF=$LIBPREF" >> config.mak
910 echo "LIBSUF=$LIBSUF" >> config.mak
911 echo "SLIBPREF=$SLIBPREF" >> config.mak
912 echo "SLIBSUF=$SLIBSUF" >> config.mak
913 echo "EXESUF=$EXESUF" >> config.mak
914 echo "TARGET_OS=$TARGET_OS" >> config.mak
915 if test "$cpu" = "x86" ; then
916 echo "TARGET_ARCH_X86=yes" >> config.mak
917 echo "#define ARCH_X86 1" >> $TMPH
918 elif test "$cpu" = "armv4l" ; then
919 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
920 echo "#define ARCH_ARMV4L 1" >> $TMPH
921 elif test "$cpu" = "alpha" ; then
922 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
923 echo "#define ARCH_ALPHA 1" >> $TMPH
924 elif test "$cpu" = "sparc64" ; then
925 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
926 echo "#define ARCH_SPARC64 1" >> $TMPH
927 elif test "$cpu" = "powerpc" ; then
928 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
929 echo "#define ARCH_POWERPC 1" >> $TMPH
930 if test "$powerpc_perf" = "yes"; then
931 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
933 elif test "$cpu" = "mips" ; then
934 echo "TARGET_ARCH_MIPS=yes" >> config.mak
935 echo "#define ARCH_MIPS 1" >> $TMPH
936 elif test "$cpu" = "sh4" ; then
937 echo "TARGET_ARCH_SH4=yes" >> config.mak
938 echo "#define ARCH_SH4 1" >> $TMPH
940 echo "#define TUNECPU $TUNECPU" >> $TMPH
941 if test "$bigendian" = "yes" ; then
942 echo "WORDS_BIGENDIAN=yes" >> config.mak
943 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
945 if test "$mmx" = "yes" ; then
946 echo "TARGET_MMX=yes" >> config.mak
947 echo "#define HAVE_MMX 1" >> $TMPH
948 echo "#define __CPU__ 586" >> $TMPH
950 if test "$builtin_vector" = "yes" ; then
951 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
952 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
954 if test "$mmi" = "yes" ; then
955 echo "TARGET_MMI=yes" >> config.mak
956 echo "#define HAVE_MMI 1" >> $TMPH
958 if test "$altivec" = "yes" ; then
959 echo "TARGET_ALTIVEC=yes" >> config.mak
960 echo "#define HAVE_ALTIVEC 1" >> $TMPH
961 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
962 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
963 if test "$_altivec_h" = "yes" ; then
964 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
966 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
969 if test "$gprof" = "yes" ; then
970 echo "TARGET_GPROF=yes" >> config.mak
971 echo "#define HAVE_GPROF 1" >> $TMPH
973 if test "$localtime_r" = "yes" ; then
974 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
976 if test "$imlib2" = "yes" ; then
977 echo "HAVE_IMLIB2=yes" >> config.mak
979 if test "$freetype2" = "yes" ; then
980 echo "HAVE_FREETYPE2=yes" >> config.mak
982 if test "$sunmlib" = "yes" ; then
983 echo "HAVE_MLIB=yes" >> config.mak
984 echo "#define HAVE_MLIB 1" >> $TMPH
985 extralibs="$extralibs -lmlib"
987 if test "$sdl" = "yes" ; then
988 echo "CONFIG_SDL=yes" >> config.mak
989 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
990 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
992 if test "$have_lrintf" = "yes" ; then
993 echo "#define HAVE_LRINTF 1" >> $TMPH
995 if test "$vhook" = "yes" ; then
996 echo "BUILD_VHOOK=yes" >> config.mak
997 echo "#define HAVE_VHOOK 1" >> $TMPH
998 extralibs="$extralibs $ldl"
1000 if test "$lshared" = "yes" ; then
1001 echo "BUILD_SHARED=yes" >> config.mak
1002 echo "PIC=-fPIC" >> config.mak
1004 echo "EXTRALIBS=$extralibs" >> config.mak
1005 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1007 echo "VERSION=$version" >>config.mak
1008 # if you do not want to use encoders, disable that.
1009 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1010 echo "CONFIG_ENCODERS=yes" >> config.mak
1012 # if you do not want to use decoders, disable that.
1013 echo "#define CONFIG_DECODERS 1" >> $TMPH
1014 echo "CONFIG_DECODERS=yes" >> config.mak
1017 if test "$a52" = "yes" ; then
1018 echo "#define CONFIG_AC3 1" >> $TMPH
1019 echo "CONFIG_AC3=yes" >> config.mak
1021 if test "$a52bin" = "yes" ; then
1022 echo "#define CONFIG_A52BIN 1" >> $TMPH
1023 echo "CONFIG_A52BIN=yes" >> config.mak
1028 if test "$pp" = "yes" ; then
1029 echo "#define CONFIG_PP 1" >> $TMPH
1030 echo "CONFIG_PP=yes" >> config.mak
1032 if test "$shared_pp" = "yes" ; then
1033 echo "#define SHARED_PP 1" >> $TMPH
1034 echo "SHARED_PP=yes" >> config.mak
1038 # mpeg audio high precision mode
1039 if test "$mpegaudio_hp" = "yes" ; then
1040 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1043 if test "$v4l" = "yes" ; then
1044 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1045 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1048 if test "$dv1394" = "yes" ; then
1049 echo "#define CONFIG_DV1394 1" >> $TMPH
1050 echo "CONFIG_DV1394=yes" >> config.mak
1053 if test "$dlopen" = "yes" ; then
1054 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1057 if test "$dlfcn" = "yes" ; then
1058 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1061 if test "$audio_oss" = "yes" ; then
1062 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1063 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1066 if test "$audio_beos" = "yes" ; then
1067 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1068 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1071 if test "$network" = "yes" ; then
1072 echo "#define CONFIG_NETWORK 1" >> $TMPH
1073 echo "CONFIG_NETWORK=yes" >> config.mak
1076 if test "$zlib" = "yes" ; then
1077 echo "#define CONFIG_ZLIB 1" >> $TMPH
1078 echo "CONFIG_ZLIB=yes" >> config.mak
1081 if test "$mp3lame" = "yes" ; then
1082 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1083 echo "CONFIG_MP3LAME=yes" >> config.mak
1086 if test "$vorbis" = "yes" ; then
1087 echo "#define CONFIG_VORBIS 1" >> $TMPH
1088 echo "CONFIG_VORBIS=yes" >> config.mak
1091 if test "$faad" = "yes" ; then
1092 echo "#define CONFIG_FAAD 1" >> $TMPH
1093 echo "CONFIG_FAAD=yes" >> config.mak
1096 if test "$faadbin" = "yes" ; then
1097 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1098 echo "CONFIG_FAADBIN=yes" >> config.mak
1101 if test "$faac" = "yes" ; then
1102 echo "#define CONFIG_FAAC 1" >> $TMPH
1103 echo "CONFIG_FAAC=yes" >> config.mak
1106 if test "$mingw32" = "yes" ; then
1107 echo "#define CONFIG_WIN32 1" >> $TMPH
1108 echo "CONFIG_WIN32=yes" >> config.mak
1109 echo "#ifndef __MINGW32__" >> $TMPH
1110 echo "#define __MINGW32__ 1" >> $TMPH
1111 echo "#endif" >> $TMPH
1114 if test "$os2" = "yes" ; then
1115 echo "#define CONFIG_OS2 1" >> $TMPH
1116 echo "CONFIG_OS2=yes" >> config.mak
1119 if test "$TARGET_OS" = "SunOS" ; then
1120 echo "#define CONFIG_SUNOS 1" >> $TMPH
1123 if test "$darwin" = "yes"; then
1124 echo "#define CONFIG_DARWIN 1" >> $TMPH
1125 echo "CONFIG_DARWIN=yes" >> config.mak
1128 if test "$_malloc_h" = "yes" ; then
1129 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1131 echo "#undef HAVE_MALLOC_H" >> $TMPH
1134 if test "$_memalign" = "yes" ; then
1135 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1137 echo "#undef HAVE_MEMALIGN" >> $TMPH
1140 if test "$netserver" = "yes" ; then
1141 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1142 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1145 if test "$need_inet_aton" = "yes" ; then
1146 echo "NEED_INET_ATON=yes" >> config.mak
1149 if test "$simpleidct" = "yes" ; then
1150 echo "#define SIMPLE_IDCT 1" >> $TMPH
1153 if test "$ffserver" = "yes" ; then
1154 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1155 echo "CONFIG_FFSERVER=yes" >> config.mak
1158 if test "$ffplay" = "yes" ; then
1159 echo "CONFIG_FFPLAY=yes" >> config.mak
1162 if test "$risky" = "yes" ; then
1163 echo "#define CONFIG_RISKY 1" >> $TMPH
1164 echo "CONFIG_RISKY=yes" >> config.mak
1167 echo "#define restrict $_restrict" >> $TMPH
1169 # build tree in object directory if source path is different from current one
1170 if test "$source_path_used" = "yes" ; then
1171 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1172 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1173 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1174 for dir in $DIRS ; do
1177 for f in $FILES ; do
1178 ln -sf $source_path/$f $f
1181 echo "SRC_PATH=$source_path" >> config.mak
1183 if test "$amr_wb" = "yes" ; then
1184 echo "#define AMR_WB 1" >> $TMPH
1185 echo "AMR_WB=yes" >> config.mak
1187 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1189 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1190 echo "and extracted the source to libavcodec/amrwb_float"
1194 if test "$amr_nb" = "yes" ; then
1195 echo "#define AMR_NB 1" >> $TMPH
1196 echo "AMR_NB=yes" >> config.mak
1198 if test "$amr_nb_fixed" = "yes" ; then
1199 echo "AMR_NB_FIXED=yes" >> config.mak
1200 echo "#define AMR_NB_FIXED 1" >> $TMPH
1201 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1202 echo "REL-5 version 5.1.0 from "
1203 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1204 echo "and extracted src to libavcodec/amr"
1205 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1206 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1209 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1210 echo "REL-5 V5.1.0 from "
1211 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1212 echo "and extracted the source to libavcodec/amr_float"
1218 diff $TMPH config.h >/dev/null 2>&1
1219 if test $? -ne 0 ; then
1220 mv -f $TMPH config.h
1222 echo "config.h is unchanged"
1225 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH