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)
160 LDFLAGS=-Wl,--warn-common
177 prefix="/boot/home/config"
178 # helps building libavcodec
179 CFLAGS="-DPIC -fomit-frame-pointer"
180 # 3 gcc releases known for BeOS, each with ugly bugs
181 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
182 case "$gcc_version" in
183 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
186 *20010315*) echo "BeBits gcc"
187 CFLAGS="$CFLAGS -fno-expensive-optimizations"
191 # disable linux things
197 # no need for libm, but the inet stuff
199 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
200 extralibs="-lbind -lsocket"
214 extralibs="$extralibs -lsocket -lnsl"
221 LDFLAGS="$LDFLAGS -export-dynamic"
227 extralibs="-lpoll -lgnugetopt -lm"
236 SHFLAGS="-dynamiclib"
241 FFSLDFLAGS=-Wl,-bind_at_load
244 # Note: the rest of the mingw32 config is done afterwards as mingw32
245 # can be forced on command line for linux cross compilation
254 test -f /usr/include/inttypes.h || \
255 test -f /usr/local/include/inttypes.h || \
256 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
257 "/usr/include/inttypes.h !!!"
260 LDFLAGS="$LDFLAGS -rdynamic"
263 ranlib="echo ignoring ranlib"
271 ranlib="echo ignoring ranlib"
272 strip="echo ignoring strip"
274 LDFLAGS="-Zomf -Zstack 16384 -s"
293 # From mplayer configure. We need TARGET_OS available
294 # to the Makefile, so it can distinguish between flavors
295 # of AltiVec on PowerPC
296 TARGET_OS=`( uname -s ) 2>&1`
298 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
306 [cC][yY][gG][wW][iI][nN]*)
310 TARGET_OS="$TARGET_OS-UNKNOWN"
315 # XXX: we assume an absolute path is given when launching configure,
316 # except in './configure' case.
317 source_path="`echo $0 | sed -e 's#/configure##'`"
318 source_path_used="yes"
319 if test -z "$source_path" -o "$source_path" = "." ; then
321 source_path_used="no"
326 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
328 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
330 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
332 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
334 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
336 --make=*) make=`echo $opt | cut -d '=' -f 2`
338 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
340 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
342 --extra-libs=*) extralibs=${opt#--extra-libs=}
344 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
346 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
348 --powerpc-perf-enable) powerpc_perf="yes"
350 --disable-mmx) mmx="no"
352 --disable-altivec) altivec="no"
354 --enable-gprof) gprof="yes"
356 --disable-v4l) v4l="no"
358 --disable-audio-oss) audio_oss="no"
360 --disable-audio-beos) audio_beos="no"
362 --disable-dv1394) dv1394="no"
364 --disable-network) network="no"
366 --disable-zlib) zlib="no"
368 --enable-a52) a52="yes"
370 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
372 --enable-pp) pp="yes"
374 --enable-shared-pp) shared_pp="yes"
376 --enable-mp3lame) mp3lame="yes"
378 --enable-vorbis) vorbis="yes"
380 --enable-faad) faad="yes"
382 --enable-faadbin) faadbin="yes"
384 --enable-faac) faac="yes"
386 --disable-vhook) vhook="no"
388 --disable-simple_idct) simpleidct="no"
390 --enable-mingw32) mingw32="yes"
392 --enable-shared) lshared="yes"
394 --disable-debug) debug="no"
396 --disable-opts) optimize="no"
398 --disable-mpegaudio-hp) mpegaudio_hp="no"
400 --disable-ffserver) ffserver="no"
402 --disable-ffplay) ffplay="no"
404 --disable-risky) risky="no"
406 --enable-small) optimize="small"
408 --enable-amr_nb) amr_nb="yes"
410 --enable-amr_nb-fixed) amr_nb_fixed="yes"
412 --enable-sunmlib) sunmlib="yes"
418 if test $mmx = "default"; then
419 if test $cpu = "x86"; then
427 needmdynamicnopic="no"
428 if test $targetos = Darwin; then
429 if test -n "`$cc -v 2>&1 | grep xlc`"; then
430 CFLAGS="-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
432 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
433 case "$gcc_version" in
435 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
438 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
439 if test "$lshared" = no; then
440 needmdynamicnopic="yes"
444 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
445 if test "$lshared" = no; then
446 needmdynamicnopic="yes"
453 # Can only do AltiVec on PowerPC
454 if test $altivec = "default"; then
455 if test $cpu = "powerpc"; then
462 # Add processor-specific flags
464 if test $tune != "generic"; then
466 601|ppc601|PowerPC601)
467 CFLAGS="$CFLAGS -mcpu=601"
468 if test $altivec = "yes"; then
469 echo "WARNING: tuning for PPC601 but altivec enabled !";
473 603*|ppc603*|PowerPC603*)
474 CFLAGS="$CFLAGS -mcpu=603"
475 if test $altivec = "yes"; then
476 echo "WARNING: tuning for PPC603 but altivec enabled !";
480 604*|ppc604*|PowerPC604*)
481 CFLAGS="$CFLAGS -mcpu=604"
482 if test $altivec = "yes"; then
483 echo "WARNING: tuning for PPC604 but altivec enabled !";
487 G3|g3|75*|ppc75*|PowerPC75*)
488 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
489 if test $altivec = "yes"; then
490 echo "WARNING: tuning for PPC75x but altivec enabled !";
494 G4|g4|745*|ppc745*|PowerPC745*)
495 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
496 if test $altivec = "no"; then
497 echo "WARNING: tuning for PPC745x but altivec disabled !";
501 74*|ppc74*|PowerPC74*)
502 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
503 if test $altivec = "no"; then
504 echo "WARNING: tuning for PPC74xx but altivec disabled !";
508 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
509 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
510 if test $altivec = "no"; then
511 echo "WARNING: tuning for PPC970 but altivec disabled !";
516 echo "WARNING: unknown CPU "$tune", ignored"
521 # AltiVec flags: The FSF version of GCC differs from the Apple version
522 if test $cpu = "powerpc"; then
523 if test $altivec = "yes"; then
524 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
525 CFLAGS="$CFLAGS -faltivec"
527 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
532 # See if we have <altivec.h>
535 int main( void ) { return 0; }
539 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
543 # See does our compiler support Motorola AltiVec C API
544 if test $altivec = "yes"; then
545 if test $_altivec_h = "yes"; then
549 vector signed int v1, v2, v3;
557 vector signed int v1, v2, v3;
563 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
566 # Can only do mmi on mips
567 if test $mmi = "default"; then
568 if test $cpu = "mips"; then
575 # See does our compiler support mmi
576 if test $mmi = "yes"; then
579 __asm__ ("lq \$2, 0(\$2)");
583 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
586 if test "$mingw32" = "yes" ; then
597 prefix="/c/Program Files/FFmpeg"
601 cc="${cross_prefix}${cc}"
602 ar="${cross_prefix}${ar}"
603 ranlib="${cross_prefix}${ranlib}"
604 strip="${cross_prefix}${strip}"
606 if test -z "$cross_prefix" ; then
609 # big/little endian test
611 #include <inttypes.h>
612 int main(int argc, char ** argv){
613 volatile uint32_t i=0x01234567;
614 return (*((uint8_t*)(&i))) == 0x67;
618 if $cc -o $TMPE $TMPC 2>/dev/null ; then
619 $TMPE && bigendian="yes"
621 echo big/little test failed
626 # if cross compiling, cannot launch a program, so make a static guess
627 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
636 #include <inttypes.h>
637 int main(int argc, char ** argv){
638 volatile uint_fast64_t i=0x01234567;
643 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
646 # check availability of some header files
650 int main( void ) { return 0; }
655 if $cc -o $TMPE $TMPC 2> /dev/null ; then
658 # check for memalign - atmos
663 string = memalign(64, sizeof(char));
667 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
672 int main( void ) { localtime_r(NULL, NULL); }
676 if $cc -o $TMPE $TMPC 2> /dev/null ; then
680 if test "$zlib" = "yes"; then
681 # check for zlib - mmu_man
685 if (zlibVersion() != ZLIB_VERSION)
686 puts("zlib version differs !!!");
691 $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
692 # $TMPE 2> /dev/null > /dev/null || zlib="no"
693 # XXX: more tests needed - runtime test
695 if test "$zlib" = "yes"; then
696 extralibs="$extralibs -lz"
699 # test for lrintf in math.h
701 #define _ISOC9X_SOURCE 1
703 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
707 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
709 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
713 for restrict_keyword in restrict __restrict__ __restrict; do
714 echo "void foo(char * $restrict_keyword p);" > $TMPC
715 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
716 _restrict=$restrict_keyword
721 # test gcc version to see if vector builtins can be used
722 # currently only used on i386 for MMX builtins
725 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
728 #error no vector builtins
734 if $cc -o $TMPO $TMPC 2> /dev/null ; then
738 # dlopen/dlfcn.h probing
742 int main( void ) { return (int) dlopen("foo", 0); }
747 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
752 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
759 int main( void ) { return (int) dlopen("foo", 0); }
762 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
766 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
771 if test "$vhook" = "default" ; then
775 ##########################################
779 #include <X11/Xlib.h>
781 int main( void ) { return (int) imlib_load_font("foo"); }
785 if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
789 ##########################################
793 #include <ft2build.h>
794 int main( void ) { return (int) FT_Init_FreeType(0); }
798 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
799 if test "`which freetype-config`" != ""; then
800 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
806 ##########################################
811 #undef main /* We don't want SDL to override our main() */
812 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
817 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
818 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
819 if test "$_sdlversion" -lt 121 ; then
826 case "`$cc -v 2>&1 | grep version`" in
828 CFLAGS="-Wall $CFLAGS"
834 if test "$sdl" = "no" ; then
838 if test "$debug" = "yes"; then
842 if test "$optimize" = "small"; then
843 # CFLAGS=${CFLAGS//-O3/-Os}
847 if test "$optimize" = "yes"; then
848 if test -n "`$cc -v 2>&1 | grep xlc`"; then
850 LDFLAGS="$LDFLAGS -O5"
856 if test x"$bindir" = x""; then
857 bindir="${prefix}/bin"
860 if test x"$mandir" = x""; then
861 mandir="${prefix}/man"
864 echo "Install prefix $prefix"
865 echo "Source path $source_path"
866 echo "C compiler $cc"
868 echo "CPU $cpu ($tune)"
869 echo "Big Endian $bigendian"
870 echo "broken inttypes.h $emu_fast_int"
871 if test $cpu = "x86"; then
872 echo "MMX enabled $mmx"
873 echo "Vector Builtins $builtin_vector"
875 if test $cpu = "mips"; then
876 echo "MMI enabled $mmi"
878 if test $cpu = "powerpc"; then
879 echo "AltiVec enabled $altivec"
881 echo "gprof enabled $gprof"
882 echo "zlib enabled $zlib"
883 echo "mp3lame enabled $mp3lame"
884 echo "vorbis enabled $vorbis"
885 echo "faad enabled $faad"
886 echo "faadbin enabled $faadbin"
887 echo "faac enabled $faac"
888 echo "a52 support $a52"
889 echo "a52 dlopened $a52bin"
890 echo "pp support $pp"
891 echo "debug symbols $debug"
892 echo "optimize $optimize"
893 echo "shared pp $shared_pp"
894 echo "Video hooking $vhook"
895 echo "SDL support $sdl"
896 if test $sdl_too_old = "yes"; then
897 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
899 echo "risky / patent encumbered codecs $risky"
901 if test "$vhook" = "yes" ; then
902 echo "Imlib2 support $imlib2"
903 echo "freetype support $freetype2"
905 echo "Sun medialib support" $sunmlib
906 echo "AMR-NB float support" $amr_nb
907 echo "AMR-NB fixed support" $amr_nb_fixed
908 echo "AMR-WB float support" $amr_wb
910 echo "Creating config.mak and config.h"
912 echo "# Automatically generated by configure - do not modify" > config.mak
913 echo "/* Automatically generated by configure - do not modify */" > $TMPH
915 echo "prefix=$prefix" >> config.mak
916 echo "bindir=$bindir" >> config.mak
917 echo "mandir=$mandir" >> config.mak
918 echo "MAKE=$make" >> config.mak
919 echo "CC=$cc" >> config.mak
920 echo "AR=$ar" >> config.mak
921 echo "RANLIB=$ranlib" >> config.mak
922 echo "STRIP=$strip" >> config.mak
924 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
925 # shared modules on OS/X (vhook/Makefile).
927 if test "$needmdynamicnopic" = yes; then
928 CFLAGS="$CFLAGS -mdynamic-no-pic"
931 echo "OPTFLAGS=$CFLAGS" >> config.mak
932 echo "SHCFLAGS=$SHCFLAGS">>config.mak
933 echo "LDFLAGS=$LDFLAGS" >> config.mak
934 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
935 echo "SHFLAGS=$SHFLAGS" >> config.mak
936 echo "LIBPREF=$LIBPREF" >> config.mak
937 echo "LIBSUF=$LIBSUF" >> config.mak
938 echo "SLIBPREF=$SLIBPREF" >> config.mak
939 echo "SLIBSUF=$SLIBSUF" >> config.mak
940 echo "EXESUF=$EXESUF" >> config.mak
941 echo "TARGET_OS=$TARGET_OS" >> config.mak
942 if test "$cpu" = "x86" ; then
943 echo "TARGET_ARCH_X86=yes" >> config.mak
944 echo "#define ARCH_X86 1" >> $TMPH
945 elif test "$cpu" = "armv4l" ; then
946 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
947 echo "#define ARCH_ARMV4L 1" >> $TMPH
948 elif test "$cpu" = "alpha" ; then
949 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
950 echo "#define ARCH_ALPHA 1" >> $TMPH
951 elif test "$cpu" = "sparc64" ; then
952 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
953 echo "#define ARCH_SPARC64 1" >> $TMPH
954 elif test "$cpu" = "powerpc" ; then
955 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
956 echo "#define ARCH_POWERPC 1" >> $TMPH
957 if test "$powerpc_perf" = "yes"; then
958 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
960 elif test "$cpu" = "mips" ; then
961 echo "TARGET_ARCH_MIPS=yes" >> config.mak
962 echo "#define ARCH_MIPS 1" >> $TMPH
963 elif test "$cpu" = "sh4" ; then
964 echo "TARGET_ARCH_SH4=yes" >> config.mak
965 echo "#define ARCH_SH4 1" >> $TMPH
967 echo "#define TUNECPU $TUNECPU" >> $TMPH
968 if test "$bigendian" = "yes" ; then
969 echo "WORDS_BIGENDIAN=yes" >> config.mak
970 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
972 if test "$emu_fast_int" = "yes" ; then
973 echo "#define EMULATE_FAST_INT 1" >> $TMPH
975 if test "$mmx" = "yes" ; then
976 echo "TARGET_MMX=yes" >> config.mak
977 echo "#define HAVE_MMX 1" >> $TMPH
978 echo "#define __CPU__ 586" >> $TMPH
980 if test "$builtin_vector" = "yes" ; then
981 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
982 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
984 if test "$mmi" = "yes" ; then
985 echo "TARGET_MMI=yes" >> config.mak
986 echo "#define HAVE_MMI 1" >> $TMPH
988 if test "$altivec" = "yes" ; then
989 echo "TARGET_ALTIVEC=yes" >> config.mak
990 echo "#define HAVE_ALTIVEC 1" >> $TMPH
991 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
992 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
993 if test "$_altivec_h" = "yes" ; then
994 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
996 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
999 if test "$gprof" = "yes" ; then
1000 echo "TARGET_GPROF=yes" >> config.mak
1001 echo "#define HAVE_GPROF 1" >> $TMPH
1003 if test "$localtime_r" = "yes" ; then
1004 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1006 if test "$imlib2" = "yes" ; then
1007 echo "HAVE_IMLIB2=yes" >> config.mak
1009 if test "$freetype2" = "yes" ; then
1010 echo "HAVE_FREETYPE2=yes" >> config.mak
1012 if test "$sunmlib" = "yes" ; then
1013 echo "HAVE_MLIB=yes" >> config.mak
1014 echo "#define HAVE_MLIB 1" >> $TMPH
1015 extralibs="$extralibs -lmlib"
1017 if test "$sdl" = "yes" ; then
1018 echo "CONFIG_SDL=yes" >> config.mak
1019 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1020 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1022 if test "$have_lrintf" = "yes" ; then
1023 echo "#define HAVE_LRINTF 1" >> $TMPH
1025 if test "$vhook" = "yes" ; then
1026 echo "BUILD_VHOOK=yes" >> config.mak
1027 echo "#define HAVE_VHOOK 1" >> $TMPH
1028 extralibs="$extralibs $ldl"
1030 if test "$lshared" = "yes" ; then
1031 echo "BUILD_SHARED=yes" >> config.mak
1032 echo "PIC=-fPIC" >> config.mak
1034 echo "EXTRALIBS=$extralibs" >> config.mak
1035 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1037 echo "VERSION=$version" >>config.mak
1038 # if you do not want to use encoders, disable that.
1039 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1040 echo "CONFIG_ENCODERS=yes" >> config.mak
1042 # if you do not want to use decoders, disable that.
1043 echo "#define CONFIG_DECODERS 1" >> $TMPH
1044 echo "CONFIG_DECODERS=yes" >> config.mak
1047 if test "$a52" = "yes" ; then
1048 echo "#define CONFIG_AC3 1" >> $TMPH
1049 echo "CONFIG_AC3=yes" >> config.mak
1051 if test "$a52bin" = "yes" ; then
1052 echo "#define CONFIG_A52BIN 1" >> $TMPH
1053 echo "CONFIG_A52BIN=yes" >> config.mak
1058 if test "$pp" = "yes" ; then
1059 echo "#define CONFIG_PP 1" >> $TMPH
1060 echo "CONFIG_PP=yes" >> config.mak
1062 if test "$shared_pp" = "yes" ; then
1063 echo "#define SHARED_PP 1" >> $TMPH
1064 echo "SHARED_PP=yes" >> config.mak
1068 # mpeg audio high precision mode
1069 if test "$mpegaudio_hp" = "yes" ; then
1070 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1073 if test "$v4l" = "yes" ; then
1074 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1075 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1078 if test "$dv1394" = "yes" ; then
1079 echo "#define CONFIG_DV1394 1" >> $TMPH
1080 echo "CONFIG_DV1394=yes" >> config.mak
1083 if test "$dlopen" = "yes" ; then
1084 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1087 if test "$dlfcn" = "yes" ; then
1088 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1091 if test "$audio_oss" = "yes" ; then
1092 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1093 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1096 if test "$audio_beos" = "yes" ; then
1097 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1098 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1101 if test "$network" = "yes" ; then
1102 echo "#define CONFIG_NETWORK 1" >> $TMPH
1103 echo "CONFIG_NETWORK=yes" >> config.mak
1106 if test "$zlib" = "yes" ; then
1107 echo "#define CONFIG_ZLIB 1" >> $TMPH
1108 echo "CONFIG_ZLIB=yes" >> config.mak
1111 if test "$mp3lame" = "yes" ; then
1112 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1113 echo "CONFIG_MP3LAME=yes" >> config.mak
1116 if test "$vorbis" = "yes" ; then
1117 echo "#define CONFIG_VORBIS 1" >> $TMPH
1118 echo "CONFIG_VORBIS=yes" >> config.mak
1121 if test "$faad" = "yes" ; then
1122 echo "#define CONFIG_FAAD 1" >> $TMPH
1123 echo "CONFIG_FAAD=yes" >> config.mak
1126 if test "$faadbin" = "yes" ; then
1127 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1128 echo "CONFIG_FAADBIN=yes" >> config.mak
1131 if test "$faac" = "yes" ; then
1132 echo "#define CONFIG_FAAC 1" >> $TMPH
1133 echo "CONFIG_FAAC=yes" >> config.mak
1136 if test "$mingw32" = "yes" ; then
1137 echo "#define CONFIG_WIN32 1" >> $TMPH
1138 echo "CONFIG_WIN32=yes" >> config.mak
1139 echo "#ifndef __MINGW32__" >> $TMPH
1140 echo "#define __MINGW32__ 1" >> $TMPH
1141 echo "#endif" >> $TMPH
1144 if test "$os2" = "yes" ; then
1145 echo "#define CONFIG_OS2 1" >> $TMPH
1146 echo "CONFIG_OS2=yes" >> config.mak
1149 if test "$TARGET_OS" = "SunOS" ; then
1150 echo "#define CONFIG_SUNOS 1" >> $TMPH
1153 if test "$darwin" = "yes"; then
1154 echo "#define CONFIG_DARWIN 1" >> $TMPH
1155 echo "CONFIG_DARWIN=yes" >> config.mak
1158 if test "$_malloc_h" = "yes" ; then
1159 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1161 echo "#undef HAVE_MALLOC_H" >> $TMPH
1164 if test "$_memalign" = "yes" ; then
1165 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1167 echo "#undef HAVE_MEMALIGN" >> $TMPH
1170 if test "$netserver" = "yes" ; then
1171 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1172 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1175 if test "$need_inet_aton" = "yes" ; then
1176 echo "NEED_INET_ATON=yes" >> config.mak
1179 if test "$simpleidct" = "yes" ; then
1180 echo "#define SIMPLE_IDCT 1" >> $TMPH
1183 if test "$ffserver" = "yes" ; then
1184 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1185 echo "CONFIG_FFSERVER=yes" >> config.mak
1188 if test "$ffplay" = "yes" ; then
1189 echo "CONFIG_FFPLAY=yes" >> config.mak
1192 if test "$risky" = "yes" ; then
1193 echo "#define CONFIG_RISKY 1" >> $TMPH
1194 echo "CONFIG_RISKY=yes" >> config.mak
1197 echo "#define restrict $_restrict" >> $TMPH
1199 # build tree in object directory if source path is different from current one
1200 if test "$source_path_used" = "yes" ; then
1201 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1202 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1203 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1204 for dir in $DIRS ; do
1207 for f in $FILES ; do
1208 ln -sf $source_path/$f $f
1211 echo "SRC_PATH=$source_path" >> config.mak
1213 if test "$amr_wb" = "yes" ; then
1214 echo "#define AMR_WB 1" >> $TMPH
1215 echo "AMR_WB=yes" >> config.mak
1217 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1219 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1220 echo "and extracted the source to libavcodec/amrwb_float"
1224 if test "$amr_nb" = "yes" ; then
1225 echo "#define AMR_NB 1" >> $TMPH
1226 echo "AMR_NB=yes" >> config.mak
1228 if test "$amr_nb_fixed" = "yes" ; then
1229 echo "AMR_NB_FIXED=yes" >> config.mak
1230 echo "#define AMR_NB_FIXED 1" >> $TMPH
1231 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1232 echo "REL-5 version 5.1.0 from "
1233 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1234 echo "and extracted src to libavcodec/amr"
1235 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1236 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1239 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1240 echo "REL-5 V5.1.0 from "
1241 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1242 echo "and extracted the source to libavcodec/amr_float"
1248 diff $TMPH config.h >/dev/null 2>&1
1249 if test $? -ne 0 ; then
1250 mv -f $TMPH config.h
1252 echo "config.h is unchanged"
1255 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH