📄 configure
字号:
if ! enabled_any static shared; then cat <<EOFAt least one library type must be built.Specify --enable-static to build the static libraries or --enable-shared tobuild the shared libraries as well. To only build the shared libraries specify--disable-static in addition to --enable-shared.EOF exit 1;fidisabled static && LIBNAME=""if enabled_any libfaad libfaadbin ; then if check_header faad.h; then check_cc << EOF#include <faad.h>#ifndef FAAD2_VERSIONok faad1#endifint main(void) { return 0; }EOF test $? = 0 && enable libfaad2 else die "FAAD test failed." fifiif ! 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" swscalerfiif ! enabled nonfree && enabled_any libamr_nb libamr_wb; then die "libamr is nonfree and --enable-nonfree is not specified."ficheck_deps $ARCH_EXT_LISTtest -z "$need_memalign" && need_memalign="$mmx"#Darwin CC versionsif 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 fifidisabled optimizations || add_cflags -fomit-frame-pointer# Add processor-specific flagsif 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|pentium4m|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." ;; esacfignu_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 $TMPDIRcat >$TMPE 2>>$logfile <<EOF#! /bin/shEOFchmod +x $TMPE >>$logfile 2>&1if ! $TMPE >>$logfile 2>&1; then cat <<EOFUnable to create and execute files in $TMPDIR1. Set the TMPDIR environmentvariable to another directory and make sure that $TMPDIR1 is not mountednoexec.EOF die "Sanity test failed."firm $TMPE# compiler sanity checkcheck_exec <<EOFint main(void){ return 0;}EOFif 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."fiif 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 supportif test $arch = "powerpc"; thencheck_cc <<EOF && enable dcbzlint main(void) { register long zero = 0; char data[1024]; asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));return 0;}EOFfi# check for SIMD availability# AltiVec flags: The FSF version of GCC differs from the Apple versionif 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_hint main(void) { vector signed int v1, v2, v3; v1 = vec_add(v2,v3); return 0;}EOFfienabled 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=ultrasparcenabled vis && add_cflags "-mcpu=ultrasparc -mtune=ultrasparc"# ---# big/little-endian testcheck_cc <<EOF || die "endian test failed"unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';EOFgrep -q BIGE $TMPO && enable bigendian# ---# check availability of some header filesif check_func dlopen; then ldl=elif check_func dlopen -ldl; then ldl=-ldlficheck_func forkcheck_func gethrtimecheck_func getrusagecheck_func inet_aton $network_extralibscheck_func memaligncheck_func mkstempcheck_func2 windows.h GetProcessTimescheck_header byteswap.hcheck_header conio.hcheck_header dlfcn.hcheck_header malloc.hcheck_header termios.hif ! enabled_any memalign memalign_hack && enabled need_memalign ; then die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."fienabled 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 check_header sys/select.hfi# check for some common methods of building with pthread support# do this before the optional library checks as some of them require pthreadsif enabled pthreads; then if check_func pthread_create; then : elif check_func pthread_create -pthread; then add_cflags -pthread add_extralibs -pthread elif check_func pthread_create -pthreads; then add_cflags -pthreads add_extralibs -pthreads elif ! check_lib pthread.h pthread_create -lpthread; then die "ERROR: can't find pthreads library" fififor 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" fidonecheck_lib math.h sin -lm# test for C99 functions in math.hfor func in llrint lrint lrintf round roundf; do check_exec <<EOF && enable $func || disable $func#define _ISOC9X_SOURCE 1#include <math.h>int main(void) { return ($func(3.999f) > 0)?0:1; }EOFdone# these are off by default, so fail if requested and not availableenabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32enabled liba52 && require liba52 a52dec/a52.h a52_init -la52enabled libamr_nb && require libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lmenabled libamr_wb && require libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lmenabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaacenabled libfaad && require2 libfaad faad.h faacDecOpen -lfaadenabled libgsm && require libgsm gsm.h gsm_create -lgsmenabled libmp3lame && require LAME lame/lame.h lame_init -lmp3lame -lmenabled libnut && require libnut libnut.h nut_demuxer_init -lnutenabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -loggenabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -loggenabled libx264 && require x264 x264.h x264_encoder_open -lx264enabled libxvid && require Xvid xvid.h xvid_global -lxvidcoreenabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib# disable the native AC-3 decoder if liba52 is enabledenabled liba52 && disable ac3_decoder# libdc1394 checkif enabled libdc1394; then { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 && enable libdc1394_2; } || { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 && enable libdc1394_1; } || die "ERROR: No version of libdc1394 found "fi_restrict=for restrict_keyword in restrict __restrict__ __restrict; do check_cc <<EOF && _restrict=$restrict_keyword && breakvoid foo(char * $restrict_keyword p);EOFdonetest "$vhook" = "default" && vhook="$dlopen"if test "$targetos" = cygwin -o "$targetos" = mingw32 && enabled_all static vhook ; then disable vhook echo echo "At the moment vhooks don't work on Cygwin or MinGW static builds." echo "Patches welcome." echofiif enabled vhook; then check_ldflags -rdynamic check_ldflags -export-dynamicficheck_foo_config imlib2 imlib2 Imlib2.h imlib_load_fontcheck_foo_config freetype2 freetype ft2build.h FT_Init_FreeType########################################### SDL checkdisable sdl_too_olddisable sdlSDL_CONFIG="${cross_prefix}sdl-config"if "${SDL_CONFIG}" --version >/dev/null 2>&1; then sdl_cflags=`"${SDL_CONFIG}" --cflags` temp_cflags $sdl_cflags temp_extralibs `"${SDL_CONFIG}" --libs` if check_lib2 SDL.h SDL_Init; then _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'` if test "$_sdlversion" -lt 121 ; then enable sdl_too_old else enable sdl check_cc $sdl_cflags <<EOF && enable sdl_video_size#include <SDL.h>int main(int argc, char **argv){ const SDL_VideoInfo *vi = SDL_GetVideoInfo(); int w = vi->current_w; return 0;}EOF fi fi restore_flagsfitexi2html -version >/dev/null 2>&1 && enable texi2html || disable texi2htmlcheck_type sys/socket.h socklen_t########################################### Network checkif enabled network; then # Prefer arpa/inet.h over winsock2 if check_header arpa/inet.h ; then check_func closesocket elif check_header winsock2.h ; then network_extralibs="-lws2_32" check_type ws2tcpip.h socklen_t check_func2 winsock2.h closesocket fifi########################################### IPv6 checkenabled network && enabled ipv6 && check_ld <<EOF && enable ipv6 || disable ipv6#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>int main(void) { struct sockaddr_storage saddr; struct ipv6_mreq mreq6; getaddrinfo(0,0,0,0); getnameinfo(0,0,0,0,0,0,0); IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);}EOFcheck_header linux/videodev.hcheck_header linux/videodev2.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -