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-amr_wb enable amr_wb float audio codec"
31 echo " --enable-sunmlib use Sun medialib [default=no]"
32 echo " --enable-pthreads use pthreads [default=no]"
34 echo "Advanced options (experts only):"
35 echo " --source-path=PATH path of source code [$source_path]"
36 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
37 echo " --cc=CC use C compiler CC [$cc]"
38 echo " --make=MAKE use specified make [$make]"
39 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
40 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
41 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
42 echo " --cpu=CPU force cpu to CPU [$cpu]"
43 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
44 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
45 echo " --disable-mmx disable mmx usage"
46 echo " --disable-altivec disable AltiVec usage"
47 echo " --disable-audio-oss disable OSS audio support [default=no]"
48 echo " --disable-audio-beos disable BeOS audio support [default=no]"
49 echo " --disable-v4l disable video4linux grabbing [default=no]"
50 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
51 echo " --disable-network disable network support [default=no]"
52 echo " --disable-zlib disable zlib [default=no]"
53 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
54 echo " --disable-vhook disable video hooking support"
55 echo " --enable-gprof enable profiling with gprof [$gprof]"
56 echo " --disable-debug disable debugging symbols"
57 echo " --disable-opts disable compiler optimizations"
58 echo " --disable-mpegaudio-hp faster (but less accurate)"
59 echo " mpegaudio decoding [default=no]"
60 echo " --disable-ffserver disable ffserver build"
61 echo " --disable-ffplay disable ffplay build"
62 echo " --disable-risky disables patent encumbered codecs"
63 echo " --enable-small optimize for size instead of speed"
65 echo "NOTE: The object files are build at the place where configure is launched"
69 # set temporary file name
70 if test ! -z "$TMPDIR" ; then
72 elif test ! -z "$TEMPDIR" ; then
78 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
79 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
80 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
81 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
82 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
101 i386|i486|i586|i686|i86pc|BePC)
104 # armv4l is a subset of armv5tel
111 "Power Macintosh"|ppc)
163 LDFLAGS=-Wl,--warn-common
181 prefix="/boot/home/config"
182 # helps building libavcodec
183 CFLAGS="-DPIC -fomit-frame-pointer"
184 # 3 gcc releases known for BeOS, each with ugly bugs
185 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
186 case "$gcc_version" in
187 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
190 *20010315*) echo "BeBits gcc"
191 CFLAGS="$CFLAGS -fno-expensive-optimizations"
195 # disable linux things
201 # no need for libm, but the inet stuff
203 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
204 extralibs="-lbind -lsocket"
218 extralibs="$extralibs -lsocket -lnsl"
225 LDFLAGS="$LDFLAGS -export-dynamic"
231 extralibs="-lpoll -lgnugetopt -lm"
240 SHFLAGS="-dynamiclib"
245 FFSLDFLAGS=-Wl,-bind_at_load
248 # Note: the rest of the mingw32 config is done afterwards as mingw32
249 # can be forced on command line for linux cross compilation
258 test -f /usr/include/inttypes.h || \
259 test -f /usr/local/include/inttypes.h || \
260 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
261 "/usr/include/inttypes.h !!!"
264 LDFLAGS="$LDFLAGS -rdynamic"
267 ranlib="echo ignoring ranlib"
275 ranlib="echo ignoring ranlib"
276 strip="echo ignoring strip"
278 LDFLAGS="-Zomf -Zstack 16384 -s"
297 # From mplayer configure. We need TARGET_OS available
298 # to the Makefile, so it can distinguish between flavors
299 # of AltiVec on PowerPC
300 TARGET_OS=`( uname -s ) 2>&1`
302 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
310 [cC][yY][gG][wW][iI][nN]*)
314 TARGET_OS="$TARGET_OS-UNKNOWN"
319 # XXX: we assume an absolute path is given when launching configure,
320 # except in './configure' case.
321 source_path="`echo $0 | sed -e 's#/configure##'`"
322 source_path_used="yes"
323 if test -z "$source_path" -o "$source_path" = "." ; then
325 source_path_used="no"
330 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
332 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
334 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
336 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
338 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
340 --make=*) make=`echo $opt | cut -d '=' -f 2`
342 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
344 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
346 --extra-libs=*) extralibs=${opt#--extra-libs=}
348 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
350 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
352 --powerpc-perf-enable) powerpc_perf="yes"
354 --disable-mmx) mmx="no"
356 --disable-altivec) altivec="no"
358 --enable-gprof) gprof="yes"
360 --disable-v4l) v4l="no"
362 --disable-audio-oss) audio_oss="no"
364 --disable-audio-beos) audio_beos="no"
366 --disable-dv1394) dv1394="no"
368 --disable-network) network="no"
370 --disable-zlib) zlib="no"
372 --enable-a52) a52="yes"
374 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
376 --enable-pp) pp="yes"
378 --enable-shared-pp) shared_pp="yes"
380 --enable-mp3lame) mp3lame="yes"
382 --enable-vorbis) vorbis="yes"
384 --enable-faad) faad="yes"
386 --enable-faadbin) faadbin="yes"
388 --enable-faac) faac="yes"
390 --disable-vhook) vhook="no"
392 --disable-simple_idct) simpleidct="no"
394 --enable-mingw32) mingw32="yes"
396 --enable-shared) lshared="yes"
398 --disable-debug) debug="no"
400 --disable-opts) optimize="no"
402 --disable-mpegaudio-hp) mpegaudio_hp="no"
404 --disable-ffserver) ffserver="no"
406 --disable-ffplay) ffplay="no"
408 --disable-risky) risky="no"
410 --enable-small) optimize="small"
412 --enable-amr_nb) amr_nb="yes"
414 --enable-amr_nb-fixed) amr_nb_fixed="yes"
416 --enable-amr_wb) amr_wb="yes"
418 --enable-sunmlib) sunmlib="yes"
420 --enable-pthreads) pthreads="yes"
426 if test $mmx = "default"; then
427 if test $cpu = "x86"; then
435 needmdynamicnopic="no"
436 if test $targetos = Darwin; then
437 if test -n "`$cc -v 2>&1 | grep xlc`"; then
438 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
440 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
441 case "$gcc_version" in
443 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
446 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
447 if test "$lshared" = no; then
448 needmdynamicnopic="yes"
452 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
453 if test "$lshared" = no; then
454 needmdynamicnopic="yes"
461 # Can only do AltiVec on PowerPC
462 if test $altivec = "default"; then
463 if test $cpu = "powerpc"; then
470 # Add processor-specific flags
472 if test $tune != "generic"; then
474 601|ppc601|PowerPC601)
475 CFLAGS="$CFLAGS -mcpu=601"
476 if test $altivec = "yes"; then
477 echo "WARNING: tuning for PPC601 but altivec enabled !";
481 603*|ppc603*|PowerPC603*)
482 CFLAGS="$CFLAGS -mcpu=603"
483 if test $altivec = "yes"; then
484 echo "WARNING: tuning for PPC603 but altivec enabled !";
488 604*|ppc604*|PowerPC604*)
489 CFLAGS="$CFLAGS -mcpu=604"
490 if test $altivec = "yes"; then
491 echo "WARNING: tuning for PPC604 but altivec enabled !";
495 G3|g3|75*|ppc75*|PowerPC75*)
496 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
497 if test $altivec = "yes"; then
498 echo "WARNING: tuning for PPC75x but altivec enabled !";
502 G4|g4|745*|ppc745*|PowerPC745*)
503 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
504 if test $altivec = "no"; then
505 echo "WARNING: tuning for PPC745x but altivec disabled !";
509 74*|ppc74*|PowerPC74*)
510 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
511 if test $altivec = "no"; then
512 echo "WARNING: tuning for PPC74xx but altivec disabled !";
516 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
517 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
518 if test $altivec = "no"; then
519 echo "WARNING: tuning for PPC970 but altivec disabled !";
524 echo "WARNING: unknown CPU "$tune", ignored"
529 # AltiVec flags: The FSF version of GCC differs from the Apple version
530 if test $cpu = "powerpc"; then
531 if test $altivec = "yes"; then
532 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
533 CFLAGS="$CFLAGS -faltivec"
535 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
540 # See if we have <altivec.h>
543 int main( void ) { return 0; }
547 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
551 # See does our compiler support Motorola AltiVec C API
552 if test $altivec = "yes"; then
553 if test $_altivec_h = "yes"; then
557 vector signed int v1, v2, v3;
565 vector signed int v1, v2, v3;
571 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
574 # Can only do mmi on mips
575 if test $mmi = "default"; then
576 if test $cpu = "mips"; then
583 # See does our compiler support mmi
584 if test $mmi = "yes"; then
587 __asm__ ("lq \$2, 0(\$2)");
591 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
594 if test "$mingw32" = "yes" ; then
605 prefix="/c/Program Files/FFmpeg"
609 cc="${cross_prefix}${cc}"
610 ar="${cross_prefix}${ar}"
611 ranlib="${cross_prefix}${ranlib}"
612 strip="${cross_prefix}${strip}"
614 if test -z "$cross_prefix" ; then
617 # big/little endian test
619 #include <inttypes.h>
620 int main(int argc, char ** argv){
621 volatile uint32_t i=0x01234567;
622 return (*((uint8_t*)(&i))) == 0x67;
626 if $cc -o $TMPE $TMPC 2>/dev/null ; then
627 $TMPE && bigendian="yes"
629 echo big/little test failed
634 # if cross compiling, cannot launch a program, so make a static guess
635 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
644 #include <inttypes.h>
645 int main(int argc, char ** argv){
650 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
655 #include <inttypes.h>
656 int main(int argc, char ** argv){
657 volatile uint_fast64_t i=0x01234567;
662 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
665 # check availability of some header files
669 int main( void ) { return 0; }
674 if $cc -o $TMPE $TMPC 2> /dev/null ; then
677 # check for memalign - atmos
682 string = memalign(64, sizeof(char));
686 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
691 int main( void ) { localtime_r(NULL, NULL); }
695 if $cc -o $TMPE $TMPC 2> /dev/null ; then
699 if test "$zlib" = "yes"; then
700 # check for zlib - mmu_man
704 if (zlibVersion() != ZLIB_VERSION)
705 puts("zlib version differs !!!");
710 $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
711 # $TMPE 2> /dev/null > /dev/null || zlib="no"
712 # XXX: more tests needed - runtime test
714 if test "$zlib" = "yes"; then
715 extralibs="$extralibs -lz"
718 # test for lrintf in math.h
720 #define _ISOC9X_SOURCE 1
722 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
726 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
728 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
732 for restrict_keyword in restrict __restrict__ __restrict; do
733 echo "void foo(char * $restrict_keyword p);" > $TMPC
734 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
735 _restrict=$restrict_keyword
740 # test gcc version to see if vector builtins can be used
741 # currently only used on i386 for MMX builtins
744 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
747 #error no vector builtins
753 if $cc -o $TMPO $TMPC 2> /dev/null ; then
757 # dlopen/dlfcn.h probing
761 int main( void ) { return (int) dlopen("foo", 0); }
766 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
771 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
778 int main( void ) { return (int) dlopen("foo", 0); }
781 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
785 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
790 if test "$vhook" = "default" ; then
794 ##########################################
798 #include <X11/Xlib.h>
800 int main( void ) { return (int) imlib_load_font("foo"); }
804 if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
808 ##########################################
812 #include <ft2build.h>
813 int main( void ) { return (int) FT_Init_FreeType(0); }
817 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
818 if test "`which freetype-config`" != ""; then
819 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
825 ##########################################
830 #undef main /* We don't want SDL to override our main() */
831 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
836 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
837 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
838 if test "$_sdlversion" -lt 121 ; then
845 case "`$cc -v 2>&1 | grep version`" in
847 CFLAGS="-Wall $CFLAGS"
853 if test "$sdl" = "no" ; then
857 if test "$debug" = "yes"; then
861 if test "$optimize" = "small"; then
862 # CFLAGS=${CFLAGS//-O3/-Os}
866 if test "$optimize" = "yes"; then
867 if test -n "`$cc -v 2>&1 | grep xlc`"; then
869 LDFLAGS="$LDFLAGS -O5"
875 if test x"$bindir" = x""; then
876 bindir="${prefix}/bin"
879 if test x"$mandir" = x""; then
880 mandir="${prefix}/man"
883 echo "Install prefix $prefix"
884 echo "Source path $source_path"
885 echo "C compiler $cc"
887 echo "CPU $cpu ($tune)"
888 echo "Big Endian $bigendian"
889 echo "inttypes.h $inttypes"
890 echo "broken inttypes.h $emu_fast_int"
891 if test $cpu = "x86"; then
892 echo "MMX enabled $mmx"
893 echo "Vector Builtins $builtin_vector"
895 if test $cpu = "mips"; then
896 echo "MMI enabled $mmi"
898 if test $cpu = "powerpc"; then
899 echo "AltiVec enabled $altivec"
901 echo "gprof enabled $gprof"
902 echo "zlib enabled $zlib"
903 echo "mp3lame enabled $mp3lame"
904 echo "vorbis enabled $vorbis"
905 echo "faad enabled $faad"
906 echo "faadbin enabled $faadbin"
907 echo "faac enabled $faac"
908 echo "a52 support $a52"
909 echo "a52 dlopened $a52bin"
910 echo "pp support $pp"
911 echo "debug symbols $debug"
912 echo "optimize $optimize"
913 echo "shared pp $shared_pp"
914 echo "Video hooking $vhook"
915 echo "SDL support $sdl"
916 if test $sdl_too_old = "yes"; then
917 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
919 echo "risky / patent encumbered codecs $risky"
921 if test "$vhook" = "yes" ; then
922 echo "Imlib2 support $imlib2"
923 echo "freetype support $freetype2"
925 echo "Sun medialib support" $sunmlib
926 echo "pthreads support" $pthreads
927 echo "AMR-NB float support" $amr_nb
928 echo "AMR-NB fixed support" $amr_nb_fixed
929 echo "AMR-WB float support" $amr_wb
931 echo "Creating config.mak and config.h"
933 echo "# Automatically generated by configure - do not modify" > config.mak
934 echo "/* Automatically generated by configure - do not modify */" > $TMPH
936 echo "prefix=$prefix" >> config.mak
937 echo "bindir=$bindir" >> config.mak
938 echo "mandir=$mandir" >> config.mak
939 echo "MAKE=$make" >> config.mak
940 echo "CC=$cc" >> config.mak
941 echo "AR=$ar" >> config.mak
942 echo "RANLIB=$ranlib" >> config.mak
943 echo "STRIP=$strip" >> config.mak
945 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
946 # shared modules on OS/X (vhook/Makefile).
948 if test "$needmdynamicnopic" = yes; then
949 CFLAGS="$CFLAGS -mdynamic-no-pic"
952 echo "OPTFLAGS=$CFLAGS" >> config.mak
953 echo "SHCFLAGS=$SHCFLAGS">>config.mak
954 echo "LDFLAGS=$LDFLAGS" >> config.mak
955 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
956 echo "SHFLAGS=$SHFLAGS" >> config.mak
957 echo "LIBPREF=$LIBPREF" >> config.mak
958 echo "LIBSUF=$LIBSUF" >> config.mak
959 echo "SLIBPREF=$SLIBPREF" >> config.mak
960 echo "SLIBSUF=$SLIBSUF" >> config.mak
961 echo "EXESUF=$EXESUF" >> config.mak
962 echo "TARGET_OS=$TARGET_OS" >> config.mak
963 if test "$cpu" = "x86" ; then
964 echo "TARGET_ARCH_X86=yes" >> config.mak
965 echo "#define ARCH_X86 1" >> $TMPH
966 elif test "$cpu" = "armv4l" ; then
967 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
968 echo "#define ARCH_ARMV4L 1" >> $TMPH
969 elif test "$cpu" = "alpha" ; then
970 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
971 echo "#define ARCH_ALPHA 1" >> $TMPH
972 elif test "$cpu" = "sparc64" ; then
973 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
974 echo "#define ARCH_SPARC64 1" >> $TMPH
975 elif test "$cpu" = "powerpc" ; then
976 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
977 echo "#define ARCH_POWERPC 1" >> $TMPH
978 if test "$powerpc_perf" = "yes"; then
979 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
981 elif test "$cpu" = "mips" ; then
982 echo "TARGET_ARCH_MIPS=yes" >> config.mak
983 echo "#define ARCH_MIPS 1" >> $TMPH
984 elif test "$cpu" = "sh4" ; then
985 echo "TARGET_ARCH_SH4=yes" >> config.mak
986 echo "#define ARCH_SH4 1" >> $TMPH
988 echo "#define TUNECPU $TUNECPU" >> $TMPH
989 if test "$bigendian" = "yes" ; then
990 echo "WORDS_BIGENDIAN=yes" >> config.mak
991 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
993 if test "$inttypes" != "yes" ; then
994 echo "#define EMULATE_INTTYPES 1" >> $TMPH
996 if test "$emu_fast_int" = "yes" ; then
997 echo "#define EMULATE_FAST_INT 1" >> $TMPH
999 if test "$mmx" = "yes" ; then
1000 echo "TARGET_MMX=yes" >> config.mak
1001 echo "#define HAVE_MMX 1" >> $TMPH
1002 echo "#define __CPU__ 586" >> $TMPH
1004 if test "$builtin_vector" = "yes" ; then
1005 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1006 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1008 if test "$mmi" = "yes" ; then
1009 echo "TARGET_MMI=yes" >> config.mak
1010 echo "#define HAVE_MMI 1" >> $TMPH
1012 if test "$altivec" = "yes" ; then
1013 echo "TARGET_ALTIVEC=yes" >> config.mak
1014 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1015 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1016 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1017 if test "$_altivec_h" = "yes" ; then
1018 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1020 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1023 if test "$gprof" = "yes" ; then
1024 echo "TARGET_GPROF=yes" >> config.mak
1025 echo "#define HAVE_GPROF 1" >> $TMPH
1027 if test "$localtime_r" = "yes" ; then
1028 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1030 if test "$imlib2" = "yes" ; then
1031 echo "HAVE_IMLIB2=yes" >> config.mak
1033 if test "$freetype2" = "yes" ; then
1034 echo "HAVE_FREETYPE2=yes" >> config.mak
1036 if test "$sunmlib" = "yes" ; then
1037 echo "HAVE_MLIB=yes" >> config.mak
1038 echo "#define HAVE_MLIB 1" >> $TMPH
1039 extralibs="$extralibs -lmlib"
1041 if test "$pthreads" = "yes" ; then
1042 echo "HAVE_PTHREADS=yes" >> config.mak
1043 echo "#define HAVE_PTHREADS 1" >> $TMPH
1044 extralibs="$extralibs -lpthread"
1046 if test "$sdl" = "yes" ; then
1047 echo "CONFIG_SDL=yes" >> config.mak
1048 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1049 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1051 if test "$have_lrintf" = "yes" ; then
1052 echo "#define HAVE_LRINTF 1" >> $TMPH
1054 if test "$vhook" = "yes" ; then
1055 echo "BUILD_VHOOK=yes" >> config.mak
1056 echo "#define HAVE_VHOOK 1" >> $TMPH
1057 extralibs="$extralibs $ldl"
1059 if test "$lshared" = "yes" ; then
1060 echo "BUILD_SHARED=yes" >> config.mak
1061 echo "PIC=-fPIC" >> config.mak
1063 echo "EXTRALIBS=$extralibs" >> config.mak
1064 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1066 echo "VERSION=$version" >>config.mak
1067 # if you do not want to use encoders, disable that.
1068 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1069 echo "CONFIG_ENCODERS=yes" >> config.mak
1071 # if you do not want to use decoders, disable that.
1072 echo "#define CONFIG_DECODERS 1" >> $TMPH
1073 echo "CONFIG_DECODERS=yes" >> config.mak
1076 if test "$a52" = "yes" ; then
1077 echo "#define CONFIG_AC3 1" >> $TMPH
1078 echo "CONFIG_AC3=yes" >> config.mak
1080 if test "$a52bin" = "yes" ; then
1081 echo "#define CONFIG_A52BIN 1" >> $TMPH
1082 echo "CONFIG_A52BIN=yes" >> config.mak
1087 if test "$pp" = "yes" ; then
1088 echo "#define CONFIG_PP 1" >> $TMPH
1089 echo "CONFIG_PP=yes" >> config.mak
1091 if test "$shared_pp" = "yes" ; then
1092 echo "#define SHARED_PP 1" >> $TMPH
1093 echo "SHARED_PP=yes" >> config.mak
1097 # mpeg audio high precision mode
1098 if test "$mpegaudio_hp" = "yes" ; then
1099 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1102 if test "$v4l" = "yes" ; then
1103 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1104 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1107 if test "$dv1394" = "yes" ; then
1108 echo "#define CONFIG_DV1394 1" >> $TMPH
1109 echo "CONFIG_DV1394=yes" >> config.mak
1112 if test "$dlopen" = "yes" ; then
1113 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1116 if test "$dlfcn" = "yes" ; then
1117 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1120 if test "$audio_oss" = "yes" ; then
1121 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1122 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1125 if test "$audio_beos" = "yes" ; then
1126 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1127 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1130 if test "$network" = "yes" ; then
1131 echo "#define CONFIG_NETWORK 1" >> $TMPH
1132 echo "CONFIG_NETWORK=yes" >> config.mak
1135 if test "$zlib" = "yes" ; then
1136 echo "#define CONFIG_ZLIB 1" >> $TMPH
1137 echo "CONFIG_ZLIB=yes" >> config.mak
1140 if test "$mp3lame" = "yes" ; then
1141 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1142 echo "CONFIG_MP3LAME=yes" >> config.mak
1145 if test "$vorbis" = "yes" ; then
1146 echo "#define CONFIG_VORBIS 1" >> $TMPH
1147 echo "CONFIG_VORBIS=yes" >> config.mak
1150 if test "$faad" = "yes" ; then
1151 echo "#define CONFIG_FAAD 1" >> $TMPH
1152 echo "CONFIG_FAAD=yes" >> config.mak
1155 if test "$faadbin" = "yes" ; then
1156 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1157 echo "CONFIG_FAADBIN=yes" >> config.mak
1160 if test "$faac" = "yes" ; then
1161 echo "#define CONFIG_FAAC 1" >> $TMPH
1162 echo "CONFIG_FAAC=yes" >> config.mak
1165 if test "$mingw32" = "yes" ; then
1166 echo "#define CONFIG_WIN32 1" >> $TMPH
1167 echo "CONFIG_WIN32=yes" >> config.mak
1168 echo "HAVE_W32THREADS=yes" >> config.mak
1169 echo "#define HAVE_W32THREADS 1" >> $TMPH
1170 echo "#ifndef __MINGW32__" >> $TMPH
1171 echo "#define __MINGW32__ 1" >> $TMPH
1172 echo "#endif" >> $TMPH
1175 if test "$os2" = "yes" ; then
1176 echo "#define CONFIG_OS2 1" >> $TMPH
1177 echo "CONFIG_OS2=yes" >> config.mak
1180 if test "$TARGET_OS" = "SunOS" ; then
1181 echo "#define CONFIG_SUNOS 1" >> $TMPH
1184 if test "$darwin" = "yes"; then
1185 echo "#define CONFIG_DARWIN 1" >> $TMPH
1186 echo "CONFIG_DARWIN=yes" >> config.mak
1189 if test "$_malloc_h" = "yes" ; then
1190 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1192 echo "#undef HAVE_MALLOC_H" >> $TMPH
1195 if test "$_memalign" = "yes" ; then
1196 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1198 echo "#undef HAVE_MEMALIGN" >> $TMPH
1201 if test "$netserver" = "yes" ; then
1202 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1203 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1206 if test "$need_inet_aton" = "yes" ; then
1207 echo "NEED_INET_ATON=yes" >> config.mak
1210 if test "$simpleidct" = "yes" ; then
1211 echo "#define SIMPLE_IDCT 1" >> $TMPH
1214 if test "$ffserver" = "yes" ; then
1215 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1216 echo "CONFIG_FFSERVER=yes" >> config.mak
1219 if test "$ffplay" = "yes" ; then
1220 echo "CONFIG_FFPLAY=yes" >> config.mak
1223 if test "$risky" = "yes" ; then
1224 echo "#define CONFIG_RISKY 1" >> $TMPH
1225 echo "CONFIG_RISKY=yes" >> config.mak
1228 echo "#define restrict $_restrict" >> $TMPH
1230 # build tree in object directory if source path is different from current one
1231 if test "$source_path_used" = "yes" ; then
1232 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1233 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1234 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1235 for dir in $DIRS ; do
1238 for f in $FILES ; do
1239 ln -sf $source_path/$f $f
1242 echo "SRC_PATH=$source_path" >> config.mak
1244 if test "$amr_wb" = "yes" ; then
1245 echo "#define AMR_WB 1" >> $TMPH
1246 echo "AMR_WB=yes" >> config.mak
1248 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1250 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1251 echo "and extracted the source to libavcodec/amrwb_float"
1255 if test "$amr_nb" = "yes" ; then
1256 echo "#define AMR_NB 1" >> $TMPH
1257 echo "AMR_NB=yes" >> config.mak
1259 if test "$amr_nb_fixed" = "yes" ; then
1260 echo "AMR_NB_FIXED=yes" >> config.mak
1261 echo "#define AMR_NB_FIXED 1" >> $TMPH
1262 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1263 echo "REL-5 version 5.1.0 from "
1264 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1265 echo "and extracted src to libavcodec/amr"
1266 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1267 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1270 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1271 echo "REL-5 V5.1.0 from "
1272 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1273 echo "and extracted the source to libavcodec/amr_float"
1274 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1280 diff $TMPH config.h >/dev/null 2>&1
1281 if test $? -ne 0 ; then
1282 mv -f $TMPH config.h
1284 echo "config.h is unchanged"
1287 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH