📄 configure
字号:
#!/bin/sh## FFmpeg configure script## Copyright (c) 2000, 2001, 2002 Fabrice Bellard# Copyright (c) 2005-2006 Diego Biurrun# Copyright (c) 2005-2006 Mans Rullgard## make sure we are running under a compatible shell# try to make this part work with most shellstry_exec(){ echo "Trying shell $1" type "$1" >/dev/null 2>&1 && exec "$@"}unset foo(: ${foo%%bar}) 2>/dev/nullE1="$?"(: ${foo?}) 2>/dev/nullE2="$?"if test "$E1" != 0 || test "$E2" = 0; then echo "Broken shell detected. Trying alternatives." export FF_CONF_EXEC if test "0$FF_CONF_EXEC" -lt 1; then FF_CONF_EXEC=1 try_exec bash "$0" "$@" fi if test "0$FF_CONF_EXEC" -lt 2; then FF_CONF_EXEC=2 try_exec ksh "$0" "$@" fi if test "0$FF_CONF_EXEC" -lt 3; then FF_CONF_EXEC=3 try_exec /usr/xpg4/bin/sh "$0" "$@" fi echo "No compatible shell script interpreter found." echo "This configure script requires a POSIX-compatible shell" echo "such as bash or ksh." echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH." echo "Instead, install a working POSIX-compatible shell." echo "Disabling this configure test will create a broken FFmpeg." if test "$BASH_VERSION" = '2.04.0(1)-release'; then echo "This bash version ($BASH_VERSION) is broken on your platform." echo "Upgrade to a later version if available." fi exit 1fishow_help(){ echo "Usage: configure [options]" echo "Options: [defaults in brackets after descriptions]" echo echo "Standard options:" echo " --help print this message" echo " --log[=FILE|yes|no] log tests and output to FILE [config.err]" echo " --prefix=PREFIX install in PREFIX [$PREFIX]" echo " --libdir=DIR install libs in DIR [PREFIX/lib]" echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]" echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]" echo " --mandir=DIR install man page in DIR [PREFIX/share/man]" echo " --enable-static build static libraries [default=yes]" echo " --disable-static do not build static libraries [default=no]" echo " --enable-shared build shared libraries [default=no]" echo " --disable-shared do not build shared libraries [default=yes]" echo " --enable-gpl allow use of GPL code, the resulting libav*" echo " and ffmpeg will be under GPL [default=no]" echo " --enable-nonfree allow use of nonfree code, the resulting libav*" echo " and ffmpeg will be unredistributable [default=no]" echo " --enable-pp enable GPLed postprocessing support [default=no]" echo " --enable-swscaler software scaler support [default=no]" echo " --enable-beosthreads use BeOS threads [default=no]" echo " --enable-os2threads use OS/2 threads [default=no]" echo " --enable-pthreads use pthreads [default=no]" echo " --enable-w32threads use Win32 threads [default=no]" echo " --enable-x11grab enable X11 grabbing [default=no]" echo echo "External library support:" echo " --enable-sunmlib use Sun medialib [default=no]" echo " --enable-liba52 enable GPLed liba52 support [default=no]" echo " --enable-liba52bin open liba52.so.0 at runtime [default=no]" echo " --enable-avisynth allow reading AVISynth script files [default=no]" echo " --enable-libamr-nb enable libamr-nb floating point audio codec" echo " --enable-libamr-wb enable libamr-wb floating point audio codec" echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394" echo " and libraw1394 [default=no]" echo " --enable-libfaac enable FAAC support via libfaac [default=no]" echo " --enable-libfaad enable FAAD support via libfaad [default=no]" echo " --enable-libfaadbin open libfaad.so.0 at runtime [default=no]" echo " --enable-libgsm enable GSM support via libgsm [default=no]" echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [default=no]" echo " --enable-libnut enable NUT (de)muxing via libnut," echo " native demuxer exists [default=no]" echo " --enable-libtheora enable Theora encoding via libtheora [default=no]" echo " --enable-libvorbis enable Vorbis encoding via libvorbis," echo " native implementation exists [default=no]" echo " --enable-libx264 enable H.264 encoding via x264 [default=no]" echo " --enable-libxvid enable Xvid encoding via xvidcore," echo " native MPEG-4/Xvid encoder exists [default=no]" echo "" echo "Advanced options (experts only):" echo " --source-path=PATH path to source code [$source_path]" echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" echo " --cross-compile assume a cross-compiler is used" echo " --target-os=OS compiler targets OS [$targetos]" echo " --cc=CC use C compiler CC [$cc]" echo " --make=MAKE use specified make [$make]" echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]" echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]" echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" echo " --build-suffix=SUFFIX suffix for application specific build []" echo " --arch=ARCH select architecture [$arch]" echo " --cpu=CPU selects the minimum cpu required (affects" echo " instruction selection, may crash on older CPUs)" echo " --enable-powerpc-perf enable performance report on PPC" echo " (requires enabling PMC)" echo " --disable-mmx disable MMX usage" echo " --disable-armv5te disable armv5te usage" echo " --disable-armv6 disable armv6 usage" echo " --disable-iwmmxt disable iwmmxt usage" echo " --disable-altivec disable AltiVec usage" echo " --disable-network disable network support [default=no]" echo " --disable-ipv6 disable ipv6 support [default=no]" echo " --disable-zlib disable zlib [default=no]" echo " --disable-vhook disable video hooking support" echo " --disable-debug disable debugging symbols" echo " --disable-mpegaudio-hp faster (but less accurate)" echo " MPEG audio decoding [default=no]" echo " --enable-gray enable full grayscale support (slower color)" echo " --disable-ffmpeg disable ffmpeg build" echo " --disable-ffserver disable ffserver build" echo " --disable-ffplay disable ffplay build" echo " --enable-small optimize for size instead of speed" echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation" echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers" echo " --disable-encoder=NAME disables encoder NAME" echo " --enable-encoder=NAME enables encoder NAME" echo " --disable-decoder=NAME disables decoder NAME" echo " --enable-decoder=NAME enables decoder NAME" echo " --disable-encoders disables all encoders" echo " --disable-decoders disables all decoders" echo " --disable-muxer=NAME disables muxer NAME" echo " --enable-muxer=NAME enables muxer NAME" echo " --disable-muxers disables all muxers" echo " --disable-demuxer=NAME disables demuxer NAME" echo " --enable-demuxer=NAME enables demuxer NAME" echo " --disable-demuxers disables all demuxers" echo " --enable-parser=NAME enables parser NAME" echo " --disable-parser=NAME disables parser NAME" echo " --disable-parsers disables all parsers" echo " --enable-bsf=NAME enables bitstream filter NAME" echo " --disable-bsf=NAME disables bitstream filter NAME" echo " --disable-bsfs disables all bitstream filters" echo " --enable-protocol=NAME enables protocol NAME" echo " --disable-protocol=NAME disables protocol NAME" echo " --disable-protocols disables all protocols" echo " --disable-devices disables all devices" echo " --list-decoders show all available decoders" echo " --list-encoders show all available encoders" echo " --list-muxers show all available muxers" echo " --list-demuxers show all available demuxers" echo " --list-parsers show all available parsers" echo " --list-protocols show all available protocols" echo " --list-bsfs show all available bitstream filters" echo " --list-indevs show all available input devices" echo " --list-outdevs show all available output devices" echo echo "Developer options (useful when working on FFmpeg itself):" echo " --enable-gprof enable profiling with gprof [$gprof]" echo " --disable-optimizations disable compiler optimizations" echo " --enable-extra-warnings enable more compiler warnings" echo " --disable-strip disable stripping of executables and shared libraries" echo "" echo "NOTE: Object files are built at the place where configure is launched." exit 1}log(){ echo "$@" >>$logfile}log_file(){ log BEGIN $1 pr -n -t $1 >>$logfile log END $1}echolog(){ log "$@" echo "$@"}die(){ echolog "$@" cat <<EOFIf you think configure made a mistake, make sure you are using the latestversion from SVN. If the latest version fails, report the problem to theffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.EOF if enabled logging; then cat <<EOFInclude the log file "$logfile" produced by configure as this will helpsolving the problem.EOF elsecat <<EOFRerun configure with logging enabled (do not use --log=no), and include thelog this produces with your report.EOF fi rm -f $TMPC $TMPO $TMPE $TMPS $TMPH exit 1}# Avoid locale weirdness, besides we really just want to translate ASCII.toupper(){ echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ}tolower(){ echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz}set_all(){ value=$1 shift for var in $*; do eval $var=$value done}pushvar(){ for var in $*; do eval level=\${${var}_level:=0} eval ${var}_${level}="\$$var" eval ${var}_level=$(($level+1)) done}popvar(){ for var in $*; do eval level=\${${var}_level:-0} test $level = 0 && continue eval level=$(($level-1)) eval $var="\${${var}_${level}}" eval ${var}_level=$level eval unset ${var}_${level} done}enable(){ set_all yes $*}disable(){ set_all no $*}enabled(){ eval test "x\$$1" = "xyes"}disabled(){ eval test "x\$$1" = "xno"}enabled_all(){ for opt; do enabled $opt || return 1 done}disabled_all(){ for opt; do disabled $opt || return 1 done}enabled_any(){ for opt; do enabled $opt && return 0 done}disabled_any(){ for opt; do disabled $opt && return 0 done}is_in(){ value=$1 shift for var in $*; do [ $var = $value ] && return 0 done return 1}check_deps(){ for cfg; do enabled ${cfg}_checking && die "Circular dependency for $cfg." disabled ${cfg}_checking && continue enable ${cfg}_checking eval dep_all="\$${cfg}_deps" eval dep_any="\$${cfg}_deps_any" pushvar cfg dep_all dep_any check_deps $dep_all $dep_any popvar cfg dep_all dep_any enabled_all $dep_all || disable $cfg enabled_any $dep_any || disable $cfg if enabled $cfg; then eval dep_extralibs="\$${cfg}_extralibs" test -n "$dep_extralibs" && add_extralibs $dep_extralibs fi disable ${cfg}_checking done}print_config(){ pfx=$1 header=$2 makefile=$3 shift 3 for cfg; do ucname="`toupper $cfg`" if enabled $cfg; then echo "#define ${pfx}${ucname} 1" >> $header echo "#define ENABLE_${ucname} 1" >> $header echo "${pfx}${ucname}=yes" >> $makefile else echo "#define ENABLE_${ucname} 0" >> $header fi done}flags_saved(){ (: ${SAVE_CFLAGS?}) 2>/dev/null}save_flags(){ flags_saved && return SAVE_CFLAGS="$CFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_extralibs="$extralibs"}restore_flags(){ flags_saved || return CFLAGS="$SAVE_CFLAGS" LDFLAGS="$SAVE_LDFLAGS" extralibs="$SAVE_extralibs" unset SAVE_CFLAGS unset SAVE_LDFLAGS unset SAVE_extralibs}temp_cflags(){ save_flags CFLAGS="$CFLAGS $*"}temp_ldflags(){ save_flags LDFLAGS="$LDFLAGS $*"}temp_extralibs(){ save_flags extralibs="$extralibs $*"}append(){ var=$1 shift flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\"" eval "$var=\"\$$var $*\""}add_cflags(){ append CFLAGS "$@"}add_ldflags(){ append LDFLAGS "$@"}add_extralibs(){ append extralibs "$@"}check_cmd(){ log "$@" "$@" >>$logfile 2>&1}check_cc(){ log check_cc "$@" cat >$TMPC log_file $TMPC check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC}check_cpp(){ log check_cpp "$@" cat >$TMPC log_file $TMPC check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC}check_asm(){ log check_asm "$@" name="$1" asm="$2" shift 2 check_cc "$@" <<EOF && enable $name || disable $nameint foo(void){ asm volatile($asm);}EOF}check_ld(){ log check_ld "$@" check_cc || return flags='' libs='' for f; do test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" done check_cmd $cc $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -