X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=9cd4fe6b471c36b4de92ca8474c25a175fb63f83;hb=ee164727dd64c199b87118917e674b17c25e0da3;hp=93edc998dccf50dfc30a916bb581d068072f5a6e;hpb=fe7bc1f16abaefe66d8a20f734ca3eb8a4ce4d43;p=ffmpeg diff --git a/configure b/configure index 93edc998dcc..9cd4fe6b471 100755 --- a/configure +++ b/configure @@ -77,7 +77,7 @@ Help options: --list-filters show all available filters Standard options: - --logfile=FILE log tests and output to FILE [config.log] + --logfile=FILE log tests and output to FILE [avbuild/config.log] --disable-logging do not log configure debug information --prefix=PREFIX install in PREFIX [$prefix_default] --bindir=DIR install binaries in DIR [PREFIX/bin] @@ -188,6 +188,7 @@ External library support: themselves, not all their features will necessarily be usable by Libav. --enable-avisynth video frameserver + --enable-avxsynth Linux version of AviSynth --enable-bzlib bzip2 compression [autodetect] --enable-frei0r video filtering plugins --enable-gnutls crypto @@ -283,7 +284,6 @@ Toolchain options: --extra-libs=ELIBS add ELIBS [$ELIBS] --extra-version=STRING version string suffix [] --optflags=OPTFLAGS override optimization-related compiler flags - --build-suffix=SUFFIX library name suffix [] --enable-pic build position-independent code --enable-thumb compile for Thumb instruction set --enable-lto use link-time optimization @@ -348,6 +348,8 @@ Developer options (useful when working on Libav itself): --random-seed=VALUE seed value for --enable/disable-random --disable-valgrind-backtrace do not print a backtrace under Valgrind (only applies to --disable-optimizations builds) + --ignore-tests=TESTS comma-separated list (without "fate-" prefix + in the name) of tests whose result is ignored NOTE: Object files are built at the place where configure is launched. EOF @@ -429,7 +431,7 @@ filter(){ pat=$1 shift for v; do - eval "case $v in $pat) echo $v ;; esac" + eval "case $v in $pat) printf '%s ' $v ;; esac" done } @@ -437,7 +439,7 @@ filter_out(){ pat=$1 shift for v; do - eval "case $v in $pat) ;; *) echo $v ;; esac" + eval "case $v in $pat) ;; *) printf '%s ' $v ;; esac" done } @@ -716,6 +718,10 @@ add_cflags(){ append CFLAGS $($cflags_filter "$@") } +add_cflags_headers(){ + append CFLAGS_HEADERS $($cflags_filter "$@") +} + add_asflags(){ append ASFLAGS $($asflags_filter "$@") } @@ -865,7 +871,7 @@ check_code(){ check_cppflags(){ log check_cppflags "$@" - check_cc "$@" < $logfile set >> $logfile @@ -2792,7 +2828,7 @@ case "$toolchain" in ;; *-tsan) cc_default="${toolchain%-tsan}" - add_cflags -fsanitize=thread -pie + add_cflags -fsanitize=thread -fPIE add_ldflags -fsanitize=thread -pie case "$toolchain" in gcc-tsan) @@ -2880,7 +2916,7 @@ test -n "$cross_prefix" && enable cross_compile if enabled cross_compile; then test -n "$arch" && test -n "$target_os" || - die "Must specify target arch and OS when cross-compiling" + die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling" fi ar_default="${cross_prefix}${ar_default}" @@ -3019,8 +3055,6 @@ msvc_common_flags(){ -mthumb) ;; -march=*) ;; -lz) echo zlib.lib ;; - -lavifil32) echo vfw32.lib ;; - -lavicap32) echo vfw32.lib user32.lib ;; -lx264) echo libx264.lib ;; -l*) echo ${flag#-l}.lib ;; -L*) echo -libpath:${flag#-L} ;; @@ -3036,7 +3070,7 @@ msvc_flags(){ -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \ -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \ -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \ - -wd4273 -wd4554 -wd4701 ;; + -wd4273 -wd4554 -wd4701 -wd4703 ;; esac done } @@ -3253,6 +3287,7 @@ probe_cc(){ _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' _cflags_speed="-O2" _cflags_size="-O1" + _cflags_noopt="-O1" if $_cc -nologo- 2>&1 | grep -q Linker; then _ld_o='-out:$@' else @@ -3786,7 +3821,7 @@ case $target_os in haiku) prefix_default="/boot/common" network_extralibs="-lnetwork" - host_libs= + host_extralibs= ;; sunos) SHFLAGS='-shared -Wl,-h,$$(@F)' @@ -3831,8 +3866,8 @@ case $target_os in enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress add_ldflags -Wl,-dynamic,-search_paths_first SLIBSUF=".dylib" - SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)' - SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)' + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)' objformat="macho" enabled x86_64 && objformat="macho64" enabled_any pic shared || @@ -3860,8 +3895,8 @@ case $target_os in shlibdir_default="$bindir_default" SLIBPREF="" SLIBSUF=".dll" - SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' - SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)' SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS= @@ -3885,8 +3920,8 @@ case $target_os in shlibdir_default="$bindir_default" SLIBPREF="" SLIBSUF=".dll" - SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' - SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)' SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS= @@ -3902,12 +3937,12 @@ case $target_os in shlibdir_default="$bindir_default" SLIBPREF="cyg" SLIBSUF=".dll" - SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' - SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' SLIB_INSTALL_LINKS= - SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a' - SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' + SLIB_INSTALL_EXTRA_LIB='lib$(NAME).dll.a' + SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(NAME).dll.a' objformat="win32" enable dos_paths ;; @@ -3972,17 +4007,6 @@ case $target_os in ;; minix) ;; - plan9) - add_cppflags -D_C99_SNPRINTF_EXTENSION \ - -D_REENTRANT_SOURCE \ - -D_RESEARCH_SOURCE \ - -DFD_SETSIZE=96 \ - -DHAVE_SOCK_OPTS - add_compat strtod.o strtod=avpriv_strtod - network_extralibs='-lbsd' - exeobjs=compat/plan9/main.o - cp_f='cp' - ;; none) ;; *) @@ -4005,7 +4029,7 @@ probe_libc(){ # MinGW headers can be installed on Cygwin, so check for newlib first. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then eval ${pfx}libc_type=newlib - add_${pfx}cppflags -U__STRICT_ANSI__ + add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600 # MinGW64 is backwards compatible with MinGW32, so check for it first. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then eval ${pfx}libc_type=mingw64 @@ -4103,7 +4127,7 @@ esc(){ echo "$*" | sed 's/%/%25/g;s/:/%3a/g' } -echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" >config.fate +echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" > avbuild/config.fate check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic @@ -4121,16 +4145,6 @@ EOF exit 1 fi -die_license_disabled() { - enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; } -} - -map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST -map "die_license_disabled nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST $HWACCEL_LIBRARY_NONFREE_LIST -map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST - -enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; } - disabled optimizations || check_cflags -fomit-frame-pointer enable_weak_pic() { @@ -4488,7 +4502,7 @@ check_func ${malloc_prefix}posix_memalign && enable posix_memalign check_cpp_condition unistd.h "defined(_POSIX_MONOTONIC_CLOCK)" && check_func_headers time.h clock_gettime || - { check_lib time.h clock_gettime -lrt && LIBRT="-lrt"; } + { check_lib clock_gettime time.h clock_gettime -lrt && LIBRT="-lrt"; } check_func fcntl check_func fork @@ -4504,7 +4518,7 @@ check_func mkstemp check_func mmap check_func mprotect # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that -check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt; } +check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt check_func sched_getaffinity check_func setrlimit check_func strerror_r @@ -4515,7 +4529,6 @@ check_func usleep check_func_headers io.h setmode check_func_headers stdlib.h getenv -check_func_headers windows.h CoTaskMemFree -lole32 check_func_headers windows.h GetProcessAffinityMask check_func_headers windows.h GetProcessTimes check_func_headers windows.h GetSystemTimeAsFileTime @@ -4526,9 +4539,9 @@ check_func_headers windows.h Sleep check_func_headers windows.h VirtualAlloc check_struct windows.h "CONDITION_VARIABLE" Ptr +check_header d3d11.h check_header direct.h check_header dlfcn.h -check_header d3d11.h check_header dxva.h check_header dxva2api.h check_header io.h @@ -4543,8 +4556,6 @@ check_header sys/time.h check_header sys/un.h check_header unistd.h check_header valgrind/valgrind.h -check_header vdpau/vdpau.h -check_header vdpau/vdpau_x11.h check_header VideoDecodeAcceleration/VDADecoder.h check_header windows.h check_header X11/extensions/XvMClib.h @@ -4554,9 +4565,9 @@ check_header X11/extensions/XvMClib.h # so we also check that atomics actually work here check_builtin stdatomic_h stdatomic.h "atomic_int foo; atomic_store(&foo, 0)" -check_lib "windows.h shellapi.h" CommandLineToArgvW -lshell32 -check_lib "windows.h wincrypt.h" CryptGenRandom -ladvapi32 -check_lib "windows.h psapi.h" GetProcessMemoryInfo -lpsapi +check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32 +check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom -ladvapi32 +check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss @@ -4564,6 +4575,7 @@ check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMIL check_type "windows.h d3d11.h" "ID3D11VideoDecoder" check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602 +check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC" check_type "va/va.h va/va_dec_vp8.h" "VAPictureParameterBufferVP8" check_type "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer" check_type "va/va.h va/va_enc_h264.h" "VAEncPictureParameterBufferH264" @@ -4573,60 +4585,56 @@ check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG" check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC" if ! disabled w32threads && ! enabled pthreads; then - check_func_headers "windows.h process.h" _beginthreadex && - enable w32threads || disable w32threads + check_lib w32threads "windows.h process.h" _beginthreadex 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 ! disabled pthreads && ! enabled w32threads; then - enable pthreads - if check_func pthread_join -pthread; then + if check_lib pthreads pthread.h pthread_join -pthread; then add_cflags -pthread - add_extralibs -pthread - elif check_func pthread_join -pthreads; then + elif check_lib pthreads pthread.h pthread_join -pthreads; then add_cflags -pthreads - add_extralibs -pthreads - elif check_func pthread_join -lpthreadGC2; then - add_extralibs -lpthreadGC2 - elif check_lib pthread.h pthread_join -lpthread; then + elif check_lib pthreads pthread.h pthread_join -lpthreadGC2; then : - elif ! check_func pthread_join; then - disable pthreads + elif check_lib pthreads pthread.h pthread_join -lpthread; then + : + elif check_func pthread_join; then + enable pthreads fi fi enabled pthreads && check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" -disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib -disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib +disabled zlib || check_lib zlib zlib.h zlibVersion -lz +disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 -check_lib math.h sin -lm && LIBM="-lm" +check_lib libm math.h sin -lm && LIBM="-lm" atan2f_args=2 ldexpf_args=2 powf_args=2 for func in $MATH_FUNCS; do - eval check_mathfunc $func \${${func}_args:-1} + eval check_mathfunc $func \${${func}_args:-1} $LIBM done # these are off by default, so fail if requested and not available -enabled avisynth && { check_lib "avisynth/avisynth_c.h windows.h" LoadLibrary || - check_lib "avxsynth/avxsynth_c.h dlfcn.h" dlopen -ldl || - die "ERROR: LoadLibrary/dlopen not found, or avisynth header not found"; } -enabled cuda && check_lib cuda.h cuInit -lcuda +enabled avisynth && { check_header avisynth/avisynth_c.h || die "ERROR: avisynth/avisynth_c.h header not found"; } +enabled avxsynth && require avxsynth "avxsynth/avxsynth_c.h dlfcn.h" dlopen -ldl +enabled cuda && require cuda cuda.h cuInit -lcuda enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open +enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec enabled libfaac && require libfaac "stdint.h faac.h" faacEncGetVersion -lfaac enabled libfdk_aac && require_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit enabled libfreetype && require_pkg_config freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do - check_lib "${gsm_hdr}" gsm_create -lgsm && break; + check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break; done || die "ERROR: libgsm not found"; } enabled libhdcd && require_pkg_config libhdcd "hdcd/hdcd_simple.h" hdcd_new enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc @@ -4638,13 +4646,13 @@ enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb enabled libopencv && require_pkg_config opencv opencv/cv.h cvCreateImageHeader enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion -enabled libopenjpeg && { check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || +enabled libopenjpeg && { check_lib libopenjpeg openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC || require_pkg_config libopenjpeg1 openjpeg.h opj_version -DOPJ_STATIC; } enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create 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 libsnappy && require libsnappy 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 @@ -4684,41 +4692,26 @@ enabled libx265 && require_pkg_config x265 x265.h x265_api_get && die "ERROR: libx265 version must be >= 57."; } enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode -lxavs enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore -enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host || - { ! enabled cross_compile && { - add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ; - add_extralibs -L/opt/vc/lib/ -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ; - check_lib interface/mmal/mmal.h mmal_port_connect ; } - check_lib interface/mmal/mmal.h mmal_port_connect ; } || - die "ERROR: mmal not found"; } -enabled mmal && check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS" -enabled omx_rpi && enable omx -enabled omx && { check_header OMX_Core.h || - { ! enabled cross_compile && enabled omx_rpi && { - add_cflags -isystem/opt/vc/include/IL ; } - check_header OMX_Core.h ; } || +enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host || + { ! enabled cross_compile && + add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline && + add_ldflags -L/opt/vc/lib/ && + check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } || + die "ERROR: mmal not found" && + check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; } +enabled omx_rpi && { check_header OMX_Core.h || + { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } || die "ERROR: OpenMAX IL headers not found"; } +enabled omx && { check_header OMX_Core.h || die "ERROR: OpenMAX IL headers not found"; } enabled openssl && { { check_pkg_config openssl openssl/ssl.h OPENSSL_init_ssl || check_pkg_config openssl openssl/ssl.h SSL_library_init; } && { - add_cflags $openssl_cflags && add_extralibs $openssl_libs; }|| - 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 || + add_cflags $openssl_cflags && add_extralibs $openssl_extralibs; } || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || die "ERROR: openssl not found"; } -if enabled gnutls; then - { check_lib gmp.h mpz_export -lgmp && enable gmp; } || - { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; } -fi - -# libdc1394 check -if enabled libdc1394; then - { require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new && - 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 +enabled gnutls && check_lib gmp gmp.h mpz_export -lgmp if enabled nvenc; then check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found." @@ -4739,14 +4732,12 @@ 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 AVFoundation/AVFoundation.h check_header sys/videoio.h -check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs" +check_lib user32 "windows.h winuser.h" GetShellWindow -luser32 +check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32 # check that WM_CAP_DRIVER_CONNECT is defined to the proper value # w32api 3.12 had it defined wrong check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines @@ -4760,21 +4751,20 @@ check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_def check_header dev/video/bktr/ioctl_bt848.h; } || check_header dev/ic/bt8xx.h -check_header sndio.h check_header sys/soundcard.h check_header soundcard.h enabled_any alsa_indev alsa_outdev && - check_lib alsa/asoundlib.h snd_pcm_htimestamp -lasound + check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound -enabled jack_indev && check_lib jack/jack.h jack_client_open -ljack && +enabled jack_indev && check_lib jack jack/jack.h jack_client_open -ljack && check_func jack_port_get_latency_range -ljack -enabled_any sndio_indev sndio_outdev && check_lib sndio.h sio_open -lsndio +enabled_any sndio_indev sndio_outdev && check_lib sndio sndio.h sio_open -lsndio if enabled libcdio; then - check_lib "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || - check_lib "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || + check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || + check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || die "ERROR: No usable libcdio/cdparanoia found" fi @@ -4793,10 +4783,13 @@ if enabled libxcb; then enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found"; } && enable libxcb_xfixes - add_cflags "$xcb_shape_cflags $xcb_event_cflags $xcb_shm_cflags $xcb_xfixes_cflags" - add_extralibs "$xcb_shape_libs $xcb_event_libs $xcb_shm_libs $xcb_xfixes_libs" + add_cflags "$xcb_shape_cflags $xcb_shm_cflags $xcb_xfixes_cflags" + add_extralibs "$xcb_shape_extralibs $xcb_shm_extralibs $xcb_xfixes_extralibs" fi +enabled dxva2 && + check_lib dxva2_lib windows.h CoTaskMemFree -lole32 + enabled vaapi && require vaapi va/va.h vaInitialize -lva enabled vaapi && @@ -4804,22 +4797,17 @@ enabled vaapi && disable vaapi enabled vaapi && - check_lib "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm && - enable vaapi_drm + check_lib vaapi_drm "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm + +enabled vaapi && + check_lib vaapi_x11 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11 enabled vdpau && check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || disable vdpau -enabled_any vaapi vdpau && check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib - -enabled vaapi && enabled xlib && - check_lib "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 && - enable vaapi_x11 - -enabled vdpau && enabled xlib && - check_lib "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau && - enable vdpau_x11 +enabled vdpau && + check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11 enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" @@ -4834,8 +4822,12 @@ 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 + +if enabled extra_warnings; then + check_cflags -Wcast-qual + check_cflags -Wextra + check_cflags -Wpedantic +fi check_disable_warning(){ warning_flag=-W${1#-Wno-} @@ -4847,6 +4839,16 @@ check_disable_warning -Wno-switch check_disable_warning -Wno-format-zero-length check_disable_warning -Wno-pointer-sign +check_disable_warning_headers(){ + warning_flag=-W${1#-Wno-} + test_cflags $warning_flag && add_cflags_headers $1 +} + +check_disable_warning_headers -Wno-deprecated-declarations +check_disable_warning_headers -Wno-unused-variable + +check_objcflags -fobjc-arc && enable objc_arc + # add some linker flags check_ldflags -Wl,--warn-common check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample @@ -5054,9 +5056,6 @@ case $target_os in osf1) enabled ccc && add_ldflags '-Wl,-expect_unresolved,*' ;; - plan9) - add_cppflags -Dmain=plan9_main - ;; esac enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } @@ -5066,10 +5065,6 @@ check_deps $CONFIG_LIST \ $HAVE_LIST \ $ALL_COMPONENTS \ -enabled_all dxva2 CoTaskMemFree && - prepend avconv_libs $($ldflags_filter "-lole32") && - enable dxva2_lib - map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST for thread in $THREADS_LIST; do @@ -5100,7 +5095,8 @@ enabled zlib && add_cppflags -DZLIB_CONST # conditional library dependencies, in linking order enabled movie_filter && prepend avfilter_deps "avformat avcodec" -enabled resample_filter && prepend avfilter_deps "avresample" +enabled_any asyncts_filter resample_filter && + prepend avfilter_deps "avresample" enabled scale_filter && prepend avfilter_deps "swscale" enabled opus_decoder && prepend avcodec_deps "avresample" @@ -5125,9 +5121,6 @@ if test "$host_cc" != "$cc"; then echo "host C library $host_libc_type" fi echo "ARCH $arch ($cpu)" -if test "$build_suffix" != ""; then - echo "build suffix $build_suffix" -fi if test "$extra_version" != ""; then echo "version string suffix $extra_version" fi @@ -5202,6 +5195,13 @@ for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf ind echo done +if test -n "$ignore_tests"; then + ignore_tests=$(echo $ignore_tests | tr ',' ' ') + echo "Ignored FATE tests:" + echo $ignore_tests | print_3_columns + echo +fi + license="LGPL version 2.1 or later" if enabled nonfree; then license="nonfree and unredistributable" @@ -5221,9 +5221,9 @@ fi # test "$quiet" != "yes" test -e Makefile || echo "include $source_path/Makefile" > Makefile -config_files="$TMPH config.mak" +config_files="$TMPH avbuild/config.mak" -cat > config.mak < avbuild/config.mak <> config.mak - eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak - eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak -} - -map 'get_version $v' $LIBRARY_LIST - -map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST +map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> avbuild/config.mak' $LIBRARY_LIST -print_program_libs(){ - eval "program_libs=\$${1}_libs" - eval echo "LIBS-${1}=${program_libs}" >> config.mak +print_program_extralibs(){ + eval "program_extralibs=\$${1}_extralibs" + eval echo "EXTRALIBS-${1}=${program_extralibs}" >> avbuild/config.mak } -map 'print_program_libs $v' $PROGRAM_LIST +map 'print_program_extralibs $v' $PROGRAM_LIST cat > $TMPH <> $TMPH # Do not overwrite an unchanged config.h to avoid superfluous rebuilds. cp_if_changed $TMPH config.h -touch .config +touch avbuild/.config enabled yasm && cp_if_changed $TMPASM config.asm @@ -5421,58 +5407,27 @@ print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $ test -n "$WARNINGS" && printf "\n$WARNINGS" -# build pkg-config files - -lib_version(){ - eval printf "\"lib${1} >= \$LIB$(toupper ${1})_VERSION, \"" -} +# Settings for pkg-config files -pkgconfig_generate(){ - name=$1 - shortname=${name#lib}${build_suffix} - comment=$2 - version=$3 - libs=$4 - requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps)) - requires=${requires%, } - enabled ${name#lib} || return 0 - mkdir -p $name - cat < $name/$name.pc +cat > avbuild/config.sh < $name/$name-uninstalled.pc -prefix= -exec_prefix= -libdir=\${pcfiledir} -includedir=${source_path} - -Name: $name -Description: $comment -Version: $version -Requires: $requires -Conflicts: -Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs -Cflags: -I\${includedir} -EOF -} -pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM" -pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" -pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs" -pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" -pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" -pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM" -pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" +for lib in $LIBRARY_LIST; do + lib_deps="$(eval echo \$${lib}_deps)" + echo ${lib}_deps=\"$lib_deps\" >> avbuild/config.sh +done