3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
8 elif test ! -z "$TEMPDIR" ; then
14 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
17 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
18 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
37 i386|i486|i586|i686|i86pc|BePC)
40 # armv4l is a subset of armv5tel
47 "Power Macintosh"|ppc)
97 LDFLAGS=-Wl,--warn-common
114 prefix="/boot/home/config"
115 # helps building libavcodec
116 CFLAGS="-DPIC -fomit-frame-pointer"
117 # 3 gcc releases known for BeOS, each with ugly bugs
118 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
119 case "$gcc_version" in
120 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
123 *20010315*) echo "BeBits gcc"
124 CFLAGS="$CFLAGS -fno-expensive-optimizations"
128 # disable linux things
134 # no need for libm, but the inet stuff
136 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
137 extralibs="-lbind -lsocket"
151 extralibs="$extralibs -lsocket -lnsl"
158 LDFLAGS="$LDFLAGS -export-dynamic"
164 extralibs="-lpoll -lgnugetopt -lm"
173 SHFLAGS="-dynamiclib"
178 FFSLDFLAGS=-Wl,-bind_at_load
179 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
180 case "$gcc_version" in
182 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
185 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL -Wno-sign-compare"
188 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
193 # Note: the rest of the mingw32 config is done afterwards as mingw32
194 # can be forced on command line for linux cross compilation
203 test -f /usr/include/inttypes.h || \
204 test -f /usr/local/include/inttypes.h || \
205 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
206 "/usr/include/inttypes.h !!!"
209 LDFLAGS="$LDFLAGS -rdynamic"
214 ranlib="echo ignoring ranlib"
215 strip="echo ignoring strip"
217 LDFLAGS="-Zomf -Zstack 16384 -s"
236 # From mplayer configure. We need TARGET_OS available
237 # to the Makefile, so it can distinguish between flavors
238 # of AltiVec on PowerPC
239 TARGET_OS=`( uname -s ) 2>&1`
241 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
249 [cC][yY][gG][wW][iI][nN]*)
253 TARGET_OS="$TARGET_OS-UNKNOWN"
258 # XXX: we assume an absolute path is given when launching configure,
259 # except in './configure' case.
260 source_path="`echo $0 | sed -e 's#/configure##'`"
261 source_path_used="yes"
262 if test -z "$source_path" -o "$source_path" = "." ; then
264 source_path_used="no"
269 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
271 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
273 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
275 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
277 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
279 --make=*) make=`echo $opt | cut -d '=' -f 2`
281 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
283 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
285 --extra-libs=*) extralibs=${opt#--extra-libs=}
287 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
289 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
291 --powerpc-perf-enable) powerpc_perf="yes"
293 --disable-mmx) mmx="no"
295 --disable-altivec) altivec="no"
297 --enable-gprof) gprof="yes"
299 --disable-v4l) v4l="no"
301 --disable-audio-oss) audio_oss="no"
303 --disable-audio-beos) audio_beos="no"
305 --disable-dv1394) dv1394="no"
307 --disable-network) network="no"
309 --disable-zlib) zlib="no"
311 --enable-a52) a52="yes"
313 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
315 --enable-pp) pp="yes"
317 --enable-shared-pp) shared_pp="yes"
319 --enable-mp3lame) mp3lame="yes"
321 --enable-vorbis) vorbis="yes"
323 --enable-faad) faad="yes"
325 --enable-faadbin) faadbin="yes"
327 --enable-faac) faac="yes"
329 --disable-vhook) vhook="no"
331 --disable-simple_idct) simpleidct="no"
333 --enable-mingw32) mingw32="yes"
335 --enable-shared) lshared="yes"
337 --disable-debug) debug="no"
339 --disable-opts) optimize="no"
341 --disable-mpegaudio-hp) mpegaudio_hp="no"
343 --disable-ffserver) ffserver="no"
345 --disable-ffplay) ffplay="no"
347 --disable-risky) risky="no"
349 --enable-small) optimize="small"
351 --enable-amr_nb) amr_nb="yes"
353 --enable-amr_nb-fixed) amr_nb_fixed="yes"
355 --enable-sunmlib) sunmlib="yes"
361 if test $mmx = "default"; then
362 if test $cpu = "x86"; then
369 # Can only do AltiVec on PowerPC
370 if test $altivec = "default"; then
371 if test $cpu = "powerpc"; then
378 # Add processor-specific flags
380 if test $tune != "generic"; then
382 601|ppc601|PowerPC601)
383 CFLAGS="$CFLAGS -mcpu=601"
384 if test $altivec = "yes"; then
385 echo "WARNING: tuning for PPC601 but altivec enabled !";
389 603*|ppc603*|PowerPC603*)
390 CFLAGS="$CFLAGS -mcpu=603"
391 if test $altivec = "yes"; then
392 echo "WARNING: tuning for PPC603 but altivec enabled !";
396 604*|ppc604*|PowerPC604*)
397 CFLAGS="$CFLAGS -mcpu=604"
398 if test $altivec = "yes"; then
399 echo "WARNING: tuning for PPC604 but altivec enabled !";
403 G3|g3|75*|ppc75*|PowerPC75*)
404 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
405 if test $altivec = "yes"; then
406 echo "WARNING: tuning for PPC75x but altivec enabled !";
410 G4|g4|745*|ppc745*|PowerPC745*)
411 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
412 if test $altivec = "no"; then
413 echo "WARNING: tuning for PPC745x but altivec disabled !";
417 74*|ppc74*|PowerPC74*)
418 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
419 if test $altivec = "no"; then
420 echo "WARNING: tuning for PPC74xx but altivec disabled !";
424 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
425 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
426 if test $altivec = "no"; then
427 echo "WARNING: tuning for PPC970 but altivec disabled !";
432 echo "WARNING: unknown CPU "$tune", ignored"
437 # AltiVec flags: The FSF version of GCC differs from the Darwin version
438 if test $cpu = "powerpc"; then
439 if test $altivec = "yes"; then
440 if test "$darwin" = "yes"; then
441 CFLAGS="$CFLAGS -faltivec"
443 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
448 # See if we have <altivec.h>
451 int main( void ) { return 0; }
455 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
459 # See does our compiler support Motorola AltiVec C API
460 if test $altivec = "yes"; then
461 if test $_altivec_h = "yes"; then
465 vector signed int v1, v2, v3;
473 vector signed int v1, v2, v3;
479 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
482 # Can only do mmi on mips
483 if test $mmi = "default"; then
484 if test $cpu = "mips"; then
491 # See does our compiler support mmi
492 if test $mmi = "yes"; then
495 __asm__ ("lq \$2, 0(\$2)");
499 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
502 if test "$mingw32" = "yes" ; then
513 prefix="/c/Program Files/FFmpeg"
517 cc="${cross_prefix}${cc}"
518 ar="${cross_prefix}${ar}"
519 ranlib="${cross_prefix}${ranlib}"
520 strip="${cross_prefix}${strip}"
522 if test -z "$cross_prefix" ; then
525 # big/little endian test
527 #include <inttypes.h>
528 int main(int argc, char ** argv){
529 volatile uint32_t i=0x01234567;
530 return (*((uint8_t*)(&i))) == 0x67;
534 if $cc -o $TMPE $TMPC 2>/dev/null ; then
535 $TMPE && bigendian="yes"
537 echo big/little test failed
542 # if cross compiling, cannot launch a program, so make a static guess
543 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
550 # check availability of some header files
554 int main( void ) { return 0; }
559 if $cc -o $TMPE $TMPC 2> /dev/null ; then
562 # check for memalign - atmos
567 string = memalign(64, sizeof(char));
571 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
576 int main( void ) { localtime_r(NULL, NULL); }
580 if $cc -o $TMPE $TMPC 2> /dev/null ; then
584 if test "$zlib" = "yes"; then
585 # check for zlib - mmu_man
589 if (zlibVersion() != ZLIB_VERSION)
590 puts("zlib version differs !!!");
595 $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
596 # $TMPE 2> /dev/null > /dev/null || zlib="no"
597 # XXX: more tests needed - runtime test
599 if test "$zlib" = "yes"; then
600 extralibs="$extralibs -lz"
603 # test for lrintf in math.h
605 #define _ISOC9X_SOURCE 1
607 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
611 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
613 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
617 for restrict_keyword in restrict __restrict__ __restrict; do
618 echo "void foo(char * $restrict_keyword p);" > $TMPC
619 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
620 _restrict=$restrict_keyword
625 # test gcc version to see if vector builtins can be used
626 # currently only used on i386 for MMX builtins
629 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
632 #error no vector builtins
638 if $cc -o $TMPO $TMPC 2> /dev/null ; then
642 # dlopen/dlfcn.h probing
646 int main( void ) { return (int) dlopen("foo", 0); }
651 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
656 if $cc -o $TMPE $TMPC 2> /dev/null ; then
663 int main( void ) { return (int) dlopen("foo", 0); }
666 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
670 if $cc -o $TMPE $TMPC 2> /dev/null ; then
675 if test "$vhook" = "default" ; then
679 ##########################################
683 #include <X11/Xlib.h>
685 int main( void ) { return (int) imlib_load_font("foo"); }
689 if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null ; then
693 ##########################################
697 #include <ft2build.h>
698 int main( void ) { return (int) FT_Init_FreeType(0); }
702 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
703 if test "`which freetype-config`" != ""; then
704 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` 2> /dev/null ; then
710 ##########################################
715 #undef main /* We don't want SDL to override our main() */
716 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
721 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then
722 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
723 if test "$_sdlversion" -lt 121 ; then
730 if test "$sdl" = "no" ; then
734 if test "$debug" = "yes"; then
738 if test "$optimize" = "small"; then
739 # CFLAGS=${CFLAGS//-O3/-Os}
743 if test "$optimize" = "yes"; then
747 if test x"$bindir" = x""; then
748 bindir="${prefix}/bin"
751 if test x"$mandir" = x""; then
752 mandir="${prefix}/man"
755 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
758 Usage: configure [options]
759 Options: [defaults in brackets after descriptions]
762 echo "Standard options:"
763 echo " --help print this message"
764 echo " --prefix=PREFIX install in PREFIX [$prefix]"
765 echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
766 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
767 echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
768 echo " --enable-faad enable faad support via libfaad [default=no]"
769 echo " --enable-faadbin build faad support with runtime linking [default=no]"
770 echo " --enable-faac enable faac support via libfaac [default=no]"
771 echo " --enable-mingw32 enable mingw32 native/cross windows compile"
772 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
773 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
774 echo " --enable-pp enable GPL'ed post processing support [default=no]"
775 echo " --enable-shared-pp use libpostproc.so [default=no]"
776 echo " --enable-shared build shared libraries [default=no]"
777 echo " --enable-amr_nb enable amr_nb float audio codec"
778 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
779 echo " --enable-sunmlib use Sun medialib [default=no]"
781 echo "Advanced options (experts only):"
782 echo " --source-path=PATH path of source code [$source_path]"
783 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
784 echo " --cc=CC use C compiler CC [$cc]"
785 echo " --make=MAKE use specified make [$make]"
786 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
787 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
788 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
789 echo " --cpu=CPU force cpu to CPU [$cpu]"
790 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
791 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
792 echo " --disable-mmx disable mmx usage"
793 echo " --disable-altivec disable AltiVec usage"
794 echo " --disable-audio-oss disable OSS audio support [default=no]"
795 echo " --disable-audio-beos disable BeOS audio support [default=no]"
796 echo " --disable-v4l disable video4linux grabbing [default=no]"
797 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
798 echo " --disable-network disable network support [default=no]"
799 echo " --disable-zlib disable zlib [default=no]"
800 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
801 echo " --disable-vhook disable video hooking support"
802 echo " --enable-gprof enable profiling with gprof [$gprof]"
803 echo " --disable-debug disable debugging symbols"
804 echo " --disable-opts disable compiler optimizations"
805 echo " --disable-mpegaudio-hp faster (but less accurate)"
806 echo " mpegaudio decoding [default=no]"
807 echo " --disable-ffserver disable ffserver build"
808 echo " --disable-ffplay disable ffplay build"
809 echo " --disable-risky disables patent encumbered codecs"
810 echo " --enable-small optimize for size instead of speed"
812 echo "NOTE: The object files are build at the place where configure is launched"
816 echo "Install prefix $prefix"
817 echo "Source path $source_path"
818 echo "C compiler $cc"
820 echo "CPU $cpu ($tune)"
821 echo "Big Endian $bigendian"
822 if test $cpu = "x86"; then
823 echo "MMX enabled $mmx"
824 echo "Vector Builtins $builtin_vector"
826 if test $cpu = "mips"; then
827 echo "MMI enabled $mmi"
829 if test $cpu = "powerpc"; then
830 echo "AltiVec enabled $altivec"
832 echo "gprof enabled $gprof"
833 echo "zlib enabled $zlib"
834 echo "mp3lame enabled $mp3lame"
835 echo "vorbis enabled $vorbis"
836 echo "faad enabled $faad"
837 echo "faadbin enabled $faadbin"
838 echo "faac enabled $faac"
839 echo "a52 support $a52"
840 echo "a52 dlopened $a52bin"
841 echo "pp support $pp"
842 echo "debug symbols $debug"
843 echo "optimize $optimize"
844 echo "shared pp $shared_pp"
845 echo "Video hooking $vhook"
846 echo "SDL support $sdl"
847 if test $sdl_too_old = "yes"; then
848 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
850 echo "risky / patent encumbered codecs $risky"
852 if test "$vhook" = "yes" ; then
853 echo "Imlib2 support $imlib2"
854 echo "freetype support $freetype2"
856 echo "Sun medialib support" $sunmlib
857 echo "AMR-NB float support" $amr_nb
858 echo "AMR-NB fixed support" $amr_nb_fixed
859 echo "AMR-WB float support" $amr_wb
861 echo "Creating config.mak and config.h"
863 echo "# Automatically generated by configure - do not modify" > config.mak
864 echo "/* Automatically generated by configure - do not modify */" > $TMPH
866 echo "prefix=$prefix" >> config.mak
867 echo "bindir=$bindir" >> config.mak
868 echo "mandir=$mandir" >> config.mak
869 echo "MAKE=$make" >> config.mak
870 echo "CC=$cc" >> config.mak
871 echo "AR=$ar" >> config.mak
872 echo "RANLIB=$ranlib" >> config.mak
873 echo "STRIP=$strip" >> config.mak
874 echo "OPTFLAGS=$CFLAGS" >> config.mak
875 echo "LDFLAGS=$LDFLAGS" >> config.mak
876 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
877 echo "SHFLAGS=$SHFLAGS" >> config.mak
878 echo "LIBPREF=$LIBPREF" >> config.mak
879 echo "LIBSUF=$LIBSUF" >> config.mak
880 echo "SLIBPREF=$SLIBPREF" >> config.mak
881 echo "SLIBSUF=$SLIBSUF" >> config.mak
882 echo "EXESUF=$EXESUF" >> config.mak
883 echo "TARGET_OS=$TARGET_OS" >> config.mak
884 if test "$cpu" = "x86" ; then
885 echo "TARGET_ARCH_X86=yes" >> config.mak
886 echo "#define ARCH_X86 1" >> $TMPH
887 elif test "$cpu" = "armv4l" ; then
888 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
889 echo "#define ARCH_ARMV4L 1" >> $TMPH
890 elif test "$cpu" = "alpha" ; then
891 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
892 echo "#define ARCH_ALPHA 1" >> $TMPH
893 elif test "$cpu" = "sparc64" ; then
894 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
895 echo "#define ARCH_SPARC64 1" >> $TMPH
896 elif test "$cpu" = "powerpc" ; then
897 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
898 echo "#define ARCH_POWERPC 1" >> $TMPH
899 if test "$powerpc_perf" = "yes"; then
900 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
902 elif test "$cpu" = "mips" ; then
903 echo "TARGET_ARCH_MIPS=yes" >> config.mak
904 echo "#define ARCH_MIPS 1" >> $TMPH
905 elif test "$cpu" = "sh4" ; then
906 echo "TARGET_ARCH_SH4=yes" >> config.mak
907 echo "#define ARCH_SH4 1" >> $TMPH
909 echo "#define TUNECPU $TUNECPU" >> $TMPH
910 if test "$bigendian" = "yes" ; then
911 echo "WORDS_BIGENDIAN=yes" >> config.mak
912 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
914 if test "$mmx" = "yes" ; then
915 echo "TARGET_MMX=yes" >> config.mak
916 echo "#define HAVE_MMX 1" >> $TMPH
917 echo "#define __CPU__ 586" >> $TMPH
919 if test "$builtin_vector" = "yes" ; then
920 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
921 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
923 if test "$mmi" = "yes" ; then
924 echo "TARGET_MMI=yes" >> config.mak
925 echo "#define HAVE_MMI 1" >> $TMPH
927 if test "$altivec" = "yes" ; then
928 echo "TARGET_ALTIVEC=yes" >> config.mak
929 echo "#define HAVE_ALTIVEC 1" >> $TMPH
930 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
931 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
932 if test "$_altivec_h" = "yes" ; then
933 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
935 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
938 if test "$gprof" = "yes" ; then
939 echo "TARGET_GPROF=yes" >> config.mak
940 echo "#define HAVE_GPROF 1" >> $TMPH
942 if test "$localtime_r" = "yes" ; then
943 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
945 if test "$imlib2" = "yes" ; then
946 echo "HAVE_IMLIB2=yes" >> config.mak
948 if test "$freetype2" = "yes" ; then
949 echo "HAVE_FREETYPE2=yes" >> config.mak
951 if test "$sunmlib" = "yes" ; then
952 echo "HAVE_MLIB=yes" >> config.mak
953 echo "#define HAVE_MLIB 1" >> $TMPH
954 extralibs="$extralibs -lmlib"
956 if test "$sdl" = "yes" ; then
957 echo "CONFIG_SDL=yes" >> config.mak
958 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
959 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
961 if test "$have_lrintf" = "yes" ; then
962 echo "#define HAVE_LRINTF 1" >> $TMPH
964 if test "$vhook" = "yes" ; then
965 echo "BUILD_VHOOK=yes" >> config.mak
966 echo "#define HAVE_VHOOK 1" >> $TMPH
967 extralibs="$extralibs $ldl"
969 if test "$lshared" = "yes" ; then
970 echo "BUILD_SHARED=yes" >> config.mak
971 echo "PIC=-fPIC" >> config.mak
973 echo "EXTRALIBS=$extralibs" >> config.mak
974 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
976 echo "VERSION=$version" >>config.mak
977 # if you do not want to use encoders, disable that.
978 echo "#define CONFIG_ENCODERS 1" >> $TMPH
979 echo "CONFIG_ENCODERS=yes" >> config.mak
981 # if you do not want to use decoders, disable that.
982 echo "#define CONFIG_DECODERS 1" >> $TMPH
983 echo "CONFIG_DECODERS=yes" >> config.mak
986 if test "$a52" = "yes" ; then
987 echo "#define CONFIG_AC3 1" >> $TMPH
988 echo "CONFIG_AC3=yes" >> config.mak
990 if test "$a52bin" = "yes" ; then
991 echo "#define CONFIG_A52BIN 1" >> $TMPH
992 echo "CONFIG_A52BIN=yes" >> config.mak
997 if test "$pp" = "yes" ; then
998 echo "#define CONFIG_PP 1" >> $TMPH
999 echo "CONFIG_PP=yes" >> config.mak
1001 if test "$shared_pp" = "yes" ; then
1002 echo "#define SHARED_PP 1" >> $TMPH
1003 echo "SHARED_PP=yes" >> config.mak
1007 # mpeg audio high precision mode
1008 if test "$mpegaudio_hp" = "yes" ; then
1009 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1012 if test "$v4l" = "yes" ; then
1013 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1014 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1017 if test "$dv1394" = "yes" ; then
1018 echo "#define CONFIG_DV1394 1" >> $TMPH
1019 echo "CONFIG_DV1394=yes" >> config.mak
1022 if test "$dlopen" = "yes" ; then
1023 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1026 if test "$dlfcn" = "yes" ; then
1027 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1030 if test "$audio_oss" = "yes" ; then
1031 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1032 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1035 if test "$audio_beos" = "yes" ; then
1036 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1037 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1040 if test "$network" = "yes" ; then
1041 echo "#define CONFIG_NETWORK 1" >> $TMPH
1042 echo "CONFIG_NETWORK=yes" >> config.mak
1045 if test "$zlib" = "yes" ; then
1046 echo "#define CONFIG_ZLIB 1" >> $TMPH
1047 echo "CONFIG_ZLIB=yes" >> config.mak
1050 if test "$mp3lame" = "yes" ; then
1051 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1052 echo "CONFIG_MP3LAME=yes" >> config.mak
1055 if test "$vorbis" = "yes" ; then
1056 echo "#define CONFIG_VORBIS 1" >> $TMPH
1057 echo "CONFIG_VORBIS=yes" >> config.mak
1060 if test "$faad" = "yes" ; then
1061 echo "#define CONFIG_FAAD 1" >> $TMPH
1062 echo "CONFIG_FAAD=yes" >> config.mak
1065 if test "$faadbin" = "yes" ; then
1066 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1067 echo "CONFIG_FAADBIN=yes" >> config.mak
1070 if test "$faac" = "yes" ; then
1071 echo "#define CONFIG_FAAC 1" >> $TMPH
1072 echo "CONFIG_FAAC=yes" >> config.mak
1075 if test "$mingw32" = "yes" ; then
1076 echo "#define CONFIG_WIN32 1" >> $TMPH
1077 echo "CONFIG_WIN32=yes" >> config.mak
1078 echo "#ifndef __MINGW32__" >> $TMPH
1079 echo "#define __MINGW32__ 1" >> $TMPH
1080 echo "#endif" >> $TMPH
1083 if test "$os2" = "yes" ; then
1084 echo "#define CONFIG_OS2 1" >> $TMPH
1085 echo "CONFIG_OS2=yes" >> config.mak
1088 if test "$TARGET_OS" = "SunOS" ; then
1089 echo "#define CONFIG_SUNOS 1" >> $TMPH
1092 if test "$darwin" = "yes"; then
1093 echo "#define CONFIG_DARWIN 1" >> $TMPH
1094 echo "CONFIG_DARWIN=yes" >> config.mak
1097 if test "$_malloc_h" = "yes" ; then
1098 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1100 echo "#undef HAVE_MALLOC_H" >> $TMPH
1103 if test "$_memalign" = "yes" ; then
1104 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1106 echo "#undef HAVE_MEMALIGN" >> $TMPH
1109 if test "$netserver" = "yes" ; then
1110 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1111 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1114 if test "$need_inet_aton" = "yes" ; then
1115 echo "NEED_INET_ATON=yes" >> config.mak
1118 if test "$simpleidct" = "yes" ; then
1119 echo "#define SIMPLE_IDCT 1" >> $TMPH
1122 if test "$ffserver" = "yes" ; then
1123 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1124 echo "CONFIG_FFSERVER=yes" >> config.mak
1127 if test "$ffplay" = "yes" ; then
1128 echo "CONFIG_FFPLAY=yes" >> config.mak
1131 if test "$risky" = "yes" ; then
1132 echo "#define CONFIG_RISKY 1" >> $TMPH
1133 echo "CONFIG_RISKY=yes" >> config.mak
1136 echo "#define restrict $_restrict" >> $TMPH
1138 # build tree in object directory if source path is different from current one
1139 if test "$source_path_used" = "yes" ; then
1140 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1141 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1142 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1143 for dir in $DIRS ; do
1146 for f in $FILES ; do
1147 ln -sf $source_path/$f $f
1150 echo "SRC_PATH=$source_path" >> config.mak
1152 if test "$amr_wb" = "yes" ; then
1153 echo "#define AMR_WB 1" >> $TMPH
1154 echo "AMR_WB=yes" >> config.mak
1156 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1158 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1159 echo "and extracted the source to libavcodec/amrwb_float"
1163 if test "$amr_nb" = "yes" ; then
1164 echo "#define AMR_NB 1" >> $TMPH
1165 echo "AMR_NB=yes" >> config.mak
1167 if test "$amr_nb_fixed" = "yes" ; then
1168 echo "AMR_NB_FIXED=yes" >> config.mak
1169 echo "#define AMR_NB_FIXED 1" >> $TMPH
1170 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1171 echo "REL-5 version 5.1.0 from "
1172 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1173 echo "and extracted src to libavcodec/amr"
1174 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1175 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1178 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1179 echo "REL-5 V5.1.0 from "
1180 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1181 echo "and extracted the source to libavcodec/amr_float"
1187 diff $TMPH config.h >/dev/null 2>&1
1188 if test $? -ne 0 ; then
1189 mv -f $TMPH config.h
1191 echo "config.h is unchanged"
1194 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH