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]"
33 echo " --enable-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
35 echo "Advanced options (experts only):"
36 echo " --source-path=PATH path of source code [$source_path]"
37 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
38 echo " --cc=CC use C compiler CC [$cc]"
39 echo " --make=MAKE use specified make [$make]"
40 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
41 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
42 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
43 echo " --cpu=CPU force cpu to CPU [$cpu]"
44 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
45 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
46 echo " --disable-mmx disable mmx usage"
47 echo " --disable-altivec disable AltiVec usage"
48 echo " --disable-audio-oss disable OSS audio support [default=no]"
49 echo " --disable-audio-beos disable BeOS audio support [default=no]"
50 echo " --disable-v4l disable video4linux grabbing [default=no]"
51 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
52 echo " --disable-network disable network support [default=no]"
53 echo " --disable-zlib disable zlib [default=no]"
54 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
55 echo " --disable-vhook disable video hooking support"
56 echo " --enable-gprof enable profiling with gprof [$gprof]"
57 echo " --disable-debug disable debugging symbols"
58 echo " --disable-opts disable compiler optimizations"
59 echo " --disable-mpegaudio-hp faster (but less accurate)"
60 echo " mpegaudio decoding [default=no]"
61 echo " --disable-ffserver disable ffserver build"
62 echo " --disable-ffplay disable ffplay build"
63 echo " --disable-risky disables patent encumbered codecs"
64 echo " --enable-small optimize for size instead of speed"
66 echo "NOTE: The object files are build at the place where configure is launched"
70 # set temporary file name
71 if test ! -z "$TMPDIR" ; then
73 elif test ! -z "$TEMPDIR" ; then
79 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
80 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
81 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
82 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
83 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
102 i386|i486|i586|i686|i86pc|BePC)
105 # armv4l is a subset of armv5tel
112 "Power Macintosh"|ppc)
164 LDFLAGS=-Wl,--warn-common
183 prefix="/boot/home/config"
184 # helps building libavcodec
185 CFLAGS="-DPIC -fomit-frame-pointer"
186 # 3 gcc releases known for BeOS, each with ugly bugs
187 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
188 case "$gcc_version" in
189 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
192 *20010315*) echo "BeBits gcc"
193 CFLAGS="$CFLAGS -fno-expensive-optimizations"
197 # disable linux things
203 # no need for libm, but the inet stuff
205 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
206 extralibs="-lbind -lsocket"
220 extralibs="$extralibs -lsocket -lnsl"
228 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
234 extralibs="-lpoll -lgnugetopt -lm"
243 SHFLAGS="-dynamiclib"
248 FFSLDFLAGS=-Wl,-bind_at_load
251 # Note: the rest of the mingw32 config is done afterwards as mingw32
252 # can be forced on command line for linux cross compilation
261 test -f /usr/include/inttypes.h || \
262 test -f /usr/local/include/inttypes.h || \
263 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
264 "/usr/include/inttypes.h !!!"
267 LDFLAGS="$LDFLAGS -rdynamic"
270 ranlib="echo ignoring ranlib"
278 ranlib="echo ignoring ranlib"
279 strip="echo ignoring strip"
281 LDFLAGS="-Zomf -Zstack 16384 -s"
300 # From mplayer configure. We need TARGET_OS available
301 # to the Makefile, so it can distinguish between flavors
302 # of AltiVec on PowerPC
303 TARGET_OS=`( uname -s ) 2>&1`
305 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
313 [cC][yY][gG][wW][iI][nN]*)
317 TARGET_OS="$TARGET_OS-UNKNOWN"
322 # XXX: we assume an absolute path is given when launching configure,
323 # except in './configure' case.
324 source_path="`echo $0 | sed -e 's#/configure##'`"
325 source_path_used="yes"
326 if test -z "$source_path" -o "$source_path" = "." ; then
328 source_path_used="no"
333 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
335 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
337 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
339 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
341 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
343 --make=*) make=`echo $opt | cut -d '=' -f 2`
345 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
347 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
349 --extra-libs=*) extralibs=${opt#--extra-libs=}
351 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
353 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
355 --powerpc-perf-enable) powerpc_perf="yes"
357 --disable-mmx) mmx="no"
359 --disable-altivec) altivec="no"
361 --enable-gprof) gprof="yes"
363 --disable-v4l) v4l="no"
365 --disable-audio-oss) audio_oss="no"
367 --disable-audio-beos) audio_beos="no"
369 --disable-dv1394) dv1394="no"
371 --disable-network) network="no"
373 --disable-zlib) zlib="no"
375 --enable-a52) a52="yes"
377 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
379 --enable-pp) pp="yes"
381 --enable-shared-pp) shared_pp="yes"
383 --enable-mp3lame) mp3lame="yes"
385 --enable-vorbis) vorbis="yes"
387 --enable-faad) faad="yes"
389 --enable-faadbin) faadbin="yes"
391 --enable-faac) faac="yes"
393 --disable-vhook) vhook="no"
395 --disable-simple_idct) simpleidct="no"
397 --enable-mingw32) mingw32="yes"
399 --enable-shared) lshared="yes"
401 --disable-debug) debug="no"
403 --disable-opts) optimize="no"
405 --disable-mpegaudio-hp) mpegaudio_hp="no"
407 --disable-ffserver) ffserver="no"
409 --disable-ffplay) ffplay="no"
411 --disable-risky) risky="no"
413 --enable-small) optimize="small"
415 --enable-amr_nb) amr_nb="yes"
417 --enable-amr_nb-fixed) amr_nb_fixed="yes"
419 --enable-amr_wb) amr_wb="yes"
421 --enable-sunmlib) sunmlib="yes"
423 --enable-pthreads) pthreads="yes"
425 --enable-gpl) gpl="yes"
430 if test "$gpl" != "yes"; then
431 if test "$pp" != "no" -o "$shared_pp" != "no"; then
432 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
436 if test "$a52" != "no" -o "$a52bin" != "no"; then
437 echo "liba52 is under GPL and --enable-gpl is not specified"
441 if test "$faad" != "no" -o "$faadbin" != "no"; then
444 int main( void ) { return 0; }
447 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
450 #ifndef FAAD2_VERSION
453 int main( void ) { return 0; }
455 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
456 echo "faad2 is under GPL and --enable-gpl is not specified"
462 echo "faad test failed"
467 if test "$fail" = "yes"; then
473 if test $mmx = "default"; then
474 if test $cpu = "x86"; then
482 needmdynamicnopic="no"
483 if test $targetos = Darwin; then
484 if test -n "`$cc -v 2>&1 | grep xlc`"; then
485 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
487 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
488 case "$gcc_version" in
490 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
493 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
494 if test "$lshared" = no; then
495 needmdynamicnopic="yes"
499 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
500 if test "$lshared" = no; then
501 needmdynamicnopic="yes"
508 # Can only do AltiVec on PowerPC
509 if test $altivec = "default"; then
510 if test $cpu = "powerpc"; then
517 # Add processor-specific flags
519 if test $tune != "generic"; then
521 601|ppc601|PowerPC601)
522 CFLAGS="$CFLAGS -mcpu=601"
523 if test $altivec = "yes"; then
524 echo "WARNING: tuning for PPC601 but altivec enabled !";
528 603*|ppc603*|PowerPC603*)
529 CFLAGS="$CFLAGS -mcpu=603"
530 if test $altivec = "yes"; then
531 echo "WARNING: tuning for PPC603 but altivec enabled !";
535 604*|ppc604*|PowerPC604*)
536 CFLAGS="$CFLAGS -mcpu=604"
537 if test $altivec = "yes"; then
538 echo "WARNING: tuning for PPC604 but altivec enabled !";
542 G3|g3|75*|ppc75*|PowerPC75*)
543 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
544 if test $altivec = "yes"; then
545 echo "WARNING: tuning for PPC75x but altivec enabled !";
549 G4|g4|745*|ppc745*|PowerPC745*)
550 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
551 if test $altivec = "no"; then
552 echo "WARNING: tuning for PPC745x but altivec disabled !";
556 74*|ppc74*|PowerPC74*)
557 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
558 if test $altivec = "no"; then
559 echo "WARNING: tuning for PPC74xx but altivec disabled !";
563 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
564 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
565 if test $altivec = "no"; then
566 echo "WARNING: tuning for PPC970 but altivec disabled !";
571 echo "WARNING: unknown CPU "$tune", ignored"
576 # AltiVec flags: The FSF version of GCC differs from the Apple version
577 if test $cpu = "powerpc"; then
578 if test $altivec = "yes"; then
579 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
580 CFLAGS="$CFLAGS -faltivec"
582 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
587 # See if we have <altivec.h>
590 int main( void ) { return 0; }
594 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
598 # See does our compiler support Motorola AltiVec C API
599 if test $altivec = "yes"; then
600 if test $_altivec_h = "yes"; then
604 vector signed int v1, v2, v3;
612 vector signed int v1, v2, v3;
618 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
621 # Can only do mmi on mips
622 if test $mmi = "default"; then
623 if test $cpu = "mips"; then
630 # See does our compiler support mmi
631 if test $mmi = "yes"; then
634 __asm__ ("lq \$2, 0(\$2)");
638 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
641 if test "$mingw32" = "yes" ; then
652 prefix="/c/Program Files/FFmpeg"
656 cc="${cross_prefix}${cc}"
657 ar="${cross_prefix}${ar}"
658 ranlib="${cross_prefix}${ranlib}"
659 strip="${cross_prefix}${strip}"
661 if test -z "$cross_prefix" ; then
664 # big/little endian test
666 #include <inttypes.h>
667 int main(int argc, char ** argv){
668 volatile uint32_t i=0x01234567;
669 return (*((uint8_t*)(&i))) == 0x67;
673 if $cc -o $TMPE $TMPC 2>/dev/null ; then
674 $TMPE && bigendian="yes"
676 echo big/little test failed
681 # if cross compiling, cannot launch a program, so make a static guess
682 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
691 #include <inttypes.h>
692 int main(int argc, char ** argv){
697 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
702 #include <inttypes.h>
703 int main(int argc, char ** argv){
704 volatile uint_fast64_t i=0x01234567;
709 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
712 # check availability of some header files
716 int main( void ) { return 0; }
721 if $cc -o $TMPE $TMPC 2> /dev/null ; then
724 # check for memalign - atmos
729 string = memalign(64, sizeof(char));
733 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
738 int main( void ) { localtime_r(NULL, NULL); }
742 if $cc -o $TMPE $TMPC 2> /dev/null ; then
746 if test "$zlib" = "yes"; then
747 # check for zlib - mmu_man
751 if (zlibVersion() != ZLIB_VERSION)
752 puts("zlib version differs !!!");
757 $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
758 # $TMPE 2> /dev/null > /dev/null || zlib="no"
759 # XXX: more tests needed - runtime test
761 if test "$zlib" = "yes"; then
762 extralibs="$extralibs -lz"
765 # test for lrintf in math.h
767 #define _ISOC9X_SOURCE 1
769 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
773 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
775 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
779 for restrict_keyword in restrict __restrict__ __restrict; do
780 echo "void foo(char * $restrict_keyword p);" > $TMPC
781 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
782 _restrict=$restrict_keyword
787 # test gcc version to see if vector builtins can be used
788 # currently only used on i386 for MMX builtins
791 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
794 #error no vector builtins
800 if $cc -o $TMPO $TMPC 2> /dev/null ; then
804 # dlopen/dlfcn.h probing
808 int main( void ) { return (int) dlopen("foo", 0); }
813 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
818 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
825 int main( void ) { return (int) dlopen("foo", 0); }
828 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
832 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
837 if test "$vhook" = "default" ; then
841 ##########################################
845 #include <X11/Xlib.h>
847 int main( void ) { return (int) imlib_load_font("foo"); }
851 if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
855 ##########################################
859 #include <ft2build.h>
860 int main( void ) { return (int) FT_Init_FreeType(0); }
864 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
865 if test "`which freetype-config`" != ""; then
866 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
872 ##########################################
877 #undef main /* We don't want SDL to override our main() */
878 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
883 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
884 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
885 if test "$_sdlversion" -lt 121 ; then
892 case "`$cc -v 2>&1 | grep version`" in
894 CFLAGS="-Wall $CFLAGS"
900 if test "$sdl" = "no" ; then
904 if test "$debug" = "yes"; then
908 if test "$optimize" = "small"; then
909 # CFLAGS=${CFLAGS//-O3/-Os}
913 if test "$optimize" = "yes"; then
914 if test -n "`$cc -v 2>&1 | grep xlc`"; then
916 LDFLAGS="$LDFLAGS -O5"
922 if test x"$bindir" = x""; then
923 bindir="${prefix}/bin"
926 if test x"$mandir" = x""; then
927 mandir="${prefix}/man"
930 echo "Install prefix $prefix"
931 echo "Source path $source_path"
932 echo "C compiler $cc"
934 echo "CPU $cpu ($tune)"
935 echo "Big Endian $bigendian"
936 echo "inttypes.h $inttypes"
937 echo "broken inttypes.h $emu_fast_int"
938 if test $cpu = "x86"; then
939 echo "MMX enabled $mmx"
940 echo "Vector Builtins $builtin_vector"
942 if test $cpu = "mips"; then
943 echo "MMI enabled $mmi"
945 if test $cpu = "powerpc"; then
946 echo "AltiVec enabled $altivec"
948 echo "gprof enabled $gprof"
949 echo "zlib enabled $zlib"
950 echo "mp3lame enabled $mp3lame"
951 echo "vorbis enabled $vorbis"
952 echo "faad enabled $faad"
953 echo "faadbin enabled $faadbin"
954 echo "faac enabled $faac"
955 echo "a52 support $a52"
956 echo "a52 dlopened $a52bin"
957 echo "pp support $pp"
958 echo "debug symbols $debug"
959 echo "optimize $optimize"
960 echo "shared pp $shared_pp"
961 echo "Video hooking $vhook"
962 echo "SDL support $sdl"
963 if test $sdl_too_old = "yes"; then
964 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
966 echo "risky / patent encumbered codecs $risky"
968 if test "$vhook" = "yes" ; then
969 echo "Imlib2 support $imlib2"
970 echo "freetype support $freetype2"
972 echo "Sun medialib support" $sunmlib
973 echo "pthreads support" $pthreads
974 echo "AMR-NB float support" $amr_nb
975 echo "AMR-NB fixed support" $amr_nb_fixed
976 echo "AMR-WB float support" $amr_wb
977 if test "$gpl" = "no" ; then
983 echo "Creating config.mak and config.h"
985 echo "# Automatically generated by configure - do not modify" > config.mak
986 echo "/* Automatically generated by configure - do not modify */" > $TMPH
988 echo "prefix=$prefix" >> config.mak
989 echo "bindir=$bindir" >> config.mak
990 echo "mandir=$mandir" >> config.mak
991 echo "MAKE=$make" >> config.mak
992 echo "CC=$cc" >> config.mak
993 echo "AR=$ar" >> config.mak
994 echo "RANLIB=$ranlib" >> config.mak
995 echo "STRIP=$strip" >> config.mak
997 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
998 # shared modules on OS/X (vhook/Makefile).
1000 if test "$needmdynamicnopic" = yes; then
1001 CFLAGS="$CFLAGS -mdynamic-no-pic"
1004 echo "OPTFLAGS=$CFLAGS" >> config.mak
1005 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1006 echo "LDFLAGS=$LDFLAGS" >> config.mak
1007 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1008 echo "SHFLAGS=$SHFLAGS" >> config.mak
1009 echo "LIBPREF=$LIBPREF" >> config.mak
1010 echo "LIBSUF=$LIBSUF" >> config.mak
1011 echo "SLIBPREF=$SLIBPREF" >> config.mak
1012 echo "SLIBSUF=$SLIBSUF" >> config.mak
1013 echo "EXESUF=$EXESUF" >> config.mak
1014 echo "TARGET_OS=$TARGET_OS" >> config.mak
1015 if test "$cpu" = "x86" ; then
1016 echo "TARGET_ARCH_X86=yes" >> config.mak
1017 echo "#define ARCH_X86 1" >> $TMPH
1018 elif test "$cpu" = "armv4l" ; then
1019 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1020 echo "#define ARCH_ARMV4L 1" >> $TMPH
1021 elif test "$cpu" = "alpha" ; then
1022 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1023 echo "#define ARCH_ALPHA 1" >> $TMPH
1024 elif test "$cpu" = "sparc64" ; then
1025 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1026 echo "#define ARCH_SPARC64 1" >> $TMPH
1027 elif test "$cpu" = "powerpc" ; then
1028 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1029 echo "#define ARCH_POWERPC 1" >> $TMPH
1030 if test "$powerpc_perf" = "yes"; then
1031 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1033 elif test "$cpu" = "mips" ; then
1034 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1035 echo "#define ARCH_MIPS 1" >> $TMPH
1036 elif test "$cpu" = "sh4" ; then
1037 echo "TARGET_ARCH_SH4=yes" >> config.mak
1038 echo "#define ARCH_SH4 1" >> $TMPH
1040 echo "#define TUNECPU $TUNECPU" >> $TMPH
1041 if test "$bigendian" = "yes" ; then
1042 echo "WORDS_BIGENDIAN=yes" >> config.mak
1043 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1045 if test "$inttypes" != "yes" ; then
1046 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1048 if test "$emu_fast_int" = "yes" ; then
1049 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1051 if test "$mmx" = "yes" ; then
1052 echo "TARGET_MMX=yes" >> config.mak
1053 echo "#define HAVE_MMX 1" >> $TMPH
1054 echo "#define __CPU__ 586" >> $TMPH
1056 if test "$builtin_vector" = "yes" ; then
1057 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1058 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1060 if test "$mmi" = "yes" ; then
1061 echo "TARGET_MMI=yes" >> config.mak
1062 echo "#define HAVE_MMI 1" >> $TMPH
1064 if test "$altivec" = "yes" ; then
1065 echo "TARGET_ALTIVEC=yes" >> config.mak
1066 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1067 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1068 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1069 if test "$_altivec_h" = "yes" ; then
1070 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1072 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1075 if test "$gprof" = "yes" ; then
1076 echo "TARGET_GPROF=yes" >> config.mak
1077 echo "#define HAVE_GPROF 1" >> $TMPH
1079 if test "$localtime_r" = "yes" ; then
1080 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1082 if test "$imlib2" = "yes" ; then
1083 echo "HAVE_IMLIB2=yes" >> config.mak
1085 if test "$freetype2" = "yes" ; then
1086 echo "HAVE_FREETYPE2=yes" >> config.mak
1088 if test "$sunmlib" = "yes" ; then
1089 echo "HAVE_MLIB=yes" >> config.mak
1090 echo "#define HAVE_MLIB 1" >> $TMPH
1091 extralibs="$extralibs -lmlib"
1093 if test "$pthreads" = "yes" ; then
1094 echo "HAVE_PTHREADS=yes" >> config.mak
1095 echo "#define HAVE_PTHREADS 1" >> $TMPH
1096 if test $targetos != FreeBSD; then
1097 extralibs="$extralibs -lpthread"
1100 if test "$sdl" = "yes" ; then
1101 echo "CONFIG_SDL=yes" >> config.mak
1102 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1103 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1105 if test "$have_lrintf" = "yes" ; then
1106 echo "#define HAVE_LRINTF 1" >> $TMPH
1108 if test "$vhook" = "yes" ; then
1109 echo "BUILD_VHOOK=yes" >> config.mak
1110 echo "#define HAVE_VHOOK 1" >> $TMPH
1111 extralibs="$extralibs $ldl"
1113 if test "$lshared" = "yes" ; then
1114 echo "BUILD_SHARED=yes" >> config.mak
1115 echo "PIC=-fPIC" >> config.mak
1117 echo "EXTRALIBS=$extralibs" >> config.mak
1118 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1120 echo "VERSION=$version" >>config.mak
1121 # if you do not want to use encoders, disable that.
1122 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1123 echo "CONFIG_ENCODERS=yes" >> config.mak
1125 # if you do not want to use decoders, disable that.
1126 echo "#define CONFIG_DECODERS 1" >> $TMPH
1127 echo "CONFIG_DECODERS=yes" >> config.mak
1130 if test "$a52" = "yes" ; then
1131 echo "#define CONFIG_AC3 1" >> $TMPH
1132 echo "CONFIG_AC3=yes" >> config.mak
1134 if test "$a52bin" = "yes" ; then
1135 echo "#define CONFIG_A52BIN 1" >> $TMPH
1136 echo "CONFIG_A52BIN=yes" >> config.mak
1141 if test "$pp" = "yes" ; then
1142 echo "#define CONFIG_PP 1" >> $TMPH
1143 echo "CONFIG_PP=yes" >> config.mak
1145 if test "$shared_pp" = "yes" ; then
1146 echo "#define SHARED_PP 1" >> $TMPH
1147 echo "SHARED_PP=yes" >> config.mak
1151 # mpeg audio high precision mode
1152 if test "$mpegaudio_hp" = "yes" ; then
1153 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1156 if test "$v4l" = "yes" ; then
1157 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1158 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1161 if test "$dv1394" = "yes" ; then
1162 echo "#define CONFIG_DV1394 1" >> $TMPH
1163 echo "CONFIG_DV1394=yes" >> config.mak
1166 if test "$dlopen" = "yes" ; then
1167 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1170 if test "$dlfcn" = "yes" ; then
1171 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1174 if test "$audio_oss" = "yes" ; then
1175 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1176 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1179 if test "$audio_beos" = "yes" ; then
1180 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1181 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1184 if test "$network" = "yes" ; then
1185 echo "#define CONFIG_NETWORK 1" >> $TMPH
1186 echo "CONFIG_NETWORK=yes" >> config.mak
1189 if test "$zlib" = "yes" ; then
1190 echo "#define CONFIG_ZLIB 1" >> $TMPH
1191 echo "CONFIG_ZLIB=yes" >> config.mak
1194 if test "$mp3lame" = "yes" ; then
1195 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1196 echo "CONFIG_MP3LAME=yes" >> config.mak
1199 if test "$vorbis" = "yes" ; then
1200 echo "#define CONFIG_VORBIS 1" >> $TMPH
1201 echo "CONFIG_VORBIS=yes" >> config.mak
1204 if test "$faad" = "yes" ; then
1205 echo "#define CONFIG_FAAD 1" >> $TMPH
1206 echo "CONFIG_FAAD=yes" >> config.mak
1209 if test "$faadbin" = "yes" ; then
1210 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1211 echo "CONFIG_FAADBIN=yes" >> config.mak
1214 if test "$faac" = "yes" ; then
1215 echo "#define CONFIG_FAAC 1" >> $TMPH
1216 echo "CONFIG_FAAC=yes" >> config.mak
1219 if test "$mingw32" = "yes" ; then
1220 echo "#define CONFIG_WIN32 1" >> $TMPH
1221 echo "CONFIG_WIN32=yes" >> config.mak
1222 echo "HAVE_W32THREADS=yes" >> config.mak
1223 echo "#define HAVE_W32THREADS 1" >> $TMPH
1224 echo "#ifndef __MINGW32__" >> $TMPH
1225 echo "#define __MINGW32__ 1" >> $TMPH
1226 echo "#endif" >> $TMPH
1229 if test "$os2" = "yes" ; then
1230 echo "#define CONFIG_OS2 1" >> $TMPH
1231 echo "CONFIG_OS2=yes" >> config.mak
1234 if test "$TARGET_OS" = "SunOS" ; then
1235 echo "#define CONFIG_SUNOS 1" >> $TMPH
1238 if test "$darwin" = "yes"; then
1239 echo "#define CONFIG_DARWIN 1" >> $TMPH
1240 echo "CONFIG_DARWIN=yes" >> config.mak
1243 if test "$_malloc_h" = "yes" ; then
1244 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1246 echo "#undef HAVE_MALLOC_H" >> $TMPH
1249 if test "$_memalign" = "yes" ; then
1250 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1252 echo "#undef HAVE_MEMALIGN" >> $TMPH
1255 if test "$netserver" = "yes" ; then
1256 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1257 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1260 if test "$need_inet_aton" = "yes" ; then
1261 echo "NEED_INET_ATON=yes" >> config.mak
1264 if test "$simpleidct" = "yes" ; then
1265 echo "#define SIMPLE_IDCT 1" >> $TMPH
1268 if test "$ffserver" = "yes" ; then
1269 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1270 echo "CONFIG_FFSERVER=yes" >> config.mak
1273 if test "$ffplay" = "yes" ; then
1274 echo "CONFIG_FFPLAY=yes" >> config.mak
1277 if test "$risky" = "yes" ; then
1278 echo "#define CONFIG_RISKY 1" >> $TMPH
1279 echo "CONFIG_RISKY=yes" >> config.mak
1282 if test "$gpl" = "yes" ; then
1283 echo "#define CONFIG_GPL 1" >> $TMPH
1284 echo "CONFIG_GPL=yes" >> config.mak
1287 echo "#define restrict $_restrict" >> $TMPH
1289 # build tree in object directory if source path is different from current one
1290 if test "$source_path_used" = "yes" ; then
1291 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1292 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1293 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1294 for dir in $DIRS ; do
1297 for f in $FILES ; do
1298 ln -sf $source_path/$f $f
1301 echo "SRC_PATH=$source_path" >> config.mak
1303 if test "$amr_wb" = "yes" ; then
1304 echo "#define AMR_WB 1" >> $TMPH
1305 echo "AMR_WB=yes" >> config.mak
1307 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1309 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1310 echo "and extracted the source to libavcodec/amrwb_float"
1314 if test "$amr_nb" = "yes" ; then
1315 echo "#define AMR_NB 1" >> $TMPH
1316 echo "AMR_NB=yes" >> config.mak
1318 if test "$amr_nb_fixed" = "yes" ; then
1319 echo "AMR_NB_FIXED=yes" >> config.mak
1320 echo "#define AMR_NB_FIXED 1" >> $TMPH
1321 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1322 echo "REL-5 version 5.1.0 from "
1323 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1324 echo "and extracted src to libavcodec/amr"
1325 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1326 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1329 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1330 echo "REL-5 V5.1.0 from "
1331 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1332 echo "and extracted the source to libavcodec/amr_float"
1333 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1339 diff $TMPH config.h >/dev/null 2>&1
1340 if test $? -ne 0 ; then
1341 mv -f $TMPH config.h
1343 echo "config.h is unchanged"
1346 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH