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"
65 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
67 echo "NOTE: The object files are build at the place where configure is launched"
71 # set temporary file name
72 if test ! -z "$TMPDIR" ; then
74 elif test ! -z "$TEMPDIR" ; then
80 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
81 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
82 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
83 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
84 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
103 i386|i486|i586|i686|i86pc|BePC)
106 # armv4l is a subset of armv5tel
113 "Power Macintosh"|ppc)
168 LDFLAGS=-Wl,--warn-common
188 prefix="/boot/home/config"
189 # helps building libavcodec
190 CFLAGS="-DPIC -fomit-frame-pointer"
191 # 3 gcc releases known for BeOS, each with ugly bugs
192 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
193 case "$gcc_version" in
194 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
197 *20010315*) echo "BeBits gcc"
198 CFLAGS="$CFLAGS -fno-expensive-optimizations"
202 # disable linux things
208 # no need for libm, but the inet stuff
210 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
211 extralibs="-lbind -lsocket"
225 extralibs="$extralibs -lsocket -lnsl"
233 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
239 extralibs="-lpoll -lgnugetopt -lm"
248 SHFLAGS="-dynamiclib"
253 FFSLDFLAGS=-Wl,-bind_at_load
256 # Note: the rest of the mingw32 config is done afterwards as mingw32
257 # can be forced on command line for linux cross compilation
266 test -f /usr/include/inttypes.h || \
267 test -f /usr/local/include/inttypes.h || \
268 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
269 "/usr/include/inttypes.h !!!"
272 LDFLAGS="$LDFLAGS -rdynamic"
275 ranlib="echo ignoring ranlib"
283 ranlib="echo ignoring ranlib"
284 strip="echo ignoring strip"
286 LDFLAGS="-Zomf -Zstack 16384 -s"
305 # From mplayer configure. We need TARGET_OS available
306 # to the Makefile, so it can distinguish between flavors
307 # of AltiVec on PowerPC
308 TARGET_OS=`( uname -s ) 2>&1`
310 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
318 [cC][yY][gG][wW][iI][nN]*)
322 TARGET_OS="$TARGET_OS-UNKNOWN"
327 # XXX: we assume an absolute path is given when launching configure,
328 # except in './configure' case.
329 source_path="`echo $0 | sed -e 's#/configure##'`"
330 source_path_used="yes"
331 if test -z "$source_path" -o "$source_path" = "." ; then
333 source_path_used="no"
338 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
340 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
342 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
344 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
346 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
348 --make=*) make=`echo $opt | cut -d '=' -f 2`
350 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
352 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
354 --extra-libs=*) extralibs=${opt#--extra-libs=}
356 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
358 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
360 --powerpc-perf-enable) powerpc_perf="yes"
362 --disable-mmx) mmx="no"
364 --disable-altivec) altivec="no"
366 --enable-gprof) gprof="yes"
368 --disable-v4l) v4l="no"
370 --disable-audio-oss) audio_oss="no"
372 --disable-audio-beos) audio_beos="no"
374 --disable-dv1394) dv1394="no"
376 --disable-network) network="no"; ffserver="no"
378 --disable-zlib) zlib="no"
380 --enable-a52) a52="yes"
382 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
384 --enable-pp) pp="yes"
386 --enable-shared-pp) shared_pp="yes"
388 --enable-mp3lame) mp3lame="yes"
390 --enable-vorbis) vorbis="yes"
392 --enable-faad) faad="yes"
394 --enable-faadbin) faadbin="yes"
396 --enable-faac) faac="yes"
398 --disable-vhook) vhook="no"
400 --disable-simple_idct) simpleidct="no"
402 --enable-mingw32) mingw32="yes"
404 --enable-shared) lshared="yes"
406 --disable-debug) debug="no"
408 --disable-opts) optimize="no"
410 --disable-mpegaudio-hp) mpegaudio_hp="no"
412 --disable-ffserver) ffserver="no"
414 --disable-ffplay) ffplay="no"
416 --disable-risky) risky="no"
418 --enable-small) optimize="small"
420 --enable-amr_nb) amr_nb="yes"
422 --enable-amr_nb-fixed) amr_nb_fixed="yes"
424 --enable-amr_wb) amr_wb="yes"
426 --enable-sunmlib) sunmlib="yes"
428 --enable-pthreads) pthreads="yes"
430 --enable-gpl) gpl="yes"
432 --enable-memalign-hack) memalignhack="yes"
437 if test "$gpl" != "yes"; then
438 if test "$pp" != "no" -o "$shared_pp" != "no"; then
439 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
443 if test "$a52" != "no" -o "$a52bin" != "no"; then
444 echo "liba52 is under GPL and --enable-gpl is not specified"
448 if test "$faad" != "no" -o "$faadbin" != "no"; then
451 int main( void ) { return 0; }
454 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
457 #ifndef FAAD2_VERSION
460 int main( void ) { return 0; }
462 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
463 echo "faad2 is under GPL and --enable-gpl is not specified"
469 echo "faad test failed"
474 if test "$fail" = "yes"; then
480 if test $mmx = "default"; then
481 if test $cpu = "x86"; then
489 needmdynamicnopic="no"
490 if test $targetos = Darwin; then
491 if test -n "`$cc -v 2>&1 | grep xlc`"; then
492 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
494 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
495 case "$gcc_version" in
497 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
500 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
501 if test "$lshared" = no; then
502 needmdynamicnopic="yes"
506 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
507 if test "$lshared" = no; then
508 needmdynamicnopic="yes"
515 # Can only do AltiVec on PowerPC
516 if test $altivec = "default"; then
517 if test $cpu = "powerpc"; then
524 # Add processor-specific flags
527 if test $tune != "generic"; then
529 601|ppc601|PowerPC601)
530 CFLAGS="$CFLAGS -mcpu=601"
531 if test $altivec = "yes"; then
532 echo "WARNING: tuning for PPC601 but altivec enabled !";
536 603*|ppc603*|PowerPC603*)
537 CFLAGS="$CFLAGS -mcpu=603"
538 if test $altivec = "yes"; then
539 echo "WARNING: tuning for PPC603 but altivec enabled !";
543 604*|ppc604*|PowerPC604*)
544 CFLAGS="$CFLAGS -mcpu=604"
545 if test $altivec = "yes"; then
546 echo "WARNING: tuning for PPC604 but altivec enabled !";
550 G3|g3|75*|ppc75*|PowerPC75*)
551 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
552 if test $altivec = "yes"; then
553 echo "WARNING: tuning for PPC75x but altivec enabled !";
557 G4|g4|745*|ppc745*|PowerPC745*)
558 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
559 if test $altivec = "no"; then
560 echo "WARNING: tuning for PPC745x but altivec disabled !";
564 74*|ppc74*|PowerPC74*)
565 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
566 if test $altivec = "no"; then
567 echo "WARNING: tuning for PPC74xx but altivec disabled !";
571 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
572 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
573 if test $altivec = "no"; then
574 echo "WARNING: tuning for PPC970 but altivec disabled !";
580 echo "WARNING: unknown CPU "$tune", ignored"
585 # AltiVec flags: The FSF version of GCC differs from the Apple version
586 if test $cpu = "powerpc"; then
587 if test $altivec = "yes"; then
588 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
589 CFLAGS="$CFLAGS -faltivec"
591 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
596 # See if we have <altivec.h>
599 int main( void ) { return 0; }
603 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
607 # See does our compiler support Motorola AltiVec C API
608 if test $altivec = "yes"; then
609 if test $_altivec_h = "yes"; then
613 vector signed int v1, v2, v3;
621 vector signed int v1, v2, v3;
627 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
630 # Can only do mmi on mips
631 if test $mmi = "default"; then
632 if test $cpu = "mips"; then
639 # See does our compiler support mmi
640 if test $mmi = "yes"; then
643 __asm__ ("lq \$2, 0(\$2)");
647 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
650 if test "$mingw32" = "yes" ; then
661 prefix="/c/Program Files/FFmpeg"
665 cc="${cross_prefix}${cc}"
666 ar="${cross_prefix}${ar}"
667 ranlib="${cross_prefix}${ranlib}"
668 strip="${cross_prefix}${strip}"
670 if test -z "$cross_prefix" ; then
673 # big/little endian test
675 #include <inttypes.h>
676 int main(int argc, char ** argv){
677 volatile uint32_t i=0x01234567;
678 return (*((uint8_t*)(&i))) == 0x67;
682 if $cc -o $TMPE $TMPC 2>/dev/null ; then
683 $TMPE && bigendian="yes"
685 echo big/little test failed
690 # if cross compiling, cannot launch a program, so make a static guess
691 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
700 #include <inttypes.h>
701 int main(int argc, char ** argv){
706 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
711 #include <inttypes.h>
712 int main(int argc, char ** argv){
713 volatile uint_fast64_t i=0x01234567;
718 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
721 # check availability of some header files
725 int main( void ) { return 0; }
730 if $cc -o $TMPE $TMPC 2> /dev/null ; then
733 # check for memalign - atmos
738 string = memalign(64, sizeof(char));
742 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
747 int main( void ) { localtime_r(NULL, NULL); }
751 if $cc -o $TMPE $TMPC 2> /dev/null ; then
755 if test "$zlib" = "yes"; then
756 # check for zlib - mmu_man
760 if (zlibVersion() != ZLIB_VERSION)
761 puts("zlib version differs !!!");
766 $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
767 # $TMPE 2> /dev/null > /dev/null || zlib="no"
768 # XXX: more tests needed - runtime test
770 if test "$zlib" = "yes"; then
771 extralibs="$extralibs -lz"
774 # test for lrintf in math.h
776 #define _ISOC9X_SOURCE 1
778 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
782 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
784 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
788 for restrict_keyword in restrict __restrict__ __restrict; do
789 echo "void foo(char * $restrict_keyword p);" > $TMPC
790 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
791 _restrict=$restrict_keyword
796 # test gcc version to see if vector builtins can be used
797 # currently only used on i386 for MMX builtins
800 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
803 #error no vector builtins
809 if $cc -o $TMPO $TMPC 2> /dev/null ; then
813 # dlopen/dlfcn.h probing
817 int main( void ) { return (int) dlopen("foo", 0); }
822 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
827 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
834 int main( void ) { return (int) dlopen("foo", 0); }
837 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
841 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
846 if test "$vhook" = "default" ; then
850 ##########################################
854 #include <X11/Xlib.h>
856 int main( void ) { return (int) imlib_load_font("foo"); }
860 if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
864 ##########################################
868 #include <ft2build.h>
869 int main( void ) { return (int) FT_Init_FreeType(0); }
873 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
874 if freetype-config --version >/dev/null 2>&1 ; then
875 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
881 ##########################################
886 #undef main /* We don't want SDL to override our main() */
887 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
892 if sdl-config --version >/dev/null 2>&1 ; then
893 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
894 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
895 if test "$_sdlversion" -lt 121 ; then
903 case "`$cc -v 2>&1 | grep version`" in
905 CFLAGS="-Wall $CFLAGS"
911 if test "$sdl" = "no" ; then
915 if test "$debug" = "yes"; then
919 if test "$optimize" = "small"; then
920 # CFLAGS=${CFLAGS//-O3/-Os}
924 if test "$optimize" = "yes"; then
925 if test -n "`$cc -v 2>&1 | grep xlc`"; then
927 LDFLAGS="$LDFLAGS -O5"
933 if test x"$bindir" = x""; then
934 bindir="${prefix}/bin"
937 if test x"$mandir" = x""; then
938 mandir="${prefix}/man"
941 echo "Install prefix $prefix"
942 echo "Source path $source_path"
943 echo "C compiler $cc"
945 echo "CPU $cpu ($tune)"
946 echo "Big Endian $bigendian"
947 echo "inttypes.h $inttypes"
948 echo "broken inttypes.h $emu_fast_int"
949 if test $cpu = "x86"; then
950 echo "MMX enabled $mmx"
951 echo "Vector Builtins $builtin_vector"
953 if test $cpu = "mips"; then
954 echo "MMI enabled $mmi"
956 if test $cpu = "powerpc"; then
957 echo "AltiVec enabled $altivec"
959 echo "gprof enabled $gprof"
960 echo "zlib enabled $zlib"
961 echo "mp3lame enabled $mp3lame"
962 echo "vorbis enabled $vorbis"
963 echo "faad enabled $faad"
964 echo "faadbin enabled $faadbin"
965 echo "faac enabled $faac"
966 echo "a52 support $a52"
967 echo "a52 dlopened $a52bin"
968 echo "pp support $pp"
969 echo "debug symbols $debug"
970 echo "optimize $optimize"
971 echo "shared pp $shared_pp"
972 echo "Video hooking $vhook"
973 echo "SDL support $sdl"
974 if test $sdl_too_old = "yes"; then
975 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
977 echo "risky / patent encumbered codecs $risky"
979 if test "$vhook" = "yes" ; then
980 echo "Imlib2 support $imlib2"
981 echo "freetype support $freetype2"
983 echo "Sun medialib support" $sunmlib
984 echo "pthreads support" $pthreads
985 echo "AMR-NB float support" $amr_nb
986 echo "AMR-NB fixed support" $amr_nb_fixed
987 echo "AMR-WB float support" $amr_wb
988 if test "$gpl" = "no" ; then
994 echo "Creating config.mak and config.h"
996 echo "# Automatically generated by configure - do not modify" > config.mak
997 echo "/* Automatically generated by configure - do not modify */" > $TMPH
999 echo "prefix=$prefix" >> config.mak
1000 echo "bindir=$bindir" >> config.mak
1001 echo "mandir=$mandir" >> config.mak
1002 echo "MAKE=$make" >> config.mak
1003 echo "CC=$cc" >> config.mak
1004 echo "AR=$ar" >> config.mak
1005 echo "RANLIB=$ranlib" >> config.mak
1006 echo "STRIP=$strip" >> config.mak
1008 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1009 # shared modules on OS/X (vhook/Makefile).
1011 if test "$needmdynamicnopic" = yes; then
1012 CFLAGS="$CFLAGS -mdynamic-no-pic"
1015 echo "OPTFLAGS=$CFLAGS" >> config.mak
1016 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1017 echo "LDFLAGS=$LDFLAGS" >> config.mak
1018 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1019 echo "SHFLAGS=$SHFLAGS" >> config.mak
1020 echo "LIBPREF=$LIBPREF" >> config.mak
1021 echo "LIBSUF=$LIBSUF" >> config.mak
1022 echo "SLIBPREF=$SLIBPREF" >> config.mak
1023 echo "SLIBSUF=$SLIBSUF" >> config.mak
1024 echo "EXESUF=$EXESUF" >> config.mak
1025 echo "TARGET_OS=$TARGET_OS" >> config.mak
1026 if test "$cpu" = "x86" ; then
1027 echo "TARGET_ARCH_X86=yes" >> config.mak
1028 echo "#define ARCH_X86 1" >> $TMPH
1029 elif test "$cpu" = "armv4l" ; then
1030 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1031 echo "#define ARCH_ARMV4L 1" >> $TMPH
1032 elif test "$cpu" = "alpha" ; then
1033 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1034 echo "#define ARCH_ALPHA 1" >> $TMPH
1035 elif test "$cpu" = "sparc64" ; then
1036 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1037 echo "#define ARCH_SPARC64 1" >> $TMPH
1038 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1039 echo "#define ARCH_SPARC 1" >> $TMPH
1040 elif test "$cpu" = "sparc" ; then
1041 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1042 echo "#define ARCH_SPARC 1" >> $TMPH
1043 elif test "$cpu" = "powerpc" ; then
1044 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1045 echo "#define ARCH_POWERPC 1" >> $TMPH
1046 if test $POWERPCMODE = "32bits"; then
1047 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1049 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1051 if test "$powerpc_perf" = "yes"; then
1052 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1054 elif test "$cpu" = "mips" ; then
1055 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1056 echo "#define ARCH_MIPS 1" >> $TMPH
1057 elif test "$cpu" = "sh4" ; then
1058 echo "TARGET_ARCH_SH4=yes" >> config.mak
1059 echo "#define ARCH_SH4 1" >> $TMPH
1061 echo "#define TUNECPU $TUNECPU" >> $TMPH
1062 if test "$bigendian" = "yes" ; then
1063 echo "WORDS_BIGENDIAN=yes" >> config.mak
1064 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1066 if test "$inttypes" != "yes" ; then
1067 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1069 if test "$emu_fast_int" = "yes" ; then
1070 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1072 if test "$mmx" = "yes" ; then
1073 echo "TARGET_MMX=yes" >> config.mak
1074 echo "#define HAVE_MMX 1" >> $TMPH
1075 echo "#define __CPU__ 586" >> $TMPH
1077 if test "$builtin_vector" = "yes" ; then
1078 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1079 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1081 if test "$mmi" = "yes" ; then
1082 echo "TARGET_MMI=yes" >> config.mak
1083 echo "#define HAVE_MMI 1" >> $TMPH
1085 if test "$altivec" = "yes" ; then
1086 echo "TARGET_ALTIVEC=yes" >> config.mak
1087 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1088 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1089 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1090 if test "$_altivec_h" = "yes" ; then
1091 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1093 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1096 if test "$gprof" = "yes" ; then
1097 echo "TARGET_GPROF=yes" >> config.mak
1098 echo "#define HAVE_GPROF 1" >> $TMPH
1100 if test "$localtime_r" = "yes" ; then
1101 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1103 if test "$imlib2" = "yes" ; then
1104 echo "HAVE_IMLIB2=yes" >> config.mak
1106 if test "$freetype2" = "yes" ; then
1107 echo "HAVE_FREETYPE2=yes" >> config.mak
1109 if test "$sunmlib" = "yes" ; then
1110 echo "HAVE_MLIB=yes" >> config.mak
1111 echo "#define HAVE_MLIB 1" >> $TMPH
1112 extralibs="$extralibs -lmlib"
1114 if test "$pthreads" = "yes" ; then
1115 echo "HAVE_PTHREADS=yes" >> config.mak
1116 echo "#define HAVE_PTHREADS 1" >> $TMPH
1117 if test $targetos != FreeBSD; then
1118 extralibs="$extralibs -lpthread"
1121 if test "$sdl" = "yes" ; then
1122 echo "CONFIG_SDL=yes" >> config.mak
1123 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1124 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1126 if test "$have_lrintf" = "yes" ; then
1127 echo "#define HAVE_LRINTF 1" >> $TMPH
1129 if test "$vhook" = "yes" ; then
1130 echo "BUILD_VHOOK=yes" >> config.mak
1131 echo "#define HAVE_VHOOK 1" >> $TMPH
1132 extralibs="$extralibs $ldl"
1134 if test "$lshared" = "yes" ; then
1135 echo "BUILD_SHARED=yes" >> config.mak
1136 echo "PIC=-fPIC" >> config.mak
1138 echo "EXTRALIBS=$extralibs" >> config.mak
1139 version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1141 echo "VERSION=$version" >>config.mak
1142 # if you do not want to use encoders, disable that.
1143 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1144 echo "CONFIG_ENCODERS=yes" >> config.mak
1146 # if you do not want to use decoders, disable that.
1147 echo "#define CONFIG_DECODERS 1" >> $TMPH
1148 echo "CONFIG_DECODERS=yes" >> config.mak
1151 if test "$a52" = "yes" ; then
1152 echo "#define CONFIG_AC3 1" >> $TMPH
1153 echo "CONFIG_AC3=yes" >> config.mak
1155 if test "$a52bin" = "yes" ; then
1156 echo "#define CONFIG_A52BIN 1" >> $TMPH
1157 echo "CONFIG_A52BIN=yes" >> config.mak
1162 if test "$pp" = "yes" ; then
1163 echo "#define CONFIG_PP 1" >> $TMPH
1164 echo "CONFIG_PP=yes" >> config.mak
1166 if test "$shared_pp" = "yes" ; then
1167 echo "#define SHARED_PP 1" >> $TMPH
1168 echo "SHARED_PP=yes" >> config.mak
1172 # mpeg audio high precision mode
1173 if test "$mpegaudio_hp" = "yes" ; then
1174 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1177 if test "$v4l" = "yes" ; then
1178 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1179 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1182 if test "$dv1394" = "yes" ; then
1183 echo "#define CONFIG_DV1394 1" >> $TMPH
1184 echo "CONFIG_DV1394=yes" >> config.mak
1187 if test "$dlopen" = "yes" ; then
1188 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1191 if test "$dlfcn" = "yes" ; then
1192 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1195 if test "$audio_oss" = "yes" ; then
1196 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1197 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1200 if test "$audio_beos" = "yes" ; then
1201 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1202 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1205 if test "$network" = "yes" ; then
1206 echo "#define CONFIG_NETWORK 1" >> $TMPH
1207 echo "CONFIG_NETWORK=yes" >> config.mak
1210 if test "$zlib" = "yes" ; then
1211 echo "#define CONFIG_ZLIB 1" >> $TMPH
1212 echo "CONFIG_ZLIB=yes" >> config.mak
1215 if test "$mp3lame" = "yes" ; then
1216 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1217 echo "CONFIG_MP3LAME=yes" >> config.mak
1220 if test "$vorbis" = "yes" ; then
1221 echo "#define CONFIG_VORBIS 1" >> $TMPH
1222 echo "CONFIG_VORBIS=yes" >> config.mak
1225 if test "$faad" = "yes" ; then
1226 echo "#define CONFIG_FAAD 1" >> $TMPH
1227 echo "CONFIG_FAAD=yes" >> config.mak
1230 if test "$faadbin" = "yes" ; then
1231 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1232 echo "CONFIG_FAADBIN=yes" >> config.mak
1235 if test "$faac" = "yes" ; then
1236 echo "#define CONFIG_FAAC 1" >> $TMPH
1237 echo "CONFIG_FAAC=yes" >> config.mak
1240 if test "$mingw32" = "yes" ; then
1241 echo "#define CONFIG_WIN32 1" >> $TMPH
1242 echo "CONFIG_WIN32=yes" >> config.mak
1243 echo "HAVE_W32THREADS=yes" >> config.mak
1244 echo "#define HAVE_W32THREADS 1" >> $TMPH
1245 echo "#ifndef __MINGW32__" >> $TMPH
1246 echo "#define __MINGW32__ 1" >> $TMPH
1247 echo "#endif" >> $TMPH
1250 if test "$os2" = "yes" ; then
1251 echo "#define CONFIG_OS2 1" >> $TMPH
1252 echo "CONFIG_OS2=yes" >> config.mak
1255 if test "$TARGET_OS" = "SunOS" ; then
1256 echo "#define CONFIG_SUNOS 1" >> $TMPH
1259 if test "$darwin" = "yes"; then
1260 echo "#define CONFIG_DARWIN 1" >> $TMPH
1261 echo "CONFIG_DARWIN=yes" >> config.mak
1264 if test "$_malloc_h" = "yes" ; then
1265 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1267 echo "#undef HAVE_MALLOC_H" >> $TMPH
1270 if test "$_memalign" = "yes" ; then
1271 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1273 echo "#undef HAVE_MEMALIGN" >> $TMPH
1276 if test "$memalignhack" = "yes" ; then
1277 echo "#define MEMALIGN_HACK 1" >> $TMPH
1281 if test "$netserver" = "yes" ; then
1282 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1283 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1286 if test "$need_inet_aton" = "yes" ; then
1287 echo "NEED_INET_ATON=yes" >> config.mak
1290 if test "$simpleidct" = "yes" ; then
1291 echo "#define SIMPLE_IDCT 1" >> $TMPH
1294 if test "$ffserver" = "yes" ; then
1295 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1296 echo "CONFIG_FFSERVER=yes" >> config.mak
1299 if test "$ffplay" = "yes" ; then
1300 echo "CONFIG_FFPLAY=yes" >> config.mak
1303 if test "$risky" = "yes" ; then
1304 echo "#define CONFIG_RISKY 1" >> $TMPH
1305 echo "CONFIG_RISKY=yes" >> config.mak
1308 if test "$gpl" = "yes" ; then
1309 echo "#define CONFIG_GPL 1" >> $TMPH
1310 echo "CONFIG_GPL=yes" >> config.mak
1313 echo "#define restrict $_restrict" >> $TMPH
1315 if test "$optimize" = "small"; then
1316 echo "#define always_inline" >> $TMPH
1319 # build tree in object directory if source path is different from current one
1320 if test "$source_path_used" = "yes" ; then
1321 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1322 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1323 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1324 for dir in $DIRS ; do
1327 for f in $FILES ; do
1328 ln -sf $source_path/$f $f
1331 echo "SRC_PATH=$source_path" >> config.mak
1333 if test "$amr_wb" = "yes" ; then
1334 echo "#define AMR_WB 1" >> $TMPH
1335 echo "AMR_WB=yes" >> config.mak
1337 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1339 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1340 echo "and extracted the source to libavcodec/amrwb_float"
1344 if test "$amr_nb" = "yes" ; then
1345 echo "#define AMR_NB 1" >> $TMPH
1346 echo "AMR_NB=yes" >> config.mak
1348 if test "$amr_nb_fixed" = "yes" ; then
1349 echo "AMR_NB_FIXED=yes" >> config.mak
1350 echo "#define AMR_NB_FIXED 1" >> $TMPH
1351 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1352 echo "REL-5 version 5.1.0 from "
1353 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1354 echo "and extracted src to libavcodec/amr"
1355 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1356 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1359 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1360 echo "REL-5 V5.1.0 from "
1361 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1362 echo "and extracted the source to libavcodec/amr_float"
1363 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1369 diff $TMPH config.h >/dev/null 2>&1
1370 if test $? -ne 0 ; then
1371 mv -f $TMPH config.h
1373 echo "config.h is unchanged"
1376 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH