X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=1bfd3e92442dc0a0a29d4177cde127b8583a4756;hb=0e9c4fe254073b209970df3e3cb84531bc388e99;hp=5bcc2dfe93ebabb8d8e7ff0bf3a693b839c9b210;hpb=3b5e5e6a29d62462d0505287042fa4c2b99c4f2b;p=ffmpeg diff --git a/configure b/configure index 5bcc2dfe93e..1bfd3e92442 100755 --- a/configure +++ b/configure @@ -133,6 +133,7 @@ Component options: --disable-faan disable floating point AAN (I)DCT code Hardware accelerators: + --enable-d3d11va enable D3D11VA code --enable-dxva2 enable DXVA2 code --enable-vaapi enable VAAPI code --enable-vda enable VDA code @@ -190,6 +191,7 @@ External library support: --enable-libfreetype enable libfreetype [no] --enable-libgsm enable GSM de/encoding via libgsm [no] --enable-libilbc enable iLBC de/encoding via libilbc [no] + --enable-libkvazaar enable HEVC encoding via libkvazaar [no] --enable-libmfx enable HW acceleration through libmfx --enable-libmp3lame enable MP3 encoding via libmp3lame [no] --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no] @@ -201,6 +203,7 @@ External library support: --enable-libpulse enable Pulseaudio input via libpulse [no] --enable-librtmp enable RTMP[E] support via librtmp [no] --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no] + --enable-libsnappy enable Snappy compression [no] --enable-libspeex enable Speex de/encoding via libspeex [no] --enable-libtheora enable Theora encoding via libtheora [no] --enable-libtwolame enable MP2 encoding via libtwolame [no] @@ -219,6 +222,7 @@ External library support: --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] --enable-mmal enable decoding via MMAL [no] + --enable-nvenc enable encoding via NVENC [no] --enable-openssl enable openssl [no] --enable-x11grab enable X11 grabbing (legacy) [no] --enable-zlib enable zlib [autodetect] @@ -240,6 +244,7 @@ Toolchain options: --ar=AR use archive tool AR [$ar_default] --as=AS use assembler AS [$as_default] --cc=CC use C compiler CC [$cc_default] + --objcc=OCC use ObjC compiler OCC [$cc_default] --dep-cc=DEPCC use dependency generator DEPCC [$cc_default] --ld=LD use linker LD --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default] @@ -252,6 +257,7 @@ Toolchain options: --host-libs=HLIBS use libs HLIBS when linking for host --host-os=OS compiler host OS [$target_os] --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS] + --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS] --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS] --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS] --extra-libs=ELIBS add ELIBS [$ELIBS] @@ -261,9 +267,11 @@ Toolchain options: --enable-pic build position-independent code --enable-thumb compile for Thumb instruction set --enable-lto use link-time optimization + --env="ENV=override" override the environment variables Advanced options (experts only): --malloc-prefix=PREFIX prefix malloc and related names with PREFIX + --custom-allocator=NAME use a supported custom allocator --disable-symver disable symbol versioning --enable-hardcoded-tables use hardcoded tables instead of runtime generation --disable-safe-bitstream-reader @@ -275,6 +283,8 @@ Advanced options (experts only): Optimization options (experts only): --disable-asm disable all assembly optimizations --disable-altivec disable AltiVec optimizations + --disable-vsx disable VSX optimizations + --disable-power8 disable POWER8 optimizations --disable-amd3dnow disable 3DNow! optimizations --disable-amd3dnowext disable 3DNow! extended optimizations --disable-mmx disable MMX optimizations @@ -333,7 +343,11 @@ log(){ log_file(){ log BEGIN $1 - pr -n -t $1 >> $logfile + i=1 + while read line; do + printf '%5s %s\n' "${i}" "${line}" + i=$(($i+1)) + done < $1 >> $logfile log END $1 } @@ -473,8 +487,15 @@ enable(){ set_all yes $* } +check_requested() { + for var; do + eval test "x\$${var#!}_requested" = "xyes" && die "${var#*_} ${var/_*} cannot be enabled" + done +} + disable(){ set_all no $* + check_requested $* } enable_weak(){ @@ -525,6 +546,28 @@ enable_deep_weak(){ done } +do_enable_deep_force(){ + for var; do + enabled $var && continue + eval sel="\$${var}_select\ \$${var}_suggest\ \$${var}_select_any" + pushvar var + enable_deep_force $sel + popvar var + done +} + +enable_deep_force(){ + do_enable_deep_force $* + enable $* +} + +request(){ + for var; do + enable ${var}_requested + done + enable_deep_force $* +} + enabled(){ test "${1#!}" = "$1" && op== || op=!= eval test "x\$${1#!}" $op "xyes" @@ -584,7 +627,7 @@ do_check_deps(){ append allopts $cfg eval dep_all="\$${cfg}_deps" - eval dep_any="\$${cfg}_deps_any" + eval dep_any="\$${cfg}_deps_any\ \$${cfg}_select_any" eval dep_sel="\$${cfg}_select" eval dep_sgs="\$${cfg}_suggest" eval dep_ifa="\$${cfg}_if" @@ -687,6 +730,10 @@ add_asflags(){ append ASFLAGS $($asflags_filter "$@") } +add_objcflags(){ + append OBJCFLAGS $($objcflags_filter "$@") +} + add_ldflags(){ append LDFLAGS $($ldflags_filter "$@") } @@ -741,6 +788,13 @@ check_cc(){ check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC } +check_objcc(){ + log check_objcc "$@" + cat > $TMPC + log_file $TMPC + check_cmd $objcc $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPC +} + check_cpp(){ log check_cpp "$@" cat > $TMPC @@ -839,6 +893,19 @@ check_cflags(){ test_cflags "$@" && add_cflags "$@" } +test_objcflags(){ + log test_cflags "$@" + set -- $($cflags_filter "$@") + check_objcc "$@" < $logfile set >> $logfile @@ -2568,9 +2769,14 @@ case "$toolchain" in else cc_default="c99wrap cl" fi - ld_default="link" + ld_default="$source_path/compat/windows/mslink" nm_default="dumpbin -symbols" ar_default="lib" + case "$arch" in + arm*) + as_default="armasm" + ;; + esac target_os_default="win32" # Use a relative path for TMPDIR. This makes sure all the # ffconf temp files are written with a relative path, avoiding @@ -2609,6 +2815,7 @@ fi ar_default="${cross_prefix}${ar_default}" cc_default="${cross_prefix}${cc_default}" +occ_default="${cross_prefix}${occ_default}" nm_default="${cross_prefix}${nm_default}" pkg_config_default="${cross_prefix}${pkg_config_default}" ranlib="${cross_prefix}${ranlib}" @@ -2863,8 +3070,8 @@ probe_cc(){ if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then _type=llvm_gcc - gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') - _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" + gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)') + _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver" _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O3' _cflags_size='-Os' @@ -2927,7 +3134,7 @@ probe_cc(){ _flags_filter=tms470_flags elif $_cc -v 2>&1 | grep -q clang; then _type=clang - _ident=$($_cc --version | head -n1) + _ident=$($_cc --version 2>/dev/null | head -n1) _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O3' _cflags_size='-Os' @@ -2968,14 +3175,14 @@ probe_cc(){ # 4509: "This form of conditional instruction is deprecated" _flags="-nologo -ignore 4509" _flags_filter=armasm_flags - elif $_cc 2>&1 | grep -q Microsoft; then + elif $_cc -nologo- 2>&1 | grep -q Microsoft; then _type=msvc _ident=$($_cc 2>&1 | head -n1) _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)' _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' _cflags_speed="-O2" _cflags_size="-O1" - if $_cc 2>&1 | grep -q Linker; then + if $_cc -nologo- 2>&1 | grep -q Linker; then _ld_o='-out:$@' else _ld_o='-Fe$@' @@ -2986,10 +3193,7 @@ probe_cc(){ _ld_lib='lib%.a' _ld_path='-libpath:' _flags='-nologo' - _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64' - if [ $pfx = hostcc ]; then - append _cflags -Dsnprintf=_snprintf - fi + _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS' elif $_cc 2>&1 | grep -q Intel; then _type=icl _ident=$($_cc 2>&1 | head -n1) @@ -3012,10 +3216,7 @@ probe_cc(){ _flags='-nologo -Qdiag-error:4044,10157' # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency # with MSVC which enables it by default. - _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS' - if [ $pfx = hostcc ]; then - append _cflags -Dsnprintf=_snprintf - fi + _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS' elif $_cc --version 2>/dev/null | grep -q ^cparser; then _type=cparser _ident=$($_cc --version | head -n1) @@ -3061,16 +3262,22 @@ test -n "$cc_type" && enable $cc_type || warn "Unknown C compiler $cc, unable to select optimal CFLAGS" : ${as_default:=$cc} +: ${objcc_default:=$cc} : ${dep_cc_default:=$cc} : ${ld_default:=$cc} : ${host_ld_default:=$host_cc} -set_default ar as dep_cc ld host_ld +set_default ar as objcc dep_cc ld host_ld probe_cc as "$as" asflags_filter=$_flags_filter add_asflags $_flags $_cflags set_ccvars AS +probe_cc objcc "$objcc" +objcflags_filter=$_flags_filter +add_objcflags $_flags $_cflags +set_ccvars OBJC + probe_cc ld "$ld" ldflags_filter=$_flags_filter add_ldflags $_flags $_ldflags @@ -3106,6 +3313,7 @@ else fi add_cflags $extra_cflags +add_objcflags $extra_objcflags add_asflags $extra_cflags if test -n "$sysroot"; then @@ -3152,6 +3360,16 @@ case "$arch" in arch="arm" ;; mips*|IP*) + case "$arch" in + *el) + add_cppflags -EL + add_ldflags -EL + ;; + *eb) + add_cppflags -EB + add_ldflags -EB + ;; + esac arch="mips" ;; parisc*|hppa*) @@ -3306,19 +3524,28 @@ elif enabled ppc; then ;; g4|745*|ppc745*|powerpc745*) cpuflags="-mcpu=7450" + disable vsx ;; 74*|ppc74*|powerpc74*) cpuflags="-mcpu=7400" + disable vsx ;; g5|970|ppc970|powerpc970) cpuflags="-mcpu=970" + disable vsx ;; - power[3-7]*) + power[3-6]*) cpuflags="-mcpu=$cpu" + disable vsx + ;; + power[7-8]*) + cpuflags="-mcpu=$cpu" + enable ldbrx ;; cell) cpuflags="-mcpu=cell" enable ldbrx + disable vsx ;; e500mc) cpuflags="-mcpu=e500mc" @@ -3379,6 +3606,7 @@ fi if [ "$cpu" != generic ]; then add_cflags $cpuflags add_asflags $cpuflags + test "$cc_type" = "$ld_type" && add_ldflags $cpuflags fi # compiler sanity check @@ -3463,8 +3691,7 @@ case $target_os in enable section_data_rel_ro SLIB_INSTALL_NAME='$(SLIBNAME)' SLIB_INSTALL_LINKS= - # soname not set on purpose - SHFLAGS=-shared + SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)' ;; haiku) prefix_default="/boot/common" @@ -3484,6 +3711,7 @@ case $target_os in echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile nm_default='nm -P -g' + SLIB_CREATE_DEF_CMD='$(Q)perl $(SRC_PATH)/compat/solaris/make_sunver.pl $$(filter %.ver,$$^) $(OBJS) | grep -v @ > $(SUBDIR)lib$(NAME).ver-sol2' ;; netbsd) disable symver @@ -3519,6 +3747,9 @@ case $target_os in enabled_any pic shared || { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; } ;; + msys*) + die "Native MSYS builds are discouraged, please use the MINGW environment."; + ;; mingw32*) if test $target_os = "mingw32ce"; then disable network @@ -3613,11 +3844,10 @@ case $target_os in SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)' SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \ - echo PROTMODE >> $(SUBDIR)$(NAME).def; \ echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \ echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \ echo EXPORTS >> $(SUBDIR)$(NAME).def; \ - emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def' + emxexp $(OBJS) >> $(SUBDIR)$(NAME).def' SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \ emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib' @@ -3700,14 +3930,35 @@ probe_libc(){ add_${pfx}cppflags -D__printf__=__gnu_printf__ elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then eval ${pfx}libc_type=msvcrt + if check_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then + if [ "$pfx" = host_ ]; then + add_host_cppflags -Dsnprintf=_snprintf + else + add_compat strtod.o strtod=avpriv_strtod + add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ + _snprintf=avpriv_snprintf \ + vsnprintf=avpriv_vsnprintf + fi + fi # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to # 0x601 by default unless something else is set by the user. # This can easily lead to us detecting functions only present # in such new versions and producing binaries requiring windows 7.0. # Therefore explicitly set the default to XP unless the user has # set something else on the command line. + # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop + # family. For these cases, configure is free to use any functions + # found in the SDK headers by default. (Alternatively, we could force + # _WIN32_WINNT to 0x0602 in that case.) check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" || - add_${pfx}cppflags -D_WIN32_WINNT=0x0502 + { check_${pfx}cpp < +#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#error not desktop +#endif +#endif +EOF elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then eval ${pfx}libc_type=klibc elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then @@ -3730,12 +3981,6 @@ case $libc_type in bionic) add_compat strtod.o strtod=avpriv_strtod ;; - msvcrt) - add_compat strtod.o strtod=avpriv_strtod - add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ - _snprintf=avpriv_snprintf \ - vsnprintf=avpriv_vsnprintf - ;; esac # hacks for compiler/libc/os combinations @@ -3790,6 +4035,7 @@ die_license_disabled gpl x11grab die_license_disabled nonfree libfaac die_license_disabled nonfree libfdk_aac +die_license_disabled nonfree nvenc die_license_disabled nonfree openssl die_license_disabled version3 libopencore_amrnb @@ -3913,12 +4159,15 @@ elif enabled alpha; then elif enabled arm; then + enabled msvc && check_cpp_condition stddef.h "defined _M_ARMT" && enable thumb check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb enabled thumb && check_cflags -mthumb || check_cflags -marm if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then enable vfp_args - elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then + elif check_cpp_condition stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then + enable vfp_args + elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then case "${cross_prefix:-$cc}" in *hardfloat*) enable vfp_args; fpabi=vfp ;; *) check_ld <= 0.8.1" kvazaar.h kvz_api_get enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb @@ -4249,25 +4535,42 @@ enabled libopus && require_pkg_config opus opus_multistream.h opus_mul enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init +enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg -enabled libvpx && { - enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx || - die "ERROR: libvpx decoder version must be >=0.9.1"; } - enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx || - die "ERROR: libvpx encoder version must be >=0.9.6"; } - enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; } - enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } } +enabled libvpx && require_pkg_config "vpx >= 1.3.0" vpx/vpx_codec.h vpx_codec_version && { + enabled libvpx_vp8_decoder && { + check_pkg_config vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx || + disable libvpx_vp8_decoder; + } + enabled libvpx_vp8_encoder && { + check_pkg_config vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx || + disable libvpx_vp8_encoder; + } + enabled libvpx_vp9_decoder && { + check_pkg_config vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx || + disable libvpx_vp9_decoder; + } + enabled libvpx_vp9_encoder && { + check_pkg_config vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx || + disable libvpx_vp9_encoder; + } + if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then + die "libvpx enabled but no supported decoders found" + fi +} enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion enabled libx264 && require_pkg_config x264 "stdint.h x264.h" x264_encoder_encode && { check_cpp_condition x264.h "X264_BUILD >= 118" || - die "ERROR: libx264 version must be >= 0.118."; } -enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode && + die "ERROR: libx264 version must be >= 0.118."; } && + { check_cpp_condition x264.h "X264_MPEG2" && + enable libx262; } +enabled libx265 && require_pkg_config x265 x265.h x265_api_get && { check_cpp_condition x265.h "X265_BUILD >= 57" || die "ERROR: libx265 version must be >= 57."; } enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs @@ -4279,13 +4582,14 @@ enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect check_lib interface/mmal/mmal.h mmal_port_connect ; } check_lib interface/mmal/mmal.h mmal_port_connect ; } || die "ERROR: mmal not found"; } -enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || +enabled openssl && { check_pkg_config openssl openssl/ssl.h SSL_library_init || + check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || die "ERROR: openssl not found"; } if enabled gnutls; then - { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } || + { check_lib2 gmp.h mpz_export -lgmp && enable gmp; } || { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; } fi @@ -4298,6 +4602,13 @@ if enabled libdc1394; then die "ERROR: No version of libdc1394 found " fi +if enabled nvenc; then + check_header cuda.h || die "ERROR: cuda.h not found."; + check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; + check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" || + die "ERROR: NVENC API version 4 or older is not supported"; +fi + if check_pkg_config sdl SDL_events.h SDL_PollEvent; then check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags && @@ -4311,6 +4622,11 @@ check_header linux/fb.h check_header linux/videodev2.h check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete +check_header AVFoundation/AVFoundation.h && + check_objcflags -fobjc-arc && + add_extralibs -framework Foundation -framework AVFoundation -framework CoreVideo -framework CoreMedia || + disable AVFoundation_AVFoundation_h + check_header sys/videoio.h check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs" @@ -4393,13 +4709,13 @@ check_cflags -Wall check_cflags -Wdisabled-optimization check_cflags -Wpointer-arith check_cflags -Wredundant-decls -check_cflags -Wcast-qual check_cflags -Wwrite-strings check_cflags -Wtype-limits check_cflags -Wundef check_cflags -Wmissing-prototypes check_cflags -Wstrict-prototypes enabled extra_warnings && check_cflags -Winline +enabled extra_warnings && check_cflags -Wcast-qual check_disable_warning(){ warning_flag=-W${1#-Wno-} @@ -4444,10 +4760,14 @@ enabled xmm_clobber_test && -Wl,--wrap,sws_scale || disable xmm_clobber_test -echo "X{};" > $TMPV +echo "X { local: *; };" > $TMPV if test_ldflags -Wl,--version-script,$TMPV; then append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver' - check_cc <= 12" || disable log2 + # The CRT headers contain __declspec(restrict) in a few places, but if redefining + # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict) + # (as it ends up if the restrict redefine is done before including stdlib.h), while + # MSVC 2013 and newer can handle it fine. + # If this declspec fails, force including stdlib.h before the restrict redefinition + # happens in config.h. + if [ $_restrict != restrict ]; then + check_cc <