X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=4a8d04d21073ac4e2be5e41d2a9c477f2aef86a7;hb=24d5680bbc01fc124709d522d348572ad4672563;hp=e348f3be65937670dbade06272ed94e434c4dee1;hpb=6ef3360a38efe027cb6ebf9785870048ca7eb38b;p=ffmpeg diff --git a/configure b/configure index e348f3be659..4a8d04d2107 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 @@ -347,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 @@ -715,6 +718,10 @@ add_cflags(){ append CFLAGS $($cflags_filter "$@") } +add_cflags_headers(){ + append CFLAGS_HEADERS $($cflags_filter "$@") +} + add_asflags(){ append ASFLAGS $($asflags_filter "$@") } @@ -1001,24 +1008,28 @@ EOF check_lib(){ log check_lib "$@" - headers="$1" - funcs="$2" - shift 2 - check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@" + name="$1" + headers="$2" + funcs="$3" + shift 3 + disable $name + check_func_headers "$headers" "$funcs" "$@" && + enable $name && add_extralibs "$@" } check_pkg_config(){ log check_pkg_config "$@" - pkg="$1" + pkg_version="$1" + pkg="${1%% *}" headers="$2" funcs="$3" shift 3 - check_cmd $pkg_config --exists --print-errors $pkg || return + check_cmd $pkg_config --exists --print-errors $pkg_version || return pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg) pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg) check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && - set_safe "${pkg}_cflags" $pkg_cflags && - set_safe "${pkg}_libs" $pkg_libs + set_safe "${pkg}_cflags" $pkg_cflags && + set_safe "${pkg}_extralibs" $pkg_libs } check_exec(){ @@ -1098,19 +1109,21 @@ check_compile_assert(){ require(){ log require "$@" - name="$1" + name_version="$1" + name="${1%% *}" headers="$2" func="$3" shift 3 - check_lib "$headers" $func "$@" || die "ERROR: $name not found" + check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not found" } require_pkg_config(){ log require_pkg_config "$@" - pkg="$1" - check_pkg_config "$@" || die "ERROR: $pkg not found" + pkg_version="$1" + pkg="${1%% *}" + check_pkg_config "$@" || die "ERROR: $pkg_version not found" add_cflags $(get_safe "${pkg}_cflags") - add_extralibs $(get_safe "${pkg}_libs") + add_extralibs $(get_safe "${pkg}_extralibs") } hostcc_e(){ @@ -1266,6 +1279,7 @@ EXTERNAL_LIBRARY_LIST=" $EXTERNAL_LIBRARY_NONFREE_LIST $EXTERNAL_LIBRARY_VERSION3_LIST avisynth + avxsynth bzlib frei0r gnutls @@ -1348,8 +1362,8 @@ SUBSYSTEM_LIST=" rdft " +# COMPONENT_LIST needs to come last to ensure correct dependency checking CONFIG_LIST=" - $COMPONENT_LIST $EXAMPLE_LIST $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST @@ -1365,6 +1379,7 @@ CONFIG_LIST=" thumb valgrind_backtrace xmm_clobber_test + $COMPONENT_LIST " THREADS_LIST=" @@ -1505,6 +1520,7 @@ HEADERS_LIST=" arpa_inet_h cdio_paranoia_h cdio_paranoia_paranoia_h + d3d11_h dispatch_dispatch_h dev_bktr_ioctl_bt848_h dev_bktr_ioctl_meteor_h @@ -1513,7 +1529,6 @@ HEADERS_LIST=" dev_video_meteor_ioctl_meteor_h direct_h dlfcn_h - d3d11_h dxva_h gsm_h io_h @@ -1624,6 +1639,7 @@ TOOLCHAIN_FEATURES=" asm_mod_q attribute_may_alias attribute_packed + blocks_extension ebp_available ebx_available gnu_as @@ -1705,6 +1721,7 @@ CONFIG_EXTRA=" h264parse h264pred h264qpel + hevc_ps hpeldsp huffman huffyuvdsp @@ -1724,6 +1741,7 @@ CONFIG_EXTRA=" mpeg_er mpegaudio mpegaudiodsp + mpegaudioheader mpegvideo mpegvideoenc mss34dsp @@ -1796,10 +1814,11 @@ CMDLINE_SET=" extra_version host_cc host_cflags + host_extralibs host_ld host_ldflags - host_libs host_os + ignore_tests ld logfile malloc_prefix @@ -1902,12 +1921,13 @@ error_resilience_select="me_cmp" faandct_deps="faan fdctdsp" faanidct_deps="faan idctdsp" h264dsp_select="startcode" +hevc_ps_select="golomb" intrax8_select="blockdsp idctdsp" mdct_select="fft" rdft_select="fft" me_cmp_select="fdctdsp idctdsp pixblockdsp" mpeg_er_select="error_resilience" -mpegaudio_select="mpegaudiodsp" +mpegaudio_select="mpegaudiodsp mpegaudioheader" mpegaudiodsp_select="dct" mpegvideo_select="blockdsp hpeldsp idctdsp me_cmp mpeg_er videodsp" mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp" @@ -1959,13 +1979,13 @@ eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo" eatgq_decoder_select="aandcttables idctdsp" eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp" exr_decoder_deps="zlib" -ffv1_decoder_select="golomb rangecoder" +ffv1_decoder_select="rangecoder" ffv1_encoder_select="rangecoder" ffvhuff_decoder_select="huffyuv_decoder" ffvhuff_encoder_select="huffyuv_encoder" fic_decoder_select="golomb" -flac_decoder_select="flacdsp golomb" -flac_encoder_select="bswapdsp flacdsp golomb lpc" +flac_decoder_select="flacdsp" +flac_encoder_select="bswapdsp flacdsp lpc" flashsv_decoder_deps="zlib" flashsv_encoder_deps="zlib" flashsv2_decoder_deps="zlib" @@ -1986,7 +2006,7 @@ h264_decoder_suggest="error_resilience" hap_decoder_select="snappy texturedsp" hap_encoder_deps="libsnappy" hap_encoder_select="texturedspenc" -hevc_decoder_select="bswapdsp cabac golomb videodsp" +hevc_decoder_select="bswapdsp cabac hevc_ps videodsp" huffyuv_decoder_select="bswapdsp huffyuvdsp" huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp" iac_decoder_select="imc_decoder" @@ -1995,12 +2015,10 @@ indeo3_decoder_select="hpeldsp" indeo4_decoder_select="ividsp" indeo5_decoder_select="ividsp" interplay_video_decoder_select="hpeldsp" -jpegls_decoder_select="golomb mjpeg_decoder" -jpegls_encoder_select="golomb" +jpegls_decoder_select="mjpeg_decoder" jv_decoder_select="blockdsp" lagarith_decoder_select="huffyuvdsp" ljpeg_encoder_select="aandcttables idctdsp jpegtables" -loco_decoder_select="golomb" magicyuv_decoder_select="huffyuvdsp" mdec_decoder_select="blockdsp idctdsp mpegvideo" metasound_decoder_select="lsp mdct sinewin" @@ -2062,7 +2080,6 @@ rv20_encoder_select="h263_encoder" rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp" rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp" screenpresso_decoder_deps="zlib" -shorten_decoder_select="golomb" sipr_decoder_select="lsp" sp5x_decoder_select="mjpeg_decoder" svq1_decoder_select="hpeldsp" @@ -2096,7 +2113,7 @@ vp6a_decoder_select="vp6_decoder" vp6f_decoder_select="vp6_decoder" vp7_decoder_select="h264pred videodsp vp8dsp" vp8_decoder_select="h264pred videodsp vp8dsp" -vp9_decoder_select="videodsp" +vp9_decoder_select="videodsp vp9_superframe_split_bsf" webp_decoder_select="vp8_decoder" wmapro_decoder_select="mdct sinewin wma_freqs" wmav1_decoder_select="mdct sinewin wma_freqs" @@ -2119,10 +2136,9 @@ zmbv_encoder_deps="zlib" # hardware accelerators d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder" dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode" -vaapi_deps="va_va_h" -vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads" +dxva2_lib_deps="dxva2" +vda_deps="VideoDecodeAcceleration_VDADecoder_h blocks_extension pthreads" vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore" -vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" h263_vaapi_hwaccel_deps="vaapi" h263_vaapi_hwaccel_select="h263_decoder" @@ -2145,6 +2161,8 @@ hevc_d3d11va_hwaccel_select="hevc_decoder" hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC" hevc_dxva2_hwaccel_select="hevc_decoder" hevc_qsv_hwaccel_deps="libmfx" +hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC" +hevc_vaapi_hwaccel_select="hevc_decoder" hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC" hevc_vdpau_hwaccel_select="hevc_decoder" mpeg1_vdpau_hwaccel_deps="vdpau" @@ -2186,6 +2204,7 @@ nvenc_deps_any="dlopen LoadLibrary" nvenc_extralibs='$ldl' omx_deps="dlopen pthreads" omx_extralibs='$ldl' +omx_rpi_select="omx" qsvdec_select="qsv" qsvenc_select="qsv" vaapi_encode_deps="vaapi" @@ -2204,9 +2223,9 @@ h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264" h264_vaapi_encoder_select="vaapi_encode golomb" hevc_nvenc_encoder_deps="nvenc" hevc_qsv_decoder_deps="libmfx" -hevc_qsv_encoder_deps="libmfx" hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser hevc_qsv_hwaccel qsvdec" -hevc_qsv_encoder_select="qsvenc" +hevc_qsv_encoder_deps="libmfx" +hevc_qsv_encoder_select="hevc_ps qsvenc" hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC" hevc_vaapi_encoder_select="vaapi_encode golomb" mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG" @@ -2216,19 +2235,24 @@ mpeg2_qsv_decoder_deps="libmfx" mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel mpegvideo_parser" mpeg2_qsv_encoder_deps="libmfx" mpeg2_qsv_encoder_select="qsvenc" +mpeg2_vaapi_encoder_deps="VAEncPictureParameterBufferMPEG2" +mpeg2_vaapi_encoder_select="vaapi_encode" mpeg4_omx_encoder_deps="omx" vc1_mmal_decoder_deps="mmal" vc1_qsv_decoder_deps="libmfx" vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel vc1_parser" vp8_qsv_decoder_deps="libmfx" vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser" +vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8" +vp8_vaapi_encoder_select="vaapi_encode" -nvenc_h264_encoder_deps="nvenc" -nvenc_hevc_encoder_deps="nvenc" +nvenc_h264_encoder_select="h264_nvenc_encoder" +nvenc_hevc_encoder_select="hevc_nvenc_encoder" # parsers h264_parser_select="golomb h264dsp h264parse" -hevc_parser_select="golomb" +hevc_parser_select="hevc_ps" +mpegaudio_parser_select="mpegaudioheader" mpegvideo_parser_select="mpegvideo" mpeg4video_parser_select="error_resilience h263dsp mpegvideo qpeldsp" vc1_parser_select="vc1dsp" @@ -2237,6 +2261,10 @@ vc1_parser_select="vc1dsp" mjpeg2jpeg_bsf_select="jpegtables" # external libraries +avisynth_deps="LoadLibrary" +avxsynth_deps="dlopen" +avisynth_demuxer_deps_any="avisynth avxsynth" +avisynth_demuxer_select="riffdec" libdcadec_decoder_deps="libdcadec" libfaac_encoder_deps="libfaac" libfaac_encoder_select="audio_frame_queue" @@ -2251,7 +2279,7 @@ libilbc_decoder_deps="libilbc" libilbc_encoder_deps="libilbc" libkvazaar_encoder_deps="libkvazaar" libmp3lame_encoder_deps="libmp3lame" -libmp3lame_encoder_select="audio_frame_queue" +libmp3lame_encoder_select="audio_frame_queue mpegaudioheader" libopencore_amrnb_decoder_deps="libopencore_amrnb" libopencore_amrnb_encoder_deps="libopencore_amrnb" libopencore_amrnb_encoder_select="audio_frame_queue" @@ -2281,6 +2309,7 @@ libvpx_vp8_encoder_deps="libvpx" libvpx_vp9_decoder_deps="libvpx" libvpx_vp9_encoder_deps="libvpx" libwavpack_encoder_deps="libwavpack" +libwavpack_encoder_select="audio_frame_queue" libwebp_encoder_deps="libwebp" libx262_encoder_deps="libx262" libx264_encoder_deps="libx264" @@ -2295,8 +2324,6 @@ asf_muxer_select="riffenc" asf_stream_muxer_select="asf_muxer" avi_demuxer_select="iso_media riffdec" avi_muxer_select="riffenc" -avisynth_demuxer_deps="avisynth" -avisynth_demuxer_select="riffdec" caf_demuxer_select="iso_media riffdec" dash_muxer_select="mp4_muxer" dirac_demuxer_select="dirac_parser" @@ -2319,6 +2346,7 @@ mov_demuxer_select="iso_media riffdec" mov_demuxer_suggest="zlib" mov_muxer_select="iso_media riffenc rtpenc_chain" mp3_demuxer_select="mpegaudio_parser" +mp3_muxer_select="mpegaudioheader" mp4_muxer_select="mov_muxer" mpegts_demuxer_select="iso_media" mpegts_muxer_select="adts_muxer latm_muxer" @@ -2354,25 +2382,25 @@ xmv_demuxer_select="riffdec" xwma_demuxer_select="riffdec" # indevs / outdevs -alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp" -alsa_outdev_deps="alsa_asoundlib_h" -avfoundation_indev_deps="AVFoundation_AVFoundation_h" +alsa_indev_deps="alsa" +alsa_outdev_deps="alsa" +avfoundation_indev_deps="AVFoundation_AVFoundation_h objc_arc pthreads" +avfoundation_indev_extralibs="-framework Foundation -framework AVFoundation -framework CoreVideo -framework CoreMedia" bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h" dv1394_indev_deps="dv1394" dv1394_indev_select="dv_demuxer" fbdev_indev_deps="linux_fb_h" -jack_indev_deps="jack_jack_h" +jack_indev_deps="jack" jack_indev_deps_any="sem_timedwait dispatch_dispatch_h" libcdio_indev_deps="libcdio" libdc1394_indev_deps="libdc1394" oss_indev_deps_any="soundcard_h sys_soundcard_h" oss_outdev_deps_any="soundcard_h sys_soundcard_h" pulse_indev_deps="libpulse" -sndio_indev_deps="sndio_h" -sndio_outdev_deps="sndio_h" +sndio_indev_deps="sndio" +sndio_outdev_deps="sndio" v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" -vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines" -vfwcap_indev_extralibs="-lavicap32" +vfwcap_indev_deps="vfw32 vfwcap_defines" xcbgrab_indev_deps="libxcb" # protocols @@ -2422,6 +2450,7 @@ boxblur_filter_deps="gpl" bs2b_filter_deps="libbs2b" cropdetect_filter_deps="gpl" deinterlace_qsv_filter_deps="libmfx" +deinterlace_vaapi_filter_deps="vaapi" delogo_filter_deps="gpl" drawtext_filter_deps="libfreetype" frei0r_filter_deps="frei0r dlopen" @@ -2451,9 +2480,11 @@ transcode_aac_example_deps="avcodec avformat avresample" # libraries, in linking order avcodec_deps="avutil" +avcodec_select="null_bsf" avdevice_deps="avformat avcodec avutil" avfilter_deps="avutil" avformat_deps="avcodec avutil" +avformat_suggest="network" avresample_deps="avutil" swscale_deps="avutil" @@ -2463,7 +2494,7 @@ avconv_select="aformat_filter anull_filter asyncts_filter atrim_filter format_fi fps_filter null_filter resample_filter scale_filter trim_filter" avplay_deps="avcodec avfilter avformat avresample sdl" -avplay_libs='$sdl_libs' +avplay_extralibs='$sdl_extralibs' avplay_select="rdft format_filter transpose_filter hflip_filter vflip_filter" avprobe_deps="avcodec avformat" @@ -2473,7 +2504,7 @@ texi2html_deps="doc" # default parameters -logfile="config.log" +logfile="avbuild/config.log" # installation paths prefix_default="/usr/local" @@ -2558,7 +2589,7 @@ HOSTCC_E='-E -o $@' HOSTCC_O='-o $@' HOSTLD_O='-o $@' -host_libs='-lm' +host_extralibs='-lm' host_cflags_filter=echo host_ldflags_filter=echo @@ -2786,6 +2817,7 @@ disable_components(){ map 'disable_components $v' $LIBRARY_LIST +mkdir -p avbuild echo "# $0 $LIBAV_CONFIGURATION" > $logfile set >> $logfile @@ -2802,7 +2834,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) @@ -2930,19 +2962,24 @@ if ! check_cmd mktemp -u XXXXXX; then # simple replacement for missing mktemp # NOT SAFE FOR GENERAL USE mktemp(){ - echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$" + tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$" + echo "$tmpname" + mkdir "$tmpname" } fi +AVTMPDIR=$(mktemp -d "${TMPDIR}/avconf.XXXXXXXX" 2> /dev/null) || + die "Unable to create temporary directory in $TMPDIR." + tmpfile(){ - tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 && - (set -C; exec > $tmp) 2>/dev/null || - die "Unable to create temporary file in $TMPDIR." - append TMPFILES $tmp + tmp="${AVTMPDIR}/test"$2 + (set -C; exec > $tmp) 2> /dev/null || + die "Unable to create temporary file in $AVTMPDIR." eval $1=$tmp } -trap 'rm -f -- $TMPFILES' EXIT +trap 'rm -rf -- "$AVTMPDIR"' EXIT +trap 'exit 2' INT tmpfile TMPASM .asm tmpfile TMPC .c @@ -3018,6 +3055,7 @@ msvc_common_flags(){ # specific filters, they must be specified here as well or else the # generic catch all at the bottom will print the original flag. -Wall) ;; + -Wextra) ;; -std=c99) ;; # Common flags -fomit-frame-pointer) ;; @@ -3029,7 +3067,6 @@ msvc_common_flags(){ -mthumb) ;; -march=*) ;; -lz) echo zlib.lib ;; - -lavicap32) echo vfw32.lib user32.lib ;; -lx264) echo libx264.lib ;; -l*) echo ${flag#-l}.lib ;; -L*) echo -libpath:${flag#-L} ;; @@ -3042,7 +3079,9 @@ msvc_flags(){ msvc_common_flags "$@" for flag; do case $flag in - -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \ + -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \ + -wd4554 ;; + -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \ -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \ -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \ -wd4273 -wd4554 -wd4701 -wd4703 ;; @@ -3262,6 +3301,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 @@ -3346,6 +3386,7 @@ set_ccvars CC probe_cc hostcc "$host_cc" host_cflags_filter=$_flags_filter +host_cflags_speed=$_cflags_speed add_host_cflags $_flags $_cflags set_ccvars HOSTCC @@ -3733,7 +3774,7 @@ EOF add_host_cppflags -D_ISOC99_SOURCE check_host_cflags -std=c99 check_host_cflags -Wall -check_host_cflags -O3 +check_host_cflags $host_cflags_speed check_64bit(){ arch32=$1 @@ -3795,7 +3836,7 @@ case $target_os in haiku) prefix_default="/boot/common" network_extralibs="-lnetwork" - host_libs= + host_extralibs= ;; sunos) SHFLAGS='-shared -Wl,-h,$$(@F)' @@ -3938,7 +3979,7 @@ case $target_os in ln_s="cp -f" objformat="aout" add_cppflags -D_GNU_SOURCE - add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap + add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf' LIBSUF="_s.a" SLIBPREF="" @@ -4003,7 +4044,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 @@ -4074,26 +4115,25 @@ test -n "$libc_type" && enable libc_$libc_type probe_libc host_ test -n "$host_libc_type" && enable host_libc_$host_libc_type +# hacks for compiler/libc/os combinations + case $libc_type in bionic) add_compat strtod.o strtod=avpriv_strtod ;; + glibc) + if enabled tms470; then + CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}" + add_cppflags -D__USER_LABEL_PREFIX__= + add_cppflags -D__builtin_memset=memset + add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED + add_cflags -pds=48 # incompatible redefinition of macro + elif enabled ccc; then + add_ldflags -Wl,-z,now # calls to libots crash without this + fi + ;; esac -# hacks for compiler/libc/os combinations - -if enabled_all tms470 libc_glibc; then - CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}" - add_cppflags -D__USER_LABEL_PREFIX__= - add_cppflags -D__builtin_memset=memset - add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED - add_cflags -pds=48 # incompatible redefinition of macro -fi - -if enabled_all ccc libc_glibc; then - add_ldflags -Wl,-z,now # calls to libots crash without this -fi - check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" || add_cppflags '-I\$(SRC_PATH)/compat/float' @@ -4101,7 +4141,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 @@ -4143,9 +4183,7 @@ EOF sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }') extern_prefix=${sym%%ff_extern*} -check_cc <= 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"; } -enabled gnutls && check_lib gmp.h mpz_export -lgmp && enable gmp +enabled gnutls && check_lib gmp gmp.h mpz_export -lgmp if enabled nvenc; then check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found." @@ -4716,14 +4746,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 @@ -4737,21 +4765,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 @@ -4771,9 +4798,12 @@ if enabled libxcb; then } && enable libxcb_xfixes add_cflags "$xcb_shape_cflags $xcb_shm_cflags $xcb_xfixes_cflags" - add_extralibs "$xcb_shape_libs $xcb_shm_libs $xcb_xfixes_libs" + 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 && @@ -4781,20 +4811,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 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11 && - enable vaapi_x11 + 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 vdpau && - check_lib "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11 && - enable vdpau_x11 + 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" @@ -4828,12 +4855,18 @@ check_disable_warning -Wno-pointer-sign check_disable_warning_headers(){ warning_flag=-W${1#-Wno-} - test_cflags $warning_flag && append cflags_headers $1 + 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 + +check_cc < 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 @@ -5388,7 +5411,7 @@ print_enabled_components(){ struct_name=$2 name=$3 shift 3 - echo "static const $struct_name *$name[] = {" > $TMPH + echo "static const $struct_name * const $name[] = {" > $TMPH for c in $*; do enabled $c && printf " &ff_%s,\n" $c >> $TMPH done @@ -5401,58 +5424,27 @@ print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $ test -n "$WARNINGS" && printf "\n$WARNINGS" -# build pkg-config files +# Settings for pkg-config files -lib_version(){ - eval printf "\"lib${1} >= \$LIB$(toupper ${1})_VERSION, \"" -} - -pkgconfig_generate(){ - name=$1 - shortname=${name#lib} - 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