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"
33 i386|i486|i586|i686|i86pc|BePC)
42 "Power Macintosh"|ppc)
87 LDFLAGS=-Wl,--warn-common
102 prefix="/boot/home/config"
103 # helps building libavcodec
104 CFLAGS="-O3 -DPIC -fomit-frame-pointer"
105 # 3 gcc releases known for BeOS, each with ugly bugs
106 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
107 case "$gcc_version" in
108 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
111 *20010315*) echo "BeBits gcc"
112 CFLAGS="$CFLAGS -fno-expensive-optimizations"
116 # disable linux things
122 # no need for libm, but the inet stuff
124 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
125 extralibs="-lbind -lsocket"
139 extralibs="$extralibs -lsocket -lnsl"
146 LDFLAGS="$LDFLAGS -export-dynamic"
152 extralibs="-lpoll -lgnugetopt -lm"
160 SHFLAGS="-dynamiclib"
165 FFSLDFLAGS=-Wl,-bind_at_load
166 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f4-)"
167 case "$gcc_version" in
169 CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer"
172 CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
190 test -f /usr/include/inttypes.h || \
191 test -f /usr/local/include/inttypes.h || \
192 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
193 "/usr/include/inttypes.h !!!"
196 LDFLAGS="$LDFLAGS -rdynamic"
201 ranlib="echo ignoring ranlib"
202 strip="echo ignoring strip"
204 LDFLAGS="-Zomf -Zstack 16384 -s"
222 # From mplayer configure. We need TARGET_OS available
223 # to the Makefile, so it can distinguish between flavors
224 # of AltiVec on PowerPC
225 TARGET_OS=`( uname -s ) 2>&1`
227 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
235 [cC][yY][gG][wW][iI][nN]*)
239 TARGET_OS="$TARGET_OS-UNKNOWN"
244 # XXX: we assume an absolute path is given when launching configure,
245 # except in './configure' case.
246 source_path="`echo $0 | sed -e 's#/configure##'`"
247 source_path_used="yes"
248 if test -z "$source_path" -o "$source_path" = "." ; then
250 source_path_used="no"
255 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
257 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
259 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
261 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
263 --make=*) make=`echo $opt | cut -d '=' -f 2`
265 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
267 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
269 --extra-libs=*) extralibs=${opt#--extra-libs=}
271 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
273 --disable-mmx) mmx="no"
275 --disable-altivec) altivec="no"
277 --enable-gprof) gprof="yes"
279 --disable-v4l) v4l="no"
281 --disable-audio-oss) audio_oss="no"
283 --disable-audio-beos) audio_beos="no"
285 --disable-dv1394) dv1394="no"
287 --disable-network) network="no"
289 --disable-zlib) zlib="no"
291 --disable-a52) a52="no"
293 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
295 --disable-pp) pp="no"
297 --enable-shared-pp) shared_pp="yes"
299 --enable-mp3lame) mp3lame="yes"
301 --enable-vorbis) vorbis="yes"
303 --enable-faad) faad="yes"
305 --enable-faadbin) faadbin="yes"
307 --disable-vhook) vhook="no"
309 --disable-simple_idct) simpleidct="no"
311 --enable-win32) win32="yes"
313 --enable-mingw32) mingw32="yes"
315 --enable-shared) lshared="yes"
317 --disable-mpegaudio-hp) mpegaudio_hp="no"
319 --disable-ffserver) ffserver="no"
321 --disable-ffplay) ffplay="no"
323 --disable-risky) risky="no"
325 --enable-small) small="yes"
327 --enable-amr_nb) amr_nb="yes"
329 --enable-amr_nb-fixed) amr_nb_fixed="yes"
335 if test $mmx = "default"; then
336 if test $cpu = "x86"; then
343 # Can only do AltiVec on PowerPC
344 if test $altivec = "default"; then
345 if test $cpu = "powerpc"; then
352 # See if we have <altivec.h>
355 int main( void ) { return 0; }
359 if $cc -o $TMPE $TMPC 2> /dev/null ; then
363 # See does our compiler support Motorola AltiVec C API
364 if test $altivec = "yes"; then
365 if test $_altivec_h = "yes"; then
369 vector signed int v1, v2, v3;
377 vector signed int v1, v2, v3;
383 if test "$darwin" = "yes"; then
384 $cc -o $TMPE $TMPC -faltivec 2> /dev/null || altivec="no"
386 $cc -o $TMPE $TMPC -maltivec -mabi=altivec 2> /dev/null || altivec="no"
390 # Can only do mmi on mips
391 if test $mmi = "default"; then
392 if test $cpu = "mips"; then
399 # See does our compiler support mmi
400 if test $mmi = "yes"; then
403 __asm__ ("lq \$2, 0(\$2)");
407 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
410 # Checking for CFLAGS
411 if test -z "$CFLAGS"; then
415 if test "$win32" = "yes" ; then
416 cross_prefix="i386-mingw32msvc-"
423 if test "$mingw32" = "yes" ; then
431 cc="${cross_prefix}${cc}"
432 ar="${cross_prefix}${ar}"
433 ranlib="${cross_prefix}${ranlib}"
434 strip="${cross_prefix}${strip}"
436 if test -z "$cross_prefix" ; then
439 # big/little endian test
441 #include <inttypes.h>
442 int main(int argc, char ** argv){
443 volatile uint32_t i=0x01234567;
444 return (*((uint8_t*)(&i))) == 0x67;
448 if $cc -o $TMPE $TMPC 2>/dev/null ; then
449 $TMPE && bigendian="yes"
451 echo big/little test failed
456 # if cross compiling, cannot launch a program, so make a static guess
457 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
464 # check availability of some header files
468 int main( void ) { return 0; }
473 if $cc -o $TMPE $TMPC 2> /dev/null ; then
476 # check for memalign - atmos
481 string = memalign(64, sizeof(char));
485 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
491 int main( void ) { return *strptime("", "", 0); }
495 if $cc -o $TMPE $TMPC 2> /dev/null ; then
499 if test "$zlib" = "yes"; then
500 # check for zlib - mmu_man
504 if (zlibVersion() != ZLIB_VERSION)
505 puts("zlib version differs !!!");
510 $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
511 # $TMPE 2> /dev/null > /dev/null || zlib="no"
512 # XXX: more tests needed - runtime test
514 if test "$zlib" = "yes"; then
515 extralibs="$extralibs -lz"
518 # test for lrintf in math.h
520 #define _ISOC9X_SOURCE 1
522 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
526 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
528 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
532 for restrict_keyword in restrict __restrict__ __restrict; do
533 echo "void foo(char * $restrict_keyword p);" > $TMPC
534 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
535 _restrict=$restrict_keyword
540 # test gcc version to see if vector builtins can be used
541 # currently only used on i386 for MMX builtins
544 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
547 #error no vector builtins
553 if $cc -o $TMPO $TMPC 2> /dev/null ; then
557 # dlopen/dlfcn.h probing
561 int main( void ) { return (int) dlopen("foo", 0); }
566 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
571 if $cc -o $TMPE $TMPC 2> /dev/null ; then
578 int main( void ) { return (int) dlopen("foo", 0); }
581 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
585 if $cc -o $TMPE $TMPC 2> /dev/null ; then
590 if test "$vhook" = "default" ; then
594 ##########################################
598 #include <X11/Xlib.h>
600 int main( void ) { return (int) imlib_load_font("foo"); }
604 if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null ; then
608 ##########################################
612 #include <ft2build.h>
613 int main( void ) { return (int) FT_Init_FreeType(0); }
617 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
618 if test "`which freetype-config`" != ""; then
619 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` 2> /dev/null ; then
625 ##########################################
630 #undef main /* We don't want SDL to override our main() */
631 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
636 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then
637 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
638 if test "$_sdlversion" -lt 121 ; then
645 if test "$sdl" = "no" ; then
649 if test "$small" = "yes"; then
650 # CFLAGS=${CFLAGS//-O3/-Os}
654 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
657 Usage: configure [options]
658 Options: [defaults in brackets after descriptions]
661 echo "Standard options:"
662 echo " --help print this message"
663 echo " --prefix=PREFIX install in PREFIX [$prefix]"
664 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
665 echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
666 echo " --enable-faad enable faad support via libfaad [default=no]"
667 echo " --enable-faadbin build faad support with runtime linking [default=no]"
668 echo " --enable-win32 enable win32 cross compile"
669 echo " --enable-mingw32 enable mingw32 native windows compile"
670 echo " --disable-a52 disable GPL'ed A52 support [default=no]"
671 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
672 echo " --disable-pp disable GPL'ed post processing support [default=no]"
673 echo " --enable-shared-pp use libpostproc.so [default=no]"
674 echo " --enable-shared build shared libraries [default=no]"
675 echo " --enable-amr_nb enable amr_nb float audio codec"
676 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
678 echo "Advanced options (experts only):"
679 echo " --source-path=PATH path of source code [$source_path]"
680 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
681 echo " --cc=CC use C compiler CC [$cc]"
682 echo " --make=MAKE use specified make [$make]"
683 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
684 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
685 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
686 echo " --cpu=CPU force cpu to CPU [$cpu]"
687 echo " --disable-mmx disable mmx usage"
688 echo " --disable-altivec disable AltiVec usage"
689 echo " --disable-audio-oss disable OSS audio support [default=no]"
690 echo " --disable-audio-beos disable BeOS audio support [default=no]"
691 echo " --disable-v4l disable video4linux grabbing [default=no]"
692 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
693 echo " --disable-network disable network support [default=no]"
694 echo " --disable-zlib disable zlib [default=no]"
695 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
696 echo " --disable-vhook disable video hooking support"
697 echo " --enable-gprof enable profiling with gprof [$gprof]"
698 echo " --disable-mpegaudio-hp faster (but less accurate)"
699 echo " mpegaudio decoding [default=no]"
700 echo " --disable-ffserver disable ffserver build"
701 echo " --disable-ffplay disable ffplay build"
702 echo " --disable-risky disables patent encumbered codecs"
703 echo " --enable-small optimize for size instead of speed"
705 echo "NOTE: The object files are build at the place where configure is launched"
709 echo "Install prefix $prefix"
710 echo "Source path $source_path"
711 echo "C compiler $cc"
714 echo "Big Endian $bigendian"
715 if test $cpu = "x86"; then
716 echo "MMX enabled $mmx"
717 echo "Vector Builtins $builtin_vector"
719 if test $cpu = "mips"; then
720 echo "MMI enabled $mmi"
722 if test $cpu = "powerpc"; then
723 echo "AltiVec enabled $altivec"
725 echo "gprof enabled $gprof"
726 echo "zlib enabled $zlib"
727 echo "mp3lame enabled $mp3lame"
728 echo "vorbis enabled $vorbis"
729 echo "faad enabled $faad"
730 echo "faadbin enabled $faadbin"
731 echo "a52 support $a52"
732 echo "a52 dlopened $a52bin"
733 echo "pp support $pp"
734 echo "shared pp $shared_pp"
735 echo "Video hooking $vhook"
736 echo "SDL support $sdl"
737 if test $sdl_too_old = "yes"; then
738 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
740 echo "risky / patent encumbered codecs $risky"
741 echo "optimize for size $small"
743 if test "$vhook" = "yes" ; then
744 echo "Imlib2 support $imlib2"
745 echo "freetype support $freetype2"
747 echo "AMR-NB float support" $amr_nb
748 echo "AMR-NB fixed support" $amr_nb_fixed
750 echo "Creating config.mak and config.h"
752 echo "# Automatically generated by configure - do not modify" > config.mak
753 echo "/* Automatically generated by configure - do not modify */" > $TMPH
755 echo "prefix=$prefix" >> config.mak
756 echo "MAKE=$make" >> config.mak
757 echo "CC=$cc" >> config.mak
758 echo "AR=$ar" >> config.mak
759 echo "RANLIB=$ranlib" >> config.mak
760 echo "STRIP=$strip" >> config.mak
761 echo "OPTFLAGS=$CFLAGS" >> config.mak
762 echo "LDFLAGS=$LDFLAGS" >> config.mak
763 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
764 echo "SHFLAGS=$SHFLAGS" >> config.mak
765 echo "LIBPREF=$LIBPREF" >> config.mak
766 echo "LIBSUF=$LIBSUF" >> config.mak
767 echo "SLIBPREF=$SLIBPREF" >> config.mak
768 echo "SLIBSUF=$SLIBSUF" >> config.mak
769 echo "TARGET_OS=$TARGET_OS" >> config.mak
770 if test "$cpu" = "x86" ; then
771 echo "TARGET_ARCH_X86=yes" >> config.mak
772 echo "#define ARCH_X86 1" >> $TMPH
773 elif test "$cpu" = "armv4l" ; then
774 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
775 echo "#define ARCH_ARMV4L 1" >> $TMPH
776 elif test "$cpu" = "alpha" ; then
777 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
778 echo "#define ARCH_ALPHA 1" >> $TMPH
779 elif test "$cpu" = "sparc64" ; then
780 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
781 echo "#define ARCH_SPARC64 1" >> $TMPH
782 elif test "$cpu" = "powerpc" ; then
783 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
784 echo "#define ARCH_POWERPC 1" >> $TMPH
785 echo "// Enable the next line to get PowerPC performance report" >> $TMPH
786 echo "// #define POWERPC_TBL_PERFORMANCE_REPORT 1" >> $TMPH
787 echo "// Enable the next line to use PMC registers instead of TBL" >> $TMPH
788 echo "// #define POWERPC_PERF_USE_PMC 1" >> $TMPH
789 elif test "$cpu" = "mips" ; then
790 echo "TARGET_ARCH_MIPS=yes" >> config.mak
791 echo "#define ARCH_MIPS 1" >> $TMPH
793 if test "$bigendian" = "yes" ; then
794 echo "WORDS_BIGENDIAN=yes" >> config.mak
795 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
797 if test "$mmx" = "yes" ; then
798 echo "TARGET_MMX=yes" >> config.mak
799 echo "#define HAVE_MMX 1" >> $TMPH
800 echo "#define __CPU__ 586" >> $TMPH
802 if test "$builtin_vector" = "yes" ; then
803 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
804 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
806 if test "$mmi" = "yes" ; then
807 echo "TARGET_MMI=yes" >> config.mak
808 echo "#define HAVE_MMI 1" >> $TMPH
810 if test "$altivec" = "yes" ; then
811 echo "TARGET_ALTIVEC=yes" >> config.mak
812 echo "#define HAVE_ALTIVEC 1" >> $TMPH
813 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
814 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
815 if test "$_altivec_h" = "yes" ; then
816 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
818 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
821 if test "$gprof" = "yes" ; then
822 echo "TARGET_GPROF=yes" >> config.mak
823 echo "#define HAVE_GPROF 1" >> $TMPH
825 if test "$strptime" = "yes" ; then
826 echo "#define HAVE_STRPTIME 1" >> $TMPH
828 echo "BUILD_STRPTIME=yes" >> config.mak
830 if test "$imlib2" = "yes" ; then
831 echo "HAVE_IMLIB2=yes" >> config.mak
833 if test "$freetype2" = "yes" ; then
834 echo "HAVE_FREETYPE2=yes" >> config.mak
836 if test "$sdl" = "yes" ; then
837 echo "CONFIG_SDL=yes" >> config.mak
838 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
839 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
841 if test "$have_lrintf" = "yes" ; then
842 echo "#define HAVE_LRINTF 1" >> $TMPH
844 if test "$vhook" = "yes" ; then
845 echo "BUILD_VHOOK=yes" >> config.mak
846 echo "#define HAVE_VHOOK 1" >> $TMPH
847 extralibs="$extralibs $ldl"
849 if test "$lshared" = "yes" ; then
850 echo "BUILD_SHARED=yes" >> config.mak
851 echo "PIC=-fPIC" >> config.mak
853 echo "EXTRALIBS=$extralibs" >> config.mak
854 echo "VERSION=`head $source_path/VERSION`" >>config.mak
856 # if you do not want to use encoders, disable that.
857 echo "#define CONFIG_ENCODERS 1" >> $TMPH
858 echo "CONFIG_ENCODERS=yes" >> config.mak
860 # if you do not want to use decoders, disable that.
861 echo "#define CONFIG_DECODERS 1" >> $TMPH
862 echo "CONFIG_DECODERS=yes" >> config.mak
865 if test "$a52" = "yes" ; then
866 echo "#define CONFIG_AC3 1" >> $TMPH
867 echo "CONFIG_AC3=yes" >> config.mak
869 if test "$a52bin" = "yes" ; then
870 echo "#define CONFIG_A52BIN 1" >> $TMPH
871 echo "CONFIG_A52BIN=yes" >> config.mak
876 if test "$pp" = "yes" ; then
877 echo "#define CONFIG_PP 1" >> $TMPH
878 echo "CONFIG_PP=yes" >> config.mak
880 if test "$shared_pp" = "yes" ; then
881 echo "#define SHARED_PP 1" >> $TMPH
882 echo "SHARED_PP=yes" >> config.mak
886 # mpeg audio high precision mode
887 if test "$mpegaudio_hp" = "yes" ; then
888 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
891 if test "$v4l" = "yes" ; then
892 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
893 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
896 if test "$dv1394" = "yes" ; then
897 echo "#define CONFIG_DV1394 1" >> $TMPH
898 echo "CONFIG_DV1394=yes" >> config.mak
901 if test "$dlopen" = "yes" ; then
902 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
905 if test "$dlfcn" = "yes" ; then
906 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
909 if test "$audio_oss" = "yes" ; then
910 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
911 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
914 if test "$audio_beos" = "yes" ; then
915 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
916 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
919 if test "$network" = "yes" ; then
920 echo "#define CONFIG_NETWORK 1" >> $TMPH
921 echo "CONFIG_NETWORK=yes" >> config.mak
924 if test "$zlib" = "yes" ; then
925 echo "#define CONFIG_ZLIB 1" >> $TMPH
926 echo "CONFIG_ZLIB=yes" >> config.mak
929 if test "$mp3lame" = "yes" ; then
930 echo "#define CONFIG_MP3LAME 1" >> $TMPH
931 echo "CONFIG_MP3LAME=yes" >> config.mak
934 if test "$vorbis" = "yes" ; then
935 echo "#define CONFIG_VORBIS 1" >> $TMPH
936 echo "CONFIG_VORBIS=yes" >> config.mak
939 if test "$faad" = "yes" ; then
940 echo "#define CONFIG_FAAD 1" >> $TMPH
941 echo "CONFIG_FAAD=yes" >> config.mak
944 if test "$faadbin" = "yes" ; then
945 echo "#define CONFIG_FAADBIN 1" >> $TMPH
946 echo "CONFIG_FAADBIN=yes" >> config.mak
949 if test "$win32" = "yes" ; then
950 echo "#define CONFIG_WIN32 1" >> $TMPH
951 echo "CONFIG_WIN32=yes" >> config.mak
954 if test "$mingw32" = "yes" ; then
955 echo "#define CONFIG_WIN32 1" >> $TMPH
956 echo "CONFIG_WIN32=yes" >> config.mak
957 echo "#define __MINGW32__ 1" >> $TMPH
958 echo "__MINGW32__=1" >> config.mak
961 if test "$cygwin" = "yes" ; then
962 # setup correct exesuffix
963 echo "CONFIG_WIN32=yes" >> config.mak
966 if test "$os2" = "yes" ; then
967 echo "#define CONFIG_OS2 1" >> $TMPH
968 echo "CONFIG_OS2=yes" >> config.mak
971 if test "$TARGET_OS" = "SunOS" ; then
972 echo "#define CONFIG_SUNOS 1" >> $TMPH
975 if test "$darwin" = "yes"; then
976 echo "#define CONFIG_DARWIN 1" >> $TMPH
977 echo "CONFIG_DARWIN=yes" >> config.mak
980 if test "$_malloc_h" = "yes" ; then
981 echo "#define HAVE_MALLOC_H 1" >> $TMPH
983 echo "#undef HAVE_MALLOC_H" >> $TMPH
986 if test "$_memalign" = "yes" ; then
987 echo "#define HAVE_MEMALIGN 1" >> $TMPH
989 echo "#undef HAVE_MEMALIGN" >> $TMPH
992 if test "$netserver" = "yes" ; then
993 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
994 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
997 if test "$need_inet_aton" = "yes" ; then
998 echo "NEED_INET_ATON=yes" >> config.mak
1001 if test "$simpleidct" = "yes" ; then
1002 echo "#define SIMPLE_IDCT 1" >> $TMPH
1005 if test "$ffserver" = "yes" ; then
1006 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1007 echo "CONFIG_FFSERVER=yes" >> config.mak
1010 if test "$ffplay" = "yes" ; then
1011 echo "CONFIG_FFPLAY=yes" >> config.mak
1014 if test "$risky" = "yes" ; then
1015 echo "#define CONFIG_RISKY 1" >> $TMPH
1016 echo "CONFIG_RISKY=yes" >> config.mak
1019 echo "#define restrict $_restrict" >> $TMPH
1021 # build tree in object directory if source path is different from current one
1022 if test "$source_path_used" = "yes" ; then
1023 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1024 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1025 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1026 for dir in $DIRS ; do
1029 for f in $FILES ; do
1030 ln -sf $source_path/$f $f
1033 echo "SRC_PATH=$source_path" >> config.mak
1035 if test "$amr_nb" = "yes" ; then
1036 echo "#define AMR_NB 1" >> $TMPH
1037 echo "AMR_NB=yes" >> config.mak
1039 if test "$amr_nb_fixed" = "yes" ; then
1040 echo "AMR_NB_FIXED=yes" >> config.mak
1041 echo "#define AMR_NB_FIXED 1" >> $TMPH
1042 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1043 echo "REL-5 version 5.1.0 from "
1044 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1045 echo "and extracted src to libavcodec/amr"
1046 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1047 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1050 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1051 echo "REL-5 V5.1.0 from "
1052 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1053 echo "and extracted the source to libavcodec/amr_float"
1059 diff $TMPH config.h >/dev/null 2>&1
1060 if test $? -ne 0 ; then
1061 mv -f $TMPH config.h
1063 echo "config.h is unchanged"
1066 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH