⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configure

📁 ffmpeg的完整源代码和作者自己写的文档。不但有在Linux的工程哦
💻
📖 第 1 页 / 共 4 页
字号:
    enable fast_unaligned
  ;;
  x86_64|amd64)
    arch="x86_32"
    enable fast_unaligned
    canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
    if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
      if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
        arch="x86_64"
        enable fast_64bit
      fi
    fi
  ;;
  # armv4l is a subset of armv[567]*l
  arm|armv[4567]*l)
    arch="armv4l"
  ;;
  alpha)
    arch="alpha"
    enable fast_64bit
  ;;
  "Power Macintosh"|ppc|powerpc)
    arch="powerpc"
  ;;
  ppc64)
    arch="powerpc"
    enable fast_64bit
  ;;
  mips|mipsel|IP*)
    arch="mips"
  ;;
  sun4u|sparc64)
    arch="sparc64"
    enable fast_64bit
  ;;
  sparc)
    arch="sparc"
  ;;
  sh4)
    arch="sh4"
  ;;
  parisc)
    arch="parisc"
  ;;
  parisc64)
    arch="parisc"
    enable fast_64bit
  ;;
  s390|s390x)
    arch="s390"
  ;;
  m68k)
    arch="m68k"
  ;;
  ia64)
    arch="ia64"
    enable fast_64bit
  ;;
  bfin)
    arch="bfin"
  ;;
  *)
    arch="unknown"
  ;;
esac

enable $arch
enabled_any x86_32 x86_64 && enable x86
enabled     sparc64       && enable sparc

# OS specific
case $targetos in
  beos|haiku|zeta)
    PREFIX="$HOME/config"
    # helps building libavcodec
    add_cflags "-DPIC -fomit-frame-pointer"
    # 3 gcc releases known for BeOS, each with ugly bugs
    gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
    case "$gcc_version" in
      2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
        disable mmx
        ;;
      *20010315*) echo "BeBits gcc"
        add_cflags "-fno-expensive-optimizations"
        ;;
    esac
    LDCONFIG="echo ignoring ldconfig"
    SHFLAGS=-nostart
    # enable BeOS things
    enable audio_beos
    # no need for libm, but the inet stuff
    # Check for BONE
    # XXX: actually should check for NOT net_server
    if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
        network_extralibs="-lbind -lsocket"
    else
        enable beos_netserver
        network_extralibs="-lnet"
    fi ;;
  sunos)
    FFSERVERLDFLAGS=""
    SHFLAGS="-shared -Wl,-h,\$@"
    network_extralibs="-lsocket -lnsl"
    ;;
  netbsd)
    oss_demuxer_extralibs="-lossaudio"
    oss_muxer_extralibs="-lossaudio"
    ;;
  openbsd)
    disable need_memalign
    LIBOBJFLAGS="\$(PIC)"
    LDCONFIG="ldconfig -m \$(SHLIBDIR)"
    SHFLAGS='-shared'
    SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBVERSION)'
    SLIBNAME_WITH_VERSION='$(SLIBNAME)'
    SLIBNAME_WITH_MAJOR='$(SLIBNAME)'
    oss_demuxer_extralibs="-lossaudio"
    oss_muxer_extralibs="-lossaudio"
    ;;
  freebsd)
    disable need_memalign
    ;;
  bsd/os)
    osextralibs="-lpoll -lgnugetopt"
    strip="strip -d"
    ;;
  darwin)
    disable need_memalign
    SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(SHLIBDIR)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION) -Wl,-read_only_relocs,suppress"
    VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$@'
    strip="strip -x"
    FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
    SLIBSUF=".dylib"
    SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
    SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
    FFSERVERLDFLAGS=-Wl,-bind_at_load
    ;;
  mingw32*)
    targetos=mingw32
    shlibdir="$bindir"
    VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
    VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
    if enabled swscaler; then
        VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
        VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
    fi
    disable ffserver
    SLIBPREF=""
    SLIBSUF=".dll"
    EXESUF=".exe"
    SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
    SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
    SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
    SLIB_INSTALL_EXTRA_CMD="-install -m 644 \$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib) \"\$(SHLIBDIR)/\$(SLIBNAME_WITH_MAJOR:\$(SLIBSUF)=.lib)\""
    SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base"
    ;;
  cygwin*)
    targetos=cygwin
    shlibdir="$bindir"
    VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
    VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
    if enabled swscaler; then
        VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
        VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
    fi
    EXESUF=".exe"
    SLIBPREF="cyg"
    SLIBSUF=".dll"
    SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
    SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
    SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a -Wl,--enable-auto-image-base'
    ;;
  linux)
    LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
    enable dv1394
    ;;
  irix*)
    targetos=irix
    ranlib="echo ignoring ranlib"
    ;;
  *)
    targetos="${targetos}-UNKNOWN"
    ;;
esac

add_extralibs $osextralibs

if ! disabled logging ; then
    enabled logging || logfile="$logging"
    echo "# $0 $@" >$logfile
    set >>$logfile
else
    logfile=/dev/null
fi

# Combine FFLDFLAGS and the LDFLAGS environment variable.
LDFLAGS="$FFLDFLAGS $LDFLAGS"

test -n "$cross_prefix" && enable cross_compile
cc="${cross_prefix}${cc}"
ar="${cross_prefix}${ar}"
ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}"

# we need to build at least one lib type
if ! enabled_any static shared; then
    cat <<EOF
At least one library type must be built.
Specify --enable-static to build the static libraries or --enable-shared to
build the shared libraries as well. To only build the shared libraries specify
--disable-static in addition to --enable-shared.
EOF
    exit 1;
fi

if disabled static; then
    LIB=""
fi

if ! enabled libogg; then
    enabled libtheora && die "libogg must be enabled to enable libtheora."
    enabled libvorbis && die "libogg must be enabled to enable libvorbis."
fi

if enabled_any libfaad libfaadbin ; then
    if check_header faad.h; then
        check_cc << EOF
#include <faad.h>
#ifndef FAAD2_VERSION
ok faad1
#endif
int main( void ) { return 0; }
EOF
        test $? = 0 && enable libfaad2
    else
        die "FAAD test failed."
    fi
fi


if ! enabled gpl; then
    die_gpl_disabled(){
        name=$1
        shift
        enabled_any $@ && die "$name is under GPL and --enable-gpl is not specified."
    }
    die_gpl_disabled "The Postprocessing code" pp
    die_gpl_disabled "liba52"                  liba52
    die_gpl_disabled "libx264"                 libx264
    die_gpl_disabled "libxvidcore"             libxvid
    die_gpl_disabled "FAAD2"                   libfaad2
    die_gpl_disabled "The X11 grabber"         x11grab
    die_gpl_disabled "The software scaler"     swscaler
fi

check_deps $ARCH_EXT_LIST

test -z "$need_memalign" && need_memalign="$mmx"

#Darwin CC versions
if test $targetos = darwin; then
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
        add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
    else
        add_cflags "-no-cpp-precomp -pipe"
        check_cflags "-force_cpusubtype_ALL"
        check_cflags "-Wno-sign-compare"
        disabled shared && add_cflags -mdynamic-no-pic
    fi
fi

disabled optimize || add_cflags -fomit-frame-pointer

# Add processor-specific flags
if test $cpu != "generic"; then
    warn_altivec(){
        $1 altivec && echo "WARNING: Tuning for $2 but AltiVec $1.";
    }
    case $cpu in
        601|ppc601|PowerPC601)
            add_cflags "-mcpu=601"
            warn_altivec enabled PPC601
        ;;
        603*|ppc603*|PowerPC603*)
            add_cflags "-mcpu=603"
            warn_altivec enabled PPC603
        ;;
        604*|ppc604*|PowerPC604*)
            add_cflags "-mcpu=604"
            warn_altivec enabled PPC604
        ;;
        G3|g3|75*|ppc75*|PowerPC75*)
            add_cflags "-mcpu=750 -mpowerpc-gfxopt"
            warn_altivec enabled PPC75x
        ;;
        G4|g4|745*|ppc745*|PowerPC745*)
            add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
            warn_altivec disabled PPC745x
        ;;
        74*|ppc74*|PowerPC74*)
            add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
            warn_altivec disabled PPC74xx
        ;;
        G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
            add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
            warn_altivec disabled PPC970
            enable ppc64
        ;;
        Cell|CELL|cell)
            add_cflags "-mcpu=cell"
            warn_altivec disabled Cell
            enable ppc64
        ;;
        # targets that do NOT support conditional mov (cmov)
        i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
            add_cflags "-march=$cpu"
            disable cmov
        ;;
        # targets that do support conditional mov (cmov)
        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
            add_cflags "-march=$cpu"
            enable cmov
            enable fast_cmov
        ;;
        # targets that do support conditional mov but on which it's slow
        pentium4|prescott|nocona)
            add_cflags "-march=$cpu"
            enable cmov
            disable fast_cmov
        ;;
        sparc64)
            add_cflags "-mcpu=v9"
        ;;
        bf*) #bf531 bf532 bf533 bf561 bf5xx all get this config
            add_cflags "-mfdpic"
            add_ldflags "-mfdpic"
        ;;
        arm*)
            add_cflags "-mcpu=$cpu"
        ;;
        *)
        echo "WARNING: Unknown CPU \"$cpu\", ignored."
        ;;
    esac
fi

gnu_make(){
    $1 --version 2>&1 | grep -q GNU
}

if ! gnu_make $make; then
    gnu_make gmake && make=gmake || die "GNU make not found."
fi

# make sure we can execute files in $TMPDIR
cat >$TMPE 2>>$logfile <<EOF
#! /bin/sh
EOF
chmod +x $TMPE >>$logfile 2>&1
if ! $TMPE >>$logfile 2>&1; then
    cat <<EOF
Unable to create and execute files in $TMPDIR1.  Set the TMPDIR environment
variable to another directory and make sure that $TMPDIR1 is not mounted
noexec.
EOF
    die "Sanity test failed."
fi
rm $TMPE

# compiler sanity check
check_exec <<EOF
int main(){
    return 0;
}
EOF
if test "$?" != 0; then
    echo "$cc is unable to create an executable file."
    if test -z "$cross_prefix" && ! enabled cross_compile ; then
        echo "If $cc is a cross-compiler, use the --cross-compile option."
        echo "Only do this if you know what cross compiling means."
    fi
    die "C compiler test failed."
fi

if enabled x86; then
    # check whether EBP is available on x86
    # As 'i' is stored on the stack, this program will crash
    # if the base pointer is used to access it because the
    # base pointer is cleared in the inline assembly code.
    check_exec_crash <<EOF && enable ebp_available
    volatile int i=0;
    asm volatile (
        "xorl %%ebp, %%ebp"
    ::: "%ebp");
    return i;
EOF

    # check wether EBX is available on x86
    check_asm ebx_available '"":::"%ebx"'

    # check whether binutils is new enough to compile SSSE3
    enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
fi

# check for assembler specific support

if test $arch = "powerpc"; then
check_cc <<EOF && enable dcbzl
int main(void) {
    register long zero = 0;
    char data[1024];
    asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
return 0;
}
EOF
fi

# check for SIMD availability

# AltiVec flags: The FSF version of GCC differs from the Apple version
if enabled altivec; then
    test -n "`$cc -v 2>&1 | grep version | grep Apple`" &&
        add_cflags "-faltivec" ||
        add_cflags "-maltivec -mabi=altivec"

    check_header altivec.h

    # check if our compiler supports Motorola AltiVec C API
    enabled altivec_h &&
        inc_altivec_h="#include <altivec.h>" ||
        inc_altivec_h=
    check_cc <<EOF || disable altivec
$inc_altivec_h
int main(void) {
    vector signed int v1, v2, v3;
    v1 = vec_add(v2,v3);
    return 0;
}
EOF
fi

enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
enabled armv6   && check_asm armv6   '"sadd16 r0, r0, r0"'
enabled iwmmxt  && check_asm iwmmxt  '"wunpckelub wr6, wr4"'
enabled mmi     && check_asm mmi     '"lq $2, 0($2)"'
enabled vis     && check_asm vis     '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc

enabled vis && add_cflags "-mcpu=ultrasparc -mtune=ultrasparc"

# ---
# big/little-endian test
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
grep -q BIGE $TMPO && enable bigendian

# ---
# check availability of some header files

if check_func dlopen; then
    ldl=
elif check_func dlopen -ldl; then
    ldl=-ldl
fi

check_func fork
check_func gethrtime
check_func getrusage
check_func inet_aton
check_func memalign
check_func mkstemp
check_func2 windows.h GetProcessTimes

check_header byteswap.h
check_header conio.h
check_header dlfcn.h
check_header malloc.h
check_header termios.h

if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
    die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
fi

enabled zlib && check_lib zlib.h zlibVersion -lz || disable zlib

# ffserver uses poll(),
# if it's not found we can emulate it using select().
if enabled ffserver; then
    check_header sys/poll.h
fi

# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
if enabled pthreads; then
    if check_func pthread_create; then
        :
    elif check_func pthread_create -pthread; then
        add_cflags -pthread
        add_ldflags -pthread
    elif check_func pthread_create -pthreads; then
        add_cflags -pthreads
        add_ldflags -pthreads
    elif ! check_lib pthread.h pthread_create -lpthread; then
        die "ERROR: can't find pthreads library"
    fi
fi

for thread in $THREADS_LIST; do
    if enabled $thread; then
        test -n "$thread_type" &&
            die "ERROR: Only one thread type must be selected." ||
            thread_type="$thread"
    fi
done

check_lib math.h sin -lm

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -