3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
5 # set temporary file name
6 if test ! -z
"$TMPDIR" ; then
8 elif test ! -z
"$TEMPDIR" ; then
14 TMPC
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPE
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
17 TMPS
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
18 TMPH
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
37 i386|i486|i586|i686|i86pc|BePC
)
40 # armv4l is a subset of armv5tel
47 "Power Macintosh"|ppc
)
96 LDFLAGS
=-Wl
,--warn-common
113 prefix
="/boot/home/config"
114 # helps building libavcodec
115 CFLAGS
="-DPIC -fomit-frame-pointer"
116 # 3 gcc releases known for BeOS, each with ugly bugs
117 gcc_version
="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
118 case "$gcc_version" in
119 2.9-beos-991026
*|
2.9-beos-000224
*) echo "R5/GG gcc"
122 *20010315*) echo "BeBits gcc"
123 CFLAGS
="$CFLAGS -fno-expensive-optimizations"
127 # disable linux things
133 # no need for libm, but the inet stuff
135 if (echo $BEINCLUDES|
grep 'headers/be/bone' >/dev
/null
); then
136 extralibs
="-lbind -lsocket"
150 extralibs
="$extralibs -lsocket -lnsl"
157 LDFLAGS
="$LDFLAGS -export-dynamic"
163 extralibs
="-lpoll -lgnugetopt -lm"
172 SHFLAGS
="-dynamiclib"
177 FFSLDFLAGS
=-Wl
,-bind_at_load
178 gcc_version
="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
179 case "$gcc_version" in
181 CFLAGS
="-no-cpp-precomp -pipe -fomit-frame-pointer"
184 CFLAGS
="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL -Wno-sign-compare"
187 CFLAGS
="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
192 # Note: the rest of the mingw32 config is done afterwards as mingw32
193 # can be forced on command line for linux cross compilation
202 test -f
/usr
/include
/inttypes.h || \
203 test -f
/usr
/local/include
/inttypes.h || \
204 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
205 "/usr/include/inttypes.h !!!"
208 LDFLAGS
="$LDFLAGS -rdynamic"
213 ranlib
="echo ignoring ranlib"
214 strip
="echo ignoring strip"
216 LDFLAGS
="-Zomf -Zstack 16384 -s"
235 # From mplayer configure. We need TARGET_OS available
236 # to the Makefile, so it can distinguish between flavors
237 # of AltiVec on PowerPC
238 TARGET_OS
=`( uname -s ) 2>&1`
240 Linux|FreeBSD|NetBSD|BSD
/OS|OpenBSD|SunOS|QNX|Darwin|GNU
)
248 [cC
][yY
][gG
][wW
][iI
][nN
]*)
252 TARGET_OS
="$TARGET_OS-UNKNOWN"
257 # XXX: we assume an absolute path is given when launching configure,
258 # except in './configure' case.
259 source_path
="`echo $0 | sed -e 's#/configure##'`"
260 source_path_used
="yes"
261 if test -z
"$source_path" -o
"$source_path" = "." ; then
263 source_path_used
="no"
268 --prefix
=*) prefix
=`echo $opt | cut -d '=' -f 2`
270 --mandir
=*) mandir
=`echo $opt | cut -d '=' -f 2`
272 --source-path
=*) source_path
=`echo $opt | cut -d '=' -f 2`
274 --cross-prefix
=*) cross_prefix
=`echo $opt | cut -d '=' -f 2`
276 --cc
=*) cc
=`echo $opt | cut -d '=' -f 2`
278 --make=*) make=`echo $opt | cut -d '=' -f 2`
280 --extra-cflags
=*) CFLAGS
="${opt#--extra-cflags=}"
282 --extra-ldflags
=*) LDFLAGS
=${opt#--extra-ldflags=}
284 --extra-libs
=*) extralibs
=${opt#--extra-libs=}
286 --cpu
=*) cpu
=`echo $opt | cut -d '=' -f 2`
288 --tune
=*) tune
=`echo $opt | cut -d '=' -f 2`
290 --powerpc-perf-enable
) powerpc_perf
="yes"
292 --disable-mmx
) mmx
="no"
294 --disable-altivec
) altivec
="no"
296 --enable-gprof
) gprof
="yes"
298 --disable-v4l
) v4l
="no"
300 --disable-audio-oss
) audio_oss
="no"
302 --disable-audio-beos
) audio_beos
="no"
304 --disable-dv1394
) dv1394
="no"
306 --disable-network
) network
="no"
308 --disable-zlib
) zlib
="no"
310 --enable-a52
) a52
="yes"
312 --enable-a52bin
) a52bin
="yes" ; extralibs
="$ldl $extralibs"
314 --enable-pp
) pp
="yes"
316 --enable-shared-pp
) shared_pp
="yes"
318 --enable-mp3lame
) mp3lame
="yes"
320 --enable-vorbis
) vorbis
="yes"
322 --enable-faad
) faad
="yes"
324 --enable-faadbin
) faadbin
="yes"
326 --disable-vhook
) vhook
="no"
328 --disable-simple_idct
) simpleidct
="no"
330 --enable-mingw32
) mingw32
="yes"
332 --enable-shared
) lshared
="yes"
334 --disable-debug
) debug
="no"
336 --disable-opts
) optimize
="no"
338 --disable-mpegaudio-hp
) mpegaudio_hp
="no"
340 --disable-ffserver
) ffserver
="no"
342 --disable-ffplay
) ffplay
="no"
344 --disable-risky
) risky
="no"
346 --enable-small
) optimize
="small"
348 --enable-amr_nb
) amr_nb
="yes"
350 --enable-amr_nb-fixed
) amr_nb_fixed
="yes"
352 --enable-sunmlib
) sunmlib
="yes"
358 if test $mmx = "default"; then
359 if test $cpu = "x86"; then
366 # Can only do AltiVec on PowerPC
367 if test $altivec = "default"; then
368 if test $cpu = "powerpc"; then
375 # Add processor-specific flags
377 if test $tune != "generic"; then
379 601|ppc601|PowerPC601
)
380 CFLAGS
="$CFLAGS -mcpu=601"
381 if test $altivec = "yes"; then
382 echo "WARNING: tuning for PPC601 but altivec enabled !";
386 603*|ppc603
*|PowerPC603
*)
387 CFLAGS
="$CFLAGS -mcpu=603"
388 if test $altivec = "yes"; then
389 echo "WARNING: tuning for PPC603 but altivec enabled !";
393 604*|ppc604
*|PowerPC604
*)
394 CFLAGS
="$CFLAGS -mcpu=604"
395 if test $altivec = "yes"; then
396 echo "WARNING: tuning for PPC604 but altivec enabled !";
400 G3|g3|
75*|ppc75
*|PowerPC75
*)
401 CFLAGS
="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
402 if test $altivec = "yes"; then
403 echo "WARNING: tuning for PPC75x but altivec enabled !";
407 G4|g4|
745*|ppc745
*|PowerPC745
*)
408 CFLAGS
="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
409 if test $altivec = "no"; then
410 echo "WARNING: tuning for PPC745x but altivec disabled !";
414 74*|ppc74
*|PowerPC74
*)
415 CFLAGS
="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
416 if test $altivec = "no"; then
417 echo "WARNING: tuning for PPC74xx but altivec disabled !";
421 G5|g5|
970|ppc970|PowerPC970|power4
*|Power4
*)
422 CFLAGS
="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
423 if test $altivec = "no"; then
424 echo "WARNING: tuning for PPC970 but altivec disabled !";
429 echo "WARNING: unknown CPU "$tune", ignored"
434 # AltiVec flags: The FSF version of GCC differs from the Darwin version
435 if test $cpu = "powerpc"; then
436 if test $altivec = "yes"; then
437 if test "$darwin" = "yes"; then
438 CFLAGS
="$CFLAGS -faltivec"
440 CFLAGS
="$CFLAGS -maltivec -mabi=altivec"
445 # See if we have <altivec.h>
448 int main( void ) { return 0; }
452 if $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null
; then
456 # See does our compiler support Motorola AltiVec C API
457 if test $altivec = "yes"; then
458 if test $_altivec_h = "yes"; then
462 vector signed int v1, v2, v3;
470 vector signed int v1, v2, v3;
476 $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null || altivec
="no"
479 # Can only do mmi on mips
480 if test $mmi = "default"; then
481 if test $cpu = "mips"; then
488 # See does our compiler support mmi
489 if test $mmi = "yes"; then
492 __asm__ ("lq \$2, 0(\$2)");
496 $cc -o
$TMPE $TMPC 2> /dev
/null || mmi
="no"
499 if test "$mingw32" = "yes" ; then
510 prefix
="/c/Program Files/FFmpeg"
514 cc
="${cross_prefix}${cc}"
515 ar="${cross_prefix}${ar}"
516 ranlib
="${cross_prefix}${ranlib}"
517 strip
="${cross_prefix}${strip}"
519 if test -z
"$cross_prefix" ; then
522 # big/little endian test
524 #include <inttypes.h>
525 int main(int argc, char ** argv){
526 volatile uint32_t i=0x01234567;
527 return (*((uint8_t*)(&i))) == 0x67;
531 if $cc -o
$TMPE $TMPC 2>/dev
/null
; then
532 $TMPE && bigendian
="yes"
534 echo big
/little
test failed
539 # if cross compiling, cannot launch a program, so make a static guess
540 if test "$cpu" = "powerpc" -o
"$cpu" = "mips" ; then
547 # check availability of some header files
551 int main( void ) { return 0; }
556 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
559 # check for memalign - atmos
564 string = memalign(64, sizeof(char));
568 $cc -o
$TMPE $TMPC 2> /dev
/null || _memalign
=no
573 int main( void ) { localtime_r(NULL, NULL); }
577 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
581 if test "$zlib" = "yes"; then
582 # check for zlib - mmu_man
586 if (zlibVersion() != ZLIB_VERSION)
587 puts("zlib version differs !!!");
592 $cc -o
$TMPE $TMPC -lz
2> /dev
/null || zlib
="no"
593 # $TMPE 2> /dev/null > /dev/null || zlib="no"
594 # XXX: more tests needed - runtime test
596 if test "$zlib" = "yes"; then
597 extralibs
="$extralibs -lz"
600 # test for lrintf in math.h
602 #define _ISOC9X_SOURCE 1
604 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
608 if $cc $extralibs -o
$TMPE $TMPC 2> /dev
/null
; then
610 $TMPE 2> /dev
/null
> /dev
/null || have_lrintf
="no"
614 for restrict_keyword
in restrict __restrict__ __restrict
; do
615 echo "void foo(char * $restrict_keyword p);" > $TMPC
616 if $cc -c
-o
$TMPO $TMPC 2> /dev
/null
; then
617 _restrict
=$restrict_keyword
622 # test gcc version to see if vector builtins can be used
623 # currently only used on i386 for MMX builtins
626 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
629 #error no vector builtins
635 if $cc -o
$TMPO $TMPC 2> /dev
/null
; then
639 # dlopen/dlfcn.h probing
643 int main( void ) { return (int) dlopen("foo", 0); }
648 if $cc -o
$TMPE $TMPC -ldl
2> /dev
/null
; then
653 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
660 int main( void ) { return (int) dlopen("foo", 0); }
663 if $cc -o
$TMPE $TMPC -ldl
2> /dev
/null
; then
667 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
672 if test "$vhook" = "default" ; then
676 ##########################################
680 #include <X11/Xlib.h>
682 int main( void ) { return (int) imlib_load_font("foo"); }
686 if $cc -o
$TMPE $TMPC -lImlib2
2> /dev
/null
; then
690 ##########################################
694 #include <ft2build.h>
695 int main( void ) { return (int) FT_Init_FreeType(0); }
699 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
700 if test "`which freetype-config`" != ""; then
701 if $cc -o
$TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` 2> /dev
/null
; then
707 ##########################################
712 #undef main /* We don't want SDL to override our main() */
713 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
718 if $cc -o
$TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev
/null
; then
719 _sdlversion
=`sdl-config --version | sed 's/[^0-9]//g'`
720 if test "$_sdlversion" -lt
121 ; then
727 if test "$sdl" = "no" ; then
731 if test "$debug" = "yes"; then
735 if test "$optimize" = "small"; then
736 # CFLAGS=${CFLAGS//-O3/-Os}
740 if test "$optimize" = "yes"; then
744 if test x
"$bindir" = x
""; then
745 bindir
="${prefix}/bin"
748 if test x
"$mandir" = x
""; then
749 mandir
="${prefix}/man"
752 if test x
"$1" = x
"-h" -o x
"$1" = x
"--help" ; then
755 Usage: configure [options]
756 Options: [defaults in brackets after descriptions]
759 echo "Standard options:"
760 echo " --help print this message"
761 echo " --prefix=PREFIX install in PREFIX [$prefix]"
762 echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
763 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
764 echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
765 echo " --enable-faad enable faad support via libfaad [default=no]"
766 echo " --enable-faadbin build faad support with runtime linking [default=no]"
767 echo " --enable-mingw32 enable mingw32 native/cross windows compile"
768 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
769 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
770 echo " --enable-pp enable GPL'ed post processing support [default=no]"
771 echo " --enable-shared-pp use libpostproc.so [default=no]"
772 echo " --enable-shared build shared libraries [default=no]"
773 echo " --enable-amr_nb enable amr_nb float audio codec"
774 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
775 echo " --enable-sunmlib use Sun medialib [default=no]"
777 echo "Advanced options (experts only):"
778 echo " --source-path=PATH path of source code [$source_path]"
779 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
780 echo " --cc=CC use C compiler CC [$cc]"
781 echo " --make=MAKE use specified make [$make]"
782 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
783 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
784 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
785 echo " --cpu=CPU force cpu to CPU [$cpu]"
786 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
787 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
788 echo " --disable-mmx disable mmx usage"
789 echo " --disable-altivec disable AltiVec usage"
790 echo " --disable-audio-oss disable OSS audio support [default=no]"
791 echo " --disable-audio-beos disable BeOS audio support [default=no]"
792 echo " --disable-v4l disable video4linux grabbing [default=no]"
793 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
794 echo " --disable-network disable network support [default=no]"
795 echo " --disable-zlib disable zlib [default=no]"
796 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
797 echo " --disable-vhook disable video hooking support"
798 echo " --enable-gprof enable profiling with gprof [$gprof]"
799 echo " --disable-debug disable debugging symbols"
800 echo " --disable-opts disable compiler optimizations"
801 echo " --disable-mpegaudio-hp faster (but less accurate)"
802 echo " mpegaudio decoding [default=no]"
803 echo " --disable-ffserver disable ffserver build"
804 echo " --disable-ffplay disable ffplay build"
805 echo " --disable-risky disables patent encumbered codecs"
806 echo " --enable-small optimize for size instead of speed"
808 echo "NOTE: The object files are build at the place where configure is launched"
812 echo "Install prefix $prefix"
813 echo "Source path $source_path"
814 echo "C compiler $cc"
816 echo "CPU $cpu ($tune)"
817 echo "Big Endian $bigendian"
818 if test $cpu = "x86"; then
819 echo "MMX enabled $mmx"
820 echo "Vector Builtins $builtin_vector"
822 if test $cpu = "mips"; then
823 echo "MMI enabled $mmi"
825 if test $cpu = "powerpc"; then
826 echo "AltiVec enabled $altivec"
828 echo "gprof enabled $gprof"
829 echo "zlib enabled $zlib"
830 echo "mp3lame enabled $mp3lame"
831 echo "vorbis enabled $vorbis"
832 echo "faad enabled $faad"
833 echo "faadbin enabled $faadbin"
834 echo "a52 support $a52"
835 echo "a52 dlopened $a52bin"
836 echo "pp support $pp"
837 echo "debug symbols $debug"
838 echo "optimize $optimize"
839 echo "shared pp $shared_pp"
840 echo "Video hooking $vhook"
841 echo "SDL support $sdl"
842 if test $sdl_too_old = "yes"; then
843 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
845 echo "risky / patent encumbered codecs $risky"
847 if test "$vhook" = "yes" ; then
848 echo "Imlib2 support $imlib2"
849 echo "freetype support $freetype2"
851 echo "Sun medialib support" $sunmlib
852 echo "AMR-NB float support" $amr_nb
853 echo "AMR-NB fixed support" $amr_nb_fixed
854 echo "AMR-WB float support" $amr_wb
856 echo "Creating config.mak and config.h"
858 echo "# Automatically generated by configure - do not modify" > config.mak
859 echo "/* Automatically generated by configure - do not modify */" > $TMPH
861 echo "prefix=$prefix" >> config.mak
862 echo "bindir=$bindir" >> config.mak
863 echo "mandir=$mandir" >> config.mak
864 echo "MAKE=$make" >> config.mak
865 echo "CC=$cc" >> config.mak
866 echo "AR=$ar" >> config.mak
867 echo "RANLIB=$ranlib" >> config.mak
868 echo "STRIP=$strip" >> config.mak
869 echo "OPTFLAGS=$CFLAGS" >> config.mak
870 echo "LDFLAGS=$LDFLAGS" >> config.mak
871 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
872 echo "SHFLAGS=$SHFLAGS" >> config.mak
873 echo "LIBPREF=$LIBPREF" >> config.mak
874 echo "LIBSUF=$LIBSUF" >> config.mak
875 echo "SLIBPREF=$SLIBPREF" >> config.mak
876 echo "SLIBSUF=$SLIBSUF" >> config.mak
877 echo "EXESUF=$EXESUF" >> config.mak
878 echo "TARGET_OS=$TARGET_OS" >> config.mak
879 if test "$cpu" = "x86" ; then
880 echo "TARGET_ARCH_X86=yes" >> config.mak
881 echo "#define ARCH_X86 1" >> $TMPH
882 elif test "$cpu" = "armv4l" ; then
883 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
884 echo "#define ARCH_ARMV4L 1" >> $TMPH
885 elif test "$cpu" = "alpha" ; then
886 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
887 echo "#define ARCH_ALPHA 1" >> $TMPH
888 elif test "$cpu" = "sparc64" ; then
889 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
890 echo "#define ARCH_SPARC64 1" >> $TMPH
891 elif test "$cpu" = "powerpc" ; then
892 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
893 echo "#define ARCH_POWERPC 1" >> $TMPH
894 if test "$powerpc_perf" = "yes"; then
895 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
897 elif test "$cpu" = "mips" ; then
898 echo "TARGET_ARCH_MIPS=yes" >> config.mak
899 echo "#define ARCH_MIPS 1" >> $TMPH
900 elif test "$cpu" = "sh4" ; then
901 echo "TARGET_ARCH_SH4=yes" >> config.mak
902 echo "#define ARCH_SH4 1" >> $TMPH
904 echo "#define TUNECPU $TUNECPU" >> $TMPH
905 if test "$bigendian" = "yes" ; then
906 echo "WORDS_BIGENDIAN=yes" >> config.mak
907 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
909 if test "$mmx" = "yes" ; then
910 echo "TARGET_MMX=yes" >> config.mak
911 echo "#define HAVE_MMX 1" >> $TMPH
912 echo "#define __CPU__ 586" >> $TMPH
914 if test "$builtin_vector" = "yes" ; then
915 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
916 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
918 if test "$mmi" = "yes" ; then
919 echo "TARGET_MMI=yes" >> config.mak
920 echo "#define HAVE_MMI 1" >> $TMPH
922 if test "$altivec" = "yes" ; then
923 echo "TARGET_ALTIVEC=yes" >> config.mak
924 echo "#define HAVE_ALTIVEC 1" >> $TMPH
925 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
926 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
927 if test "$_altivec_h" = "yes" ; then
928 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
930 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
933 if test "$gprof" = "yes" ; then
934 echo "TARGET_GPROF=yes" >> config.mak
935 echo "#define HAVE_GPROF 1" >> $TMPH
937 if test "$localtime_r" = "yes" ; then
938 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
940 if test "$imlib2" = "yes" ; then
941 echo "HAVE_IMLIB2=yes" >> config.mak
943 if test "$freetype2" = "yes" ; then
944 echo "HAVE_FREETYPE2=yes" >> config.mak
946 if test "$sunmlib" = "yes" ; then
947 echo "HAVE_MLIB=yes" >> config.mak
948 echo "#define HAVE_MLIB 1" >> $TMPH
949 extralibs
="$extralibs -lmlib"
951 if test "$sdl" = "yes" ; then
952 echo "CONFIG_SDL=yes" >> config.mak
953 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
954 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
956 if test "$have_lrintf" = "yes" ; then
957 echo "#define HAVE_LRINTF 1" >> $TMPH
959 if test "$vhook" = "yes" ; then
960 echo "BUILD_VHOOK=yes" >> config.mak
961 echo "#define HAVE_VHOOK 1" >> $TMPH
962 extralibs
="$extralibs $ldl"
964 if test "$lshared" = "yes" ; then
965 echo "BUILD_SHARED=yes" >> config.mak
966 echo "PIC=-fPIC" >> config.mak
968 echo "EXTRALIBS=$extralibs" >> config.mak
969 version
=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
971 echo "VERSION=$version" >>config.mak
972 # if you do not want to use encoders, disable that.
973 echo "#define CONFIG_ENCODERS 1" >> $TMPH
974 echo "CONFIG_ENCODERS=yes" >> config.mak
976 # if you do not want to use decoders, disable that.
977 echo "#define CONFIG_DECODERS 1" >> $TMPH
978 echo "CONFIG_DECODERS=yes" >> config.mak
981 if test "$a52" = "yes" ; then
982 echo "#define CONFIG_AC3 1" >> $TMPH
983 echo "CONFIG_AC3=yes" >> config.mak
985 if test "$a52bin" = "yes" ; then
986 echo "#define CONFIG_A52BIN 1" >> $TMPH
987 echo "CONFIG_A52BIN=yes" >> config.mak
992 if test "$pp" = "yes" ; then
993 echo "#define CONFIG_PP 1" >> $TMPH
994 echo "CONFIG_PP=yes" >> config.mak
996 if test "$shared_pp" = "yes" ; then
997 echo "#define SHARED_PP 1" >> $TMPH
998 echo "SHARED_PP=yes" >> config.mak
1002 # mpeg audio high precision mode
1003 if test "$mpegaudio_hp" = "yes" ; then
1004 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1007 if test "$v4l" = "yes" ; then
1008 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1009 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1012 if test "$dv1394" = "yes" ; then
1013 echo "#define CONFIG_DV1394 1" >> $TMPH
1014 echo "CONFIG_DV1394=yes" >> config.mak
1017 if test "$dlopen" = "yes" ; then
1018 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1021 if test "$dlfcn" = "yes" ; then
1022 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1025 if test "$audio_oss" = "yes" ; then
1026 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1027 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1030 if test "$audio_beos" = "yes" ; then
1031 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1032 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1035 if test "$network" = "yes" ; then
1036 echo "#define CONFIG_NETWORK 1" >> $TMPH
1037 echo "CONFIG_NETWORK=yes" >> config.mak
1040 if test "$zlib" = "yes" ; then
1041 echo "#define CONFIG_ZLIB 1" >> $TMPH
1042 echo "CONFIG_ZLIB=yes" >> config.mak
1045 if test "$mp3lame" = "yes" ; then
1046 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1047 echo "CONFIG_MP3LAME=yes" >> config.mak
1050 if test "$vorbis" = "yes" ; then
1051 echo "#define CONFIG_VORBIS 1" >> $TMPH
1052 echo "CONFIG_VORBIS=yes" >> config.mak
1055 if test "$faad" = "yes" ; then
1056 echo "#define CONFIG_FAAD 1" >> $TMPH
1057 echo "CONFIG_FAAD=yes" >> config.mak
1060 if test "$faadbin" = "yes" ; then
1061 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1062 echo "CONFIG_FAADBIN=yes" >> config.mak
1065 if test "$mingw32" = "yes" ; then
1066 echo "#define CONFIG_WIN32 1" >> $TMPH
1067 echo "CONFIG_WIN32=yes" >> config.mak
1068 echo "#ifndef __MINGW32__" >> $TMPH
1069 echo "#define __MINGW32__ 1" >> $TMPH
1070 echo "#endif" >> $TMPH
1073 if test "$os2" = "yes" ; then
1074 echo "#define CONFIG_OS2 1" >> $TMPH
1075 echo "CONFIG_OS2=yes" >> config.mak
1078 if test "$TARGET_OS" = "SunOS" ; then
1079 echo "#define CONFIG_SUNOS 1" >> $TMPH
1082 if test "$darwin" = "yes"; then
1083 echo "#define CONFIG_DARWIN 1" >> $TMPH
1084 echo "CONFIG_DARWIN=yes" >> config.mak
1087 if test "$_malloc_h" = "yes" ; then
1088 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1090 echo "#undef HAVE_MALLOC_H" >> $TMPH
1093 if test "$_memalign" = "yes" ; then
1094 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1096 echo "#undef HAVE_MEMALIGN" >> $TMPH
1099 if test "$netserver" = "yes" ; then
1100 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1101 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1104 if test "$need_inet_aton" = "yes" ; then
1105 echo "NEED_INET_ATON=yes" >> config.mak
1108 if test "$simpleidct" = "yes" ; then
1109 echo "#define SIMPLE_IDCT 1" >> $TMPH
1112 if test "$ffserver" = "yes" ; then
1113 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1114 echo "CONFIG_FFSERVER=yes" >> config.mak
1117 if test "$ffplay" = "yes" ; then
1118 echo "CONFIG_FFPLAY=yes" >> config.mak
1121 if test "$risky" = "yes" ; then
1122 echo "#define CONFIG_RISKY 1" >> $TMPH
1123 echo "CONFIG_RISKY=yes" >> config.mak
1126 echo "#define restrict $_restrict" >> $TMPH
1128 # build tree in object directory if source path is different from current one
1129 if test "$source_path_used" = "yes" ; then
1130 DIRS
="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1131 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1132 FILES
="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1133 for dir
in $DIRS ; do
1136 for f
in $FILES ; do
1137 ln -sf
$source_path/$f $f
1140 echo "SRC_PATH=$source_path" >> config.mak
1142 if test "$amr_wb" = "yes" ; then
1143 echo "#define AMR_WB 1" >> $TMPH
1144 echo "AMR_WB=yes" >> config.mak
1146 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1148 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1149 echo "and extracted the source to libavcodec/amrwb_float"
1153 if test "$amr_nb" = "yes" ; then
1154 echo "#define AMR_NB 1" >> $TMPH
1155 echo "AMR_NB=yes" >> config.mak
1157 if test "$amr_nb_fixed" = "yes" ; then
1158 echo "AMR_NB_FIXED=yes" >> config.mak
1159 echo "#define AMR_NB_FIXED 1" >> $TMPH
1160 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1161 echo "REL-5 version 5.1.0 from "
1162 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1163 echo "and extracted src to libavcodec/amr"
1164 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1165 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1168 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1169 echo "REL-5 V5.1.0 from "
1170 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1171 echo "and extracted the source to libavcodec/amr_float"
1177 diff $TMPH config.h
>/dev
/null
2>&1
1178 if test $?
-ne
0 ; then
1179 mv -f
$TMPH config.h
1181 echo "config.h is unchanged"
1184 rm -f
$TMPO $TMPC $TMPE $TMPS $TMPH