Skip to content
Snippets Groups Projects
configure 36.7 KiB
Newer Older
  • Learn to ignore specific revisions
  • if test "$optimize" = "small"; then
    
    #  CFLAGS=${CFLAGS//-O3/-Os}
    
    if test "$optimize" = "yes"; then
    
        if test -n "`$cc -v 2>&1 | grep xlc`"; then
    
    	CFLAGS="$CFLAGS -O5"
    	LDFLAGS="$LDFLAGS -O5"
        else
    
    Falk Hüffner's avatar
    Falk Hüffner committed
    	CFLAGS="-O3 $CFLAGS"
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    if test x"$bindir" = x""; then
    bindir="${prefix}/bin"
    fi
    
    
    if test x"$mandir" = x""; then
    mandir="${prefix}/man"
    fi
    
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    echo "Install prefix   $prefix"
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    echo "C compiler       $cc"
    
    echo "make             $make"
    
    echo "broken inttypes.h $emu_fast_int"
    
    if test $cpu = "x86" -o $cpu = "x86_64"; then
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    echo "MMX enabled      $mmx"
    
    echo "Vector Builtins  $builtin_vector"
    
    fi
    if test $cpu = "mips"; then
    
    fi
    if test $cpu = "powerpc"; then
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    echo "gprof enabled    $gprof"
    
    echo "mp3lame enabled  $mp3lame"
    
    echo "faad enabled     $faad"
    echo "faadbin enabled  $faadbin"
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    echo "a52 support      $a52"
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    echo "a52 dlopened     $a52bin"
    
    echo "pp support       $pp"
    
    echo "shared pp        $shared_pp"
    
    echo "Video hooking    $vhook"
    
    echo "SDL support      $sdl"
    if test $sdl_too_old = "yes"; then
    echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
    fi
    
    echo "risky / patent encumbered codecs $risky"
    
    echo "Imlib2 support   $imlib2"
    
    echo "freetype support $freetype2"
    
    echo "Sun medialib support"  $sunmlib
    
    echo "pthreads support"      $pthreads
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    echo "AMR-NB float support"  $amr_nb
    echo "AMR-NB fixed support"  $amr_nb_fixed
    
    echo "AMR-WB float support"  $amr_wb
    
    echo "network support      $network"
    if test "$network" = "yes" ; then
    echo "IPv6 support         $ipv6"
    fi
    
    if test "$gpl" = "no" ; then
    echo "License: LGPL"
    else
    echo "License: GPL"
    fi
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    
    
    echo "Creating config.mak and config.h"
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    
    
    date >> config.log
    echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
    
    echo "# Automatically generated by configure - do not modify" > config.mak
    
    echo "/* Automatically generated by configure - do not modify */" > $TMPH
    
    echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    
    
    echo "prefix=$prefix" >> config.mak
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    echo "bindir=$bindir" >> config.mak
    
    echo "mandir=$mandir" >> config.mak
    
    echo "MAKE=$make" >> config.mak
    
    echo "CC=$cc" >> config.mak
    echo "AR=$ar" >> config.mak
    
    Michael Niedermayer's avatar
    Michael Niedermayer committed
    echo "RANLIB=$ranlib" >> config.mak
    
    echo "INSTALLSTRIP=-s" >> config.mak
    else
    echo "STRIP=echo ignoring strip" >> config.mak
    echo "INSTALLSTRIP=" >> config.mak
    fi
    
    
    # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic.  Used when building 
    # shared modules on OS/X (vhook/Makefile).
    SHCFLAGS=$CFLAGS
    if test "$needmdynamicnopic" = yes; then
       CFLAGS="$CFLAGS -mdynamic-no-pic"
    fi
    
    
    Nick Kurshev's avatar
    Nick Kurshev committed
    echo "OPTFLAGS=$CFLAGS" >> config.mak
    
    echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
    
    echo "SHFLAGS=$SHFLAGS" >> config.mak
    
    echo "LIBPREF=$LIBPREF" >> config.mak
    echo "LIBSUF=$LIBSUF" >> config.mak
    echo "SLIBPREF=$SLIBPREF" >> config.mak
    echo "SLIBSUF=$SLIBSUF" >> config.mak
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    echo "EXESUF=$EXESUF" >> config.mak
    
    echo "TARGET_OS=$TARGET_OS" >> config.mak
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$cpu" = "x86" ; then
    
      echo "TARGET_ARCH_X86=yes" >> config.mak
    
      echo "#define ARCH_X86 1" >> $TMPH
    
    elif test "$cpu" = "x86_64" ; then
      echo "TARGET_ARCH_X86_64=yes" >> config.mak
      echo "#define ARCH_X86_64 1" >> $TMPH
    
      echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
    
      echo "#define ARCH_ARMV4L 1" >> $TMPH
    
      echo "TARGET_ARCH_ALPHA=yes" >> config.mak
    
      echo "#define ARCH_ALPHA 1" >> $TMPH
    
    elif test "$cpu" = "sparc64" ; then
      echo "TARGET_ARCH_SPARC64=yes" >> config.mak
      echo "#define ARCH_SPARC64 1" >> $TMPH
    
      echo "TARGET_ARCH_SPARC=yes" >> config.mak
      echo "#define ARCH_SPARC 1" >> $TMPH
    elif test "$cpu" = "sparc" ; then
      echo "TARGET_ARCH_SPARC=yes" >> config.mak
      echo "#define ARCH_SPARC 1" >> $TMPH
    
    elif test "$cpu" = "powerpc" ; then
      echo "TARGET_ARCH_POWERPC=yes" >> config.mak
      echo "#define ARCH_POWERPC 1" >> $TMPH
    
      if test $POWERPCMODE = "32bits"; then
        echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
      else
        echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
      fi
    
      if test "$powerpc_perf" = "yes"; then
        echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
      fi
    
    elif test "$cpu" = "mips" ; then
      echo "TARGET_ARCH_MIPS=yes" >> config.mak
      echo "#define ARCH_MIPS 1" >> $TMPH
    
    Alex Beregszaszi's avatar
    Alex Beregszaszi committed
    elif test "$cpu" = "sh4" ; then
      echo "TARGET_ARCH_SH4=yes" >> config.mak
      echo "#define ARCH_SH4 1" >> $TMPH
    fi
    
    if test "$bigendian" = "yes" ; then
      echo "WORDS_BIGENDIAN=yes" >> config.mak
      echo "#define WORDS_BIGENDIAN 1" >> $TMPH
    
    if test "$inttypes" != "yes" ; then
      echo "#define EMULATE_INTTYPES 1" >> $TMPH
    
    if test "$emu_fast_int" = "yes" ; then
    
      echo "#define EMULATE_FAST_INT 1" >> $TMPH
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$mmx" = "yes" ; then
    
      echo "TARGET_MMX=yes" >> config.mak
    
      echo "#define HAVE_MMX 1" >> $TMPH
    
      echo "#define __CPU__ 586" >> $TMPH
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    fi
    
    if test "$builtin_vector" = "yes" ; then
      echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
      echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
    fi
    
    if test "$mmi" = "yes" ; then
      echo "TARGET_MMI=yes" >> config.mak
      echo "#define HAVE_MMI 1" >> $TMPH
    fi
    
    if test "$altivec" = "yes" ; then
      echo "TARGET_ALTIVEC=yes" >> config.mak
      echo "#define HAVE_ALTIVEC 1" >> $TMPH
    
      echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
      echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
    
      if test "$_altivec_h" = "yes" ; then
        echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
      else
    
    Alex Beregszaszi's avatar
    1l  
    Alex Beregszaszi committed
        echo "#undef HAVE_ALTIVEC_H" >> $TMPH
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$gprof" = "yes" ; then
    
      echo "TARGET_GPROF=yes" >> config.mak
    
      echo "#define HAVE_GPROF 1" >> $TMPH
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    fi
    
    if test "$localtime_r" = "yes" ; then
      echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
    fi
    
    if test "$imlib2" = "yes" ; then
      echo "HAVE_IMLIB2=yes" >> config.mak
    fi
    
    if test "$freetype2" = "yes" ; then
      echo "HAVE_FREETYPE2=yes" >> config.mak
    fi
    
    if test "$sunmlib" = "yes" ; then
      echo "HAVE_MLIB=yes" >> config.mak
      echo "#define HAVE_MLIB 1" >> $TMPH
      extralibs="$extralibs -lmlib"
    fi
    
    if test "$pthreads" = "yes" ; then
      echo "HAVE_PTHREADS=yes" >> config.mak
      echo "#define HAVE_PTHREADS 1" >> $TMPH
    
      if test $targetos != FreeBSD; then
    
    if test "$sdl" = "yes" ; then
      echo "CONFIG_SDL=yes" >> config.mak
      echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
      echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
    fi
    
    if test "$texi2html" = "yes"; then
      echo "BUILD_DOC=yes" >> config.mak
    fi
    
    if test "$have_lrintf" = "yes" ; then
      echo "#define HAVE_LRINTF 1" >> $TMPH
    fi
    
    if test "$vhook" = "yes" ; then
      echo "BUILD_VHOOK=yes" >> config.mak
      echo "#define HAVE_VHOOK 1" >> $TMPH
    
      extralibs="$extralibs $ldl"
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$lshared" = "yes" ; then
    
    Nick Kurshev's avatar
    Nick Kurshev committed
      echo "BUILD_SHARED=yes" >> config.mak
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
      echo "PIC=-fPIC" >> config.mak
    
    Nick Kurshev's avatar
    Nick Kurshev committed
    fi
    
    echo "EXTRALIBS=$extralibs" >> config.mak
    
    version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
     cut -d '"' -f 2`
    echo "VERSION=$version" >>config.mak
    
    # if you do not want to use encoders, disable that.
    
    echo "#define CONFIG_ENCODERS 1" >> $TMPH
    
    echo "CONFIG_ENCODERS=yes" >> config.mak
    
    # if you do not want to use decoders, disable that.
    
    echo "#define CONFIG_DECODERS 1" >> $TMPH
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    # AC3
    if test "$a52" = "yes" ; then
      echo "#define CONFIG_AC3 1" >> $TMPH
      echo "CONFIG_AC3=yes" >> config.mak
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
      if test "$a52bin" = "yes" ; then
        echo "#define CONFIG_A52BIN 1" >> $TMPH
        echo "CONFIG_A52BIN=yes" >> config.mak
      fi
    fi
    
    
    # DTS
    if test "$dts" = "yes" ; then
      echo "#define CONFIG_DTS 1" >> $TMPH
      echo "CONFIG_DTS=yes" >> config.mak
    fi
    
    
    # PP
    if test "$pp" = "yes" ; then
      echo "#define CONFIG_PP 1" >> $TMPH
      echo "CONFIG_PP=yes" >> config.mak
    
      if test "$shared_pp" = "yes" ; then
        echo "#define SHARED_PP 1" >> $TMPH
        echo "SHARED_PP=yes" >> config.mak
      fi
    fi
    
    
    # mpeg audio high precision mode
    if test "$mpegaudio_hp" = "yes" ; then
      echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
    fi
    
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    if test "$v4l" = "yes" ; then
      echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
      echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
    fi
    
    
    if test "$dv1394" = "yes" ; then
      echo "#define CONFIG_DV1394 1" >> $TMPH
      echo "CONFIG_DV1394=yes" >> config.mak
    fi
    
    
    if test "$dc1394" = "yes" ; then
      echo "#define CONFIG_DC1394 1" >> $TMPH
      echo "CONFIG_DC1394=yes" >> config.mak
    fi
    
    
    if test "$dlopen" = "yes" ; then
      echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
    fi
    
    if test "$dlfcn" = "yes" ; then
      echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
    fi
    
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    if test "$audio_oss" = "yes" ; then
      echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
      echo "CONFIG_AUDIO_OSS=yes" >> config.mak
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    fi
    
    
    if test "$audio_beos" = "yes" ; then
      echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
      echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
    fi
    
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
    if test "$network" = "yes" ; then
      echo "#define CONFIG_NETWORK 1" >> $TMPH
      echo "CONFIG_NETWORK=yes" >> config.mak
    
    if test "$ipv6" = "yes" ; then
      echo "#define CONFIG_IPV6 1" >> $TMPH
    fi
    
    
    if test "$zlib" = "yes" ; then
      echo "#define CONFIG_ZLIB 1" >> $TMPH
      echo "CONFIG_ZLIB=yes" >> config.mak
    fi
    
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$mp3lame" = "yes" ; then
    
      echo "#define CONFIG_MP3LAME 1" >> $TMPH
    
      echo "CONFIG_MP3LAME=yes" >> config.mak
    fi
    
    
    if test "$vorbis" = "yes" ; then
      echo "#define CONFIG_VORBIS 1" >> $TMPH
      echo "CONFIG_VORBIS=yes" >> config.mak
    fi
    
    
    if test "$faad" = "yes" ; then
      echo "#define CONFIG_FAAD 1" >> $TMPH
      echo "CONFIG_FAAD=yes" >> config.mak
    fi
    
    if test "$faadbin" = "yes" ; then
      echo "#define CONFIG_FAADBIN 1" >> $TMPH
    
      echo "CONFIG_FAADBIN=yes" >> config.mak
    
    if test "$faac" = "yes" ; then
      echo "#define CONFIG_FAAC 1" >> $TMPH
      echo "CONFIG_FAAC=yes" >> config.mak
    fi
    
    
    if test "$xvid" = "yes" ; then
      echo "#define CONFIG_XVID 1" >> $TMPH
      echo "CONFIG_XVID=yes" >> config.mak
    fi
    
    
    if test "$mingw32" = "yes" ; then
      echo "#define CONFIG_WIN32 1" >> $TMPH
      echo "CONFIG_WIN32=yes" >> config.mak
    
      echo "HAVE_W32THREADS=yes" >> config.mak
      echo "#define HAVE_W32THREADS 1" >> $TMPH
    
      echo "#define __MINGW32__ 1" >> $TMPH
    
    if test "$os2" = "yes" ; then
      echo "#define CONFIG_OS2 1" >> $TMPH
      echo "CONFIG_OS2=yes" >> config.mak
    fi
    
    
    if test "$TARGET_OS" = "SunOS" ; then
      echo "#define CONFIG_SUNOS 1" >> $TMPH
    fi
    
    
    if test "$TARGET_OS" = "BeOS" ; then
      echo "HAVE_BEOSTHREADS=yes" >> config.mak
      echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
      echo "#define HAVE_THREADS 1" >> $TMPH
    fi
    
    
    if test "$darwin" = "yes"; then
      echo "#define CONFIG_DARWIN 1"  >> $TMPH
      echo "CONFIG_DARWIN=yes" >> config.mak
    fi
    
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$_malloc_h" = "yes" ; then
    
      echo "#define HAVE_MALLOC_H 1" >> $TMPH
    
    Nick Kurshev's avatar
    Nick Kurshev committed
    else
    
      echo "#undef  HAVE_MALLOC_H" >> $TMPH
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$_memalign" = "yes" ; then
    
      echo "#define HAVE_MEMALIGN 1" >> $TMPH
    else
      echo "#undef  HAVE_MEMALIGN" >> $TMPH
    fi
    
    
    if test "$memalignhack" = "yes" ; then
      echo "#define MEMALIGN_HACK 1" >> $TMPH
    fi
    
    
    
    if test "$netserver" = "yes" ; then
      echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
      echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
    fi
    
    
    if test "$need_inet_aton" = "yes" ; then
      echo "NEED_INET_ATON=yes" >> config.mak
    fi
    
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$simpleidct" = "yes" ; then
    
      echo "#define SIMPLE_IDCT 1" >> $TMPH
    fi
    
    
    if test "$ffserver" = "yes" ; then
      echo "#define CONFIG_FFSERVER 1" >> $TMPH
      echo "CONFIG_FFSERVER=yes" >> config.mak
    fi
    
    
    if test "$ffplay" = "yes" ; then
      echo "CONFIG_FFPLAY=yes" >> config.mak
    fi
    
    
    if test "$risky" = "yes" ; then
      echo "#define CONFIG_RISKY 1" >> $TMPH
      echo "CONFIG_RISKY=yes" >> config.mak
    fi
    
    
    if test "$gpl" = "yes" ; then
      echo "#define CONFIG_GPL 1" >> $TMPH
      echo "CONFIG_GPL=yes" >> config.mak
    fi
    
    
    echo "#define restrict $_restrict" >> $TMPH
    
    
    if test "$optimize" = "small"; then
      echo "#define always_inline"  >> $TMPH
    fi
    
    
    # build tree in object directory if source path is different from current one
    if test "$source_path_used" = "yes" ; then
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
        DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
    
              libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
        FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
    
        for dir in $DIRS ; do
                mkdir -p $dir
        done
        for f in $FILES ; do
            ln -sf $source_path/$f $f
        done
    fi
    echo "SRC_PATH=$source_path" >> config.mak
    
    
    if test "$amr_wb" = "yes" ; then
      echo "#define AMR_WB 1" >> $TMPH
      echo "AMR_WB=yes" >> config.mak
      echo
      echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
      echo "V5.1.0 from "
      echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
      echo "and extracted the source to libavcodec/amrwb_float"
      echo
    fi
    
    
    if test "$amr_nb" = "yes" ; then
      echo "#define AMR_NB 1" >> $TMPH
      echo "AMR_NB=yes" >> config.mak
      echo
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
    if test "$amr_nb_fixed" = "yes" ; then
      echo "AMR_NB_FIXED=yes" >> config.mak
      echo "#define AMR_NB_FIXED 1" >> $TMPH
      echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
      echo "REL-5 version 5.1.0 from "
    
    Michael Niedermayer's avatar
    Michael Niedermayer committed
      echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
    
      echo "and extracted src to libavcodec/amr"
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
      echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
      echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
      echo
    else
      echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
      echo "REL-5 V5.1.0 from "
    
    Michael Niedermayer's avatar
    Michael Niedermayer committed
      echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
    
    Zdenek Kabelac's avatar
    Zdenek Kabelac committed
      echo "and extracted the source to libavcodec/amr_float"
    
    Michael Niedermayer's avatar
    Michael Niedermayer committed
      echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
    
    diff $TMPH config.h >/dev/null 2>&1
    
    if test $? -ne 0 ; then
    	mv -f $TMPH config.h
    
    Nick Kurshev's avatar
    Nick Kurshev committed
    else
    
    	echo "config.h is unchanged"
    
    rm -f $TMPO $TMPC $TMPE $TMPS $TMPH