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 #note, we dont try to emulate fast64
974 echo "typedef signed char int_fast8_t;" >> $TMPH
975 echo "typedef signed int int_fast16_t;" >> $TMPH
976 echo "typedef signed int int_fast32_t;" >> $TMPH
977 echo "typedef unsigned char uint_fast8_t;" >> $TMPH
978 echo "typedef unsigned int uint_fast16_t;" >> $TMPH
979 echo "typedef unsigned int uint_fast32_t;" >> $TMPH
981 if test "$mmx" = "yes" ; then
982 echo "TARGET_MMX=yes" >> config.mak
983 echo "#define HAVE_MMX 1" >> $TMPH
984 echo "#define __CPU__ 586" >> $TMPH
986 if test "$builtin_vector" = "yes" ; then
987 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
988 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
990 if test "$mmi" = "yes" ; then
991 echo "TARGET_MMI=yes" >> config.mak
992 echo "#define HAVE_MMI 1" >> $TMPH
994 if test "$altivec" = "yes" ; then
995 echo "TARGET_ALTIVEC=yes" >> config.mak
996 echo "#define HAVE_ALTIVEC 1" >> $TMPH
997 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
998 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
999 if test "$_altivec_h" = "yes" ; then
1000 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1002 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1005 if test "$gprof" = "yes" ; then
1006 echo "TARGET_GPROF=yes" >> config.mak
1007 echo "#define HAVE_GPROF 1" >> $TMPH
1009 if test "$localtime_r" = "yes" ; then
1010 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1012 if test "$imlib2" = "yes" ; then
1013 echo "HAVE_IMLIB2=yes" >> config.mak
1015 if test "$freetype2" = "yes" ; then
1016 echo "HAVE_FREETYPE2=yes" >> config.mak
1018 if test "$sunmlib" = "yes" ; then
1019 echo "HAVE_MLIB=yes" >> config.mak
1020 echo "#define HAVE_MLIB 1" >> $TMPH
1021 extralibs
="$extralibs -lmlib"
1023 if test "$sdl" = "yes" ; then
1024 echo "CONFIG_SDL=yes" >> config.mak
1025 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1026 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1028 if test "$have_lrintf" = "yes" ; then
1029 echo "#define HAVE_LRINTF 1" >> $TMPH
1031 if test "$vhook" = "yes" ; then
1032 echo "BUILD_VHOOK=yes" >> config.mak
1033 echo "#define HAVE_VHOOK 1" >> $TMPH
1034 extralibs
="$extralibs $ldl"
1036 if test "$lshared" = "yes" ; then
1037 echo "BUILD_SHARED=yes" >> config.mak
1038 echo "PIC=-fPIC" >> config.mak
1040 echo "EXTRALIBS=$extralibs" >> config.mak
1041 version
=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1043 echo "VERSION=$version" >>config.mak
1044 # if you do not want to use encoders, disable that.
1045 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1046 echo "CONFIG_ENCODERS=yes" >> config.mak
1048 # if you do not want to use decoders, disable that.
1049 echo "#define CONFIG_DECODERS 1" >> $TMPH
1050 echo "CONFIG_DECODERS=yes" >> config.mak
1053 if test "$a52" = "yes" ; then
1054 echo "#define CONFIG_AC3 1" >> $TMPH
1055 echo "CONFIG_AC3=yes" >> config.mak
1057 if test "$a52bin" = "yes" ; then
1058 echo "#define CONFIG_A52BIN 1" >> $TMPH
1059 echo "CONFIG_A52BIN=yes" >> config.mak
1064 if test "$pp" = "yes" ; then
1065 echo "#define CONFIG_PP 1" >> $TMPH
1066 echo "CONFIG_PP=yes" >> config.mak
1068 if test "$shared_pp" = "yes" ; then
1069 echo "#define SHARED_PP 1" >> $TMPH
1070 echo "SHARED_PP=yes" >> config.mak
1074 # mpeg audio high precision mode
1075 if test "$mpegaudio_hp" = "yes" ; then
1076 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1079 if test "$v4l" = "yes" ; then
1080 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1081 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1084 if test "$dv1394" = "yes" ; then
1085 echo "#define CONFIG_DV1394 1" >> $TMPH
1086 echo "CONFIG_DV1394=yes" >> config.mak
1089 if test "$dlopen" = "yes" ; then
1090 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1093 if test "$dlfcn" = "yes" ; then
1094 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1097 if test "$audio_oss" = "yes" ; then
1098 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1099 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1102 if test "$audio_beos" = "yes" ; then
1103 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1104 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1107 if test "$network" = "yes" ; then
1108 echo "#define CONFIG_NETWORK 1" >> $TMPH
1109 echo "CONFIG_NETWORK=yes" >> config.mak
1112 if test "$zlib" = "yes" ; then
1113 echo "#define CONFIG_ZLIB 1" >> $TMPH
1114 echo "CONFIG_ZLIB=yes" >> config.mak
1117 if test "$mp3lame" = "yes" ; then
1118 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1119 echo "CONFIG_MP3LAME=yes" >> config.mak
1122 if test "$vorbis" = "yes" ; then
1123 echo "#define CONFIG_VORBIS 1" >> $TMPH
1124 echo "CONFIG_VORBIS=yes" >> config.mak
1127 if test "$faad" = "yes" ; then
1128 echo "#define CONFIG_FAAD 1" >> $TMPH
1129 echo "CONFIG_FAAD=yes" >> config.mak
1132 if test "$faadbin" = "yes" ; then
1133 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1134 echo "CONFIG_FAADBIN=yes" >> config.mak
1137 if test "$faac" = "yes" ; then
1138 echo "#define CONFIG_FAAC 1" >> $TMPH
1139 echo "CONFIG_FAAC=yes" >> config.mak
1142 if test "$mingw32" = "yes" ; then
1143 echo "#define CONFIG_WIN32 1" >> $TMPH
1144 echo "CONFIG_WIN32=yes" >> config.mak
1145 echo "#ifndef __MINGW32__" >> $TMPH
1146 echo "#define __MINGW32__ 1" >> $TMPH
1147 echo "#endif" >> $TMPH
1150 if test "$os2" = "yes" ; then
1151 echo "#define CONFIG_OS2 1" >> $TMPH
1152 echo "CONFIG_OS2=yes" >> config.mak
1155 if test "$TARGET_OS" = "SunOS" ; then
1156 echo "#define CONFIG_SUNOS 1" >> $TMPH
1159 if test "$darwin" = "yes"; then
1160 echo "#define CONFIG_DARWIN 1" >> $TMPH
1161 echo "CONFIG_DARWIN=yes" >> config.mak
1164 if test "$_malloc_h" = "yes" ; then
1165 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1167 echo "#undef HAVE_MALLOC_H" >> $TMPH
1170 if test "$_memalign" = "yes" ; then
1171 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1173 echo "#undef HAVE_MEMALIGN" >> $TMPH
1176 if test "$netserver" = "yes" ; then
1177 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1178 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1181 if test "$need_inet_aton" = "yes" ; then
1182 echo "NEED_INET_ATON=yes" >> config.mak
1185 if test "$simpleidct" = "yes" ; then
1186 echo "#define SIMPLE_IDCT 1" >> $TMPH
1189 if test "$ffserver" = "yes" ; then
1190 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1191 echo "CONFIG_FFSERVER=yes" >> config.mak
1194 if test "$ffplay" = "yes" ; then
1195 echo "CONFIG_FFPLAY=yes" >> config.mak
1198 if test "$risky" = "yes" ; then
1199 echo "#define CONFIG_RISKY 1" >> $TMPH
1200 echo "CONFIG_RISKY=yes" >> config.mak
1203 echo "#define restrict $_restrict" >> $TMPH
1205 # build tree in object directory if source path is different from current one
1206 if test "$source_path_used" = "yes" ; then
1207 DIRS
="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1208 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1209 FILES
="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1210 for dir
in $DIRS ; do
1213 for f
in $FILES ; do
1214 ln -sf
$source_path/$f $f
1217 echo "SRC_PATH=$source_path" >> config.mak
1219 if test "$amr_wb" = "yes" ; then
1220 echo "#define AMR_WB 1" >> $TMPH
1221 echo "AMR_WB=yes" >> config.mak
1223 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1225 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1226 echo "and extracted the source to libavcodec/amrwb_float"
1230 if test "$amr_nb" = "yes" ; then
1231 echo "#define AMR_NB 1" >> $TMPH
1232 echo "AMR_NB=yes" >> config.mak
1234 if test "$amr_nb_fixed" = "yes" ; then
1235 echo "AMR_NB_FIXED=yes" >> config.mak
1236 echo "#define AMR_NB_FIXED 1" >> $TMPH
1237 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1238 echo "REL-5 version 5.1.0 from "
1239 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1240 echo "and extracted src to libavcodec/amr"
1241 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1242 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1245 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1246 echo "REL-5 V5.1.0 from "
1247 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1248 echo "and extracted the source to libavcodec/amr_float"
1254 diff $TMPH config.h
>/dev
/null
2>&1
1255 if test $?
-ne
0 ; then
1256 mv -f
$TMPH config.h
1258 echo "config.h is unchanged"
1261 rm -f
$TMPO $TMPC $TMPE $TMPS $TMPH