--enable-libgsm GSM audio encoding/decoding
--enable-libhdcd HDCD decoding filter
--enable-libilbc ILBC audio encoding/decoding
+ --enable-libjack JACK audio sound server
--enable-libkvazaar HEVC video encoding
--enable-libmp3lame MP3 audio encoding
--enable-libopencore-amrnb AMR-NB audio encoding/decoding
The following libraries provide various hardware acceleration features:
--enable-cuda Nvidia CUDA (dynamically linked)
+ --enable-cuvid Nvidia CUVID video decode acceleration
--enable-d3d11va Microsoft Direct3D 11 video acceleration [auto]
--enable-dxva2 Microsoft DirectX 9 video acceleration [auto]
--enable-libmfx Intel MediaSDK (AKA Quick Sync Video)
--objcc=OCC use ObjC compiler OCC [$cc_default]
--dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
--ld=LD use linker LD
+ --x86asmexe=X86ASM use x86 assembler X86ASM
--pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
--pkg-config-flags=FLAGS pass additional flags to pkgconf []
--host-cc=HOSTCC use host C compiler HOSTCC
--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-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
--extra-libs=ELIBS add ELIBS [$ELIBS]
--extra-version=STRING version string suffix []
--optflags=OPTFLAGS override optimization-related compiler flags
--disable-vfp disable VFP optimizations
--disable-neon disable NEON optimizations
--disable-inline-asm disable use of inline assembly
- --disable-yasm disable use of nasm/yasm assembly
+ --disable-x86asm disable use of standalone x86 assembly
Developer options (useful when working on Libav itself):
--disable-debug disable debugging symbols
pat=$1
shift
for v; do
- eval "case $v in $pat) printf '%s ' $v ;; esac"
+ eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
done
}
pat=$1
shift
for v; do
- eval "case $v in $pat) ;; *) printf '%s ' $v ;; esac"
+ eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
done
}
echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
}
-set_safe(){
+set_sanitized(){
var=$1
shift
eval $(sanitize_var_name "$var")='$*'
}
-get_safe(){
+get_sanitized(){
eval echo \$$(sanitize_var_name "$1")
}
set_weak no $*
}
-enable_safe(){
+enable_sanitized(){
for var; do
enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
done
}
-disable_safe(){
+disable_sanitized(){
for var; do
disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
done
return 1
}
-do_check_deps(){
+check_deps(){
for cfg; do
- cfg="${cfg#!}"
enabled ${cfg}_checking && die "Circular dependency for $cfg."
disabled ${cfg}_checking && continue
enable ${cfg}_checking
- append allopts $cfg
eval dep_all="\$${cfg}_deps"
eval dep_any="\$${cfg}_deps_any"
+ eval dep_con="\$${cfg}_conflict"
eval dep_sel="\$${cfg}_select"
eval dep_sgs="\$${cfg}_suggest"
eval dep_ifa="\$${cfg}_if"
eval dep_ifn="\$${cfg}_if_any"
- pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
- do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
- popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
+ pushvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn
+ check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
+ popvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn
[ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
[ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
enabled_all $dep_all || disable $cfg
enabled_any $dep_any || disable $cfg
+ disabled_all $dep_con || disable $cfg
disabled_any $dep_sel && disable $cfg
- if enabled $cfg; then
- enable_deep $dep_sel
- enable_deep_weak $dep_sgs
- fi
-
- disable ${cfg}_checking
- done
-}
-
-check_deps(){
- unset allopts
+ enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
- do_check_deps "$@"
+ for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
+ # filter out library deps, these do not belong in extralibs
+ is_in $dep $LIBRARY_LIST && continue
+ enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
+ done
- for cfg in $allopts; do
- enabled $cfg || continue
- eval dep_extralibs="\$${cfg}_extralibs"
- test -n "$dep_extralibs" && add_extralibs $dep_extralibs
+ disable ${cfg}_checking
done
}
eval "$var=\"${uniq_list}\""
}
+resolve(){
+ var=$1
+ tmpvar=
+ for entry in $(eval echo \$$var); do
+ tmpvar="$tmpvar $(eval echo \$${entry})"
+ done
+ eval "$var=\"${tmpvar}\""
+}
+
add_cppflags(){
append CPPFLAGS "$@"
}
append LDEXEFLAGS $($ldflags_filter "$@")
}
+add_ldsoflags(){
+ append LDSOFLAGS $($ldflags_filter "$@")
+}
+
add_stripflags(){
append STRIPFLAGS "$@"
}
echo "$2" | check_as && enable ${1}_external || disable ${1}_external
}
-check_yasm(){
- log check_yasm "$@"
+check_x86asm(){
+ log check_x86asm "$@"
echo "$1" > $TMPS
log_file $TMPS
shift 1
- check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
+ check_cmd $x86asmexe $X86ASMFLAGS "$@" -o $TMPO $TMPS
}
ld_o(){
check_cppflags(){
log check_cppflags "$@"
check_cpp "$@" <<EOF && append CPPFLAGS "$@"
-int x;
+#include <stdlib.h>;
EOF
}
log check_header "$@"
header=$1
shift
- disable_safe $header
- check_cpp "$@" <<EOF && enable_safe $header
+ disable_sanitized $header
+ check_cpp "$@" <<EOF && enable_sanitized $header
#include <$header>
int x;
EOF
echo "long check_$func(void) { return (long) $func; }"
done
echo "int main(void) { return 0; }"
- } | check_ld "$@" && enable $funcs && enable_safe $headers
+ } | check_ld "$@" && enable $funcs && enable_sanitized $headers
}
check_cpp_condition(){
shift 3
disable $name
check_func_headers "$headers" "$funcs" "$@" &&
- enable $name && add_extralibs "$@"
+ enable $name && eval ${name}_extralibs="\$@"
}
-check_pkg_config(){
- log check_pkg_config "$@"
- pkg_version="$1"
- pkg="${1%% *}"
- headers="$2"
- funcs="$3"
- shift 3
+test_pkg_config(){
+ log test_pkg_config "$@"
+ name="$1"
+ pkg_version="$2"
+ pkg="${2%% *}"
+ headers="$3"
+ funcs="$4"
+ shift 4
+ disable $name
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}_extralibs" $pkg_libs
+ enable $name &&
+ set_sanitized "${name}_cflags" $pkg_cflags &&
+ set_sanitized "${name}_extralibs" $pkg_libs
+}
+
+check_pkg_config(){
+ log check_pkg_config "$@"
+ name="$1"
+ test_pkg_config "$@" &&
+ eval add_cflags \$${name}_cflags
}
check_exec(){
headers=$1
type=$2
shift 2
- disable_safe "$type"
- check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
+ disable_sanitized "$type"
+ check_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
}
check_struct(){
struct=$2
member=$3
shift 3
- disable_safe "${struct}_${member}"
+ disable_sanitized "${struct}_${member}"
check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
- enable_safe "${struct}_${member}"
+ enable_sanitized "${struct}_${member}"
}
check_builtin(){
check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not found"
}
+require_header(){
+ log require "$@"
+ header="$1"
+ shift
+ check_header "$header" "$@" || die "ERROR: $header not found"
+}
+
+require_cpp_condition(){
+ log require "$@"
+ header="$1"
+ condition="$2"
+ shift 2
+ check_cpp_condition "$header" "$condition" "$@" || die "ERROR: $condition not satisfied"
+}
+
require_pkg_config(){
log require_pkg_config "$@"
- pkg_version="$1"
- pkg="${1%% *}"
+ pkg_version="$2"
check_pkg_config "$@" || die "ERROR: $pkg_version not found"
- add_cflags $(get_safe "${pkg}_cflags")
- add_extralibs $(get_safe "${pkg}_extralibs")
}
hostcc_e(){
check_host_cppflags(){
log check_host_cppflags "$@"
check_host_cpp "$@" <<EOF && append host_cppflags "$@"
-int x;
+#include <stdlib.h>;
EOF
}
transcode_aac_example
"
+# catchall list of things that require external libs to link
+EXTRALIBS_LIST="
+ cpu_init
+ cws2fws
+"
+
HWACCEL_LIBRARY_NONFREE_LIST="
cuda
+ cuvid
libnpp
"
HWACCEL_LIBRARY_LIST="
$EXTERNAL_LIBRARY_VERSION3_LIST
avisynth
avxsynth
- bzlib
frei0r
gnutls
libbs2b
libgsm
libhdcd
libilbc
+ libjack
libkvazaar
libmp3lame
libopencv
libxcb
libxcb_shm
libxcb_xfixes
+"
+
+SYSTEM_LIBRARY_LIST="
+ bzlib
zlib
"
$LIBRARY_LIST
$PROGRAM_LIST
$SUBSYSTEM_LIST
+ $SYSTEM_LIBRARY_LIST
neon_clobber_test
pic
pod2man
HAVE_LIST_CMDLINE="
inline_asm
symver
- yasm
+ x86asm
"
HAVE_LIST_PUB="
HEADERS_LIST="
AVFoundation_AVFoundation_h
- alsa_asoundlib_h
- altivec_h
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
dev_video_bktr_ioctl_bt848_h
dev_video_meteor_ioctl_meteor_h
direct_h
- dlfcn_h
+ dxgidebug_h
dxva_h
gsm_h
io_h
machine_ioctl_meteor_h
malloc_h
poll_h
- sndio_h
soundcard_h
stdatomic_h
- sys_mman_h
sys_param_h
sys_resource_h
sys_select_h
clock_gettime
closesocket
CommandLineToArgvW
- CoTaskMemFree
CryptGenRandom
- dlopen
fcntl
- flt_lim
fork
getaddrinfo
gethrtime
gmtime_r
inet_aton
isatty
- jack_port_get_latency_range
- LoadLibrary
localtime_r
mach_absolute_time
MapViewOfFile
memalign
- mkstemp
mmap
mprotect
nanosleep
"
TOOLCHAIN_FEATURES="
- as_dn_directive
+ as_arch_directive
as_fpu_directive
as_func
as_object_arch
TYPES_LIST="
CONDITION_VARIABLE_Ptr
+ CUVIDDECODECREATEINFO_bitDepthMinus8
socklen_t
struct_addrinfo
struct_group_source_req
$TOOLCHAIN_FEATURES
$TYPES_LIST
dos_paths
- dxva2_lib
libc_msvcrt
MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
sdl
section_data_rel_ro
threads
+ uwp
vaapi_drm
vaapi_x11
vdpau_x11
CONFIG_EXTRA="
aandcttables
ac3dsp
+ adts_header
audio_frame_queue
audiodsp
blockdsp
bswapdsp
cabac
+ cbs
+ cbs_h264
+ cbs_h265
+ cbs_mpeg2
dirac_parse
dvprofile
faandct
h264parse
h264pred
h264qpel
- hevc_ps
+ hevcparse
hpeldsp
huffman
huffyuvdsp
iso_media
ividsp
jpegtables
- libx262
lgplv3
+ libx262
+ libxcb_shape
lpc
lzf
me_cmp
qsv
qsvdec
qsvenc
+ qsvvpp
rangecoder
riffdec
riffenc
target_path
target_samples
toolchain
+ x86asmexe
"
CMDLINE_APPEND="
map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
altivec_deps="ppc"
+dcbzl_deps="ppc"
+ldbrx_deps="ppc"
ppc4xx_deps="ppc"
vsx_deps="altivec"
power8_deps="vsx"
+loongson_deps="mips"
+mips32r1_deps="mips32"
+mips32r2_deps="mips32"
+mips32r6_deps="mips32"
+mips64r1_deps="mips64"
+mips64r2_deps="mips64"
+mips64r6_deps="mips64"
+
+vis_deps="sparc"
+
cpunop_deps="i686"
x86_64_select="i686"
x86_64_suggest="fast_cmov"
fma4_deps="avx"
avx2_deps="avx"
-mmx_external_deps="yasm"
-mmx_inline_deps="inline_asm"
+mmx_external_deps="x86asm"
+mmx_inline_deps="inline_asm x86"
mmx_suggest="mmx_external mmx_inline"
for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
# system capabilities
symver_if_any="symver_asm_label symver_gnu_asm"
-valgrind_backtrace_deps="!optimizations valgrind_valgrind_h"
+valgrind_backtrace_conflict="optimizations"
+valgrind_backtrace_deps="valgrind_valgrind_h"
# threading support
atomics_gcc_if="sync_val_compare_and_swap"
threads_if_any="$THREADS_LIST"
# subsystems
+cbs_h264_select="cbs golomb"
+cbs_h265_select="cbs golomb"
+cbs_mpeg2_select="cbs"
dct_select="rdft"
dirac_parse_select="golomb"
error_resilience_select="me_cmp"
-faandct_deps="faan fdctdsp"
-faanidct_deps="faan idctdsp"
+faandct_deps="faan"
+faandct_select="fdctdsp"
+faanidct_deps="faan"
+faanidct_select="idctdsp"
h264dsp_select="startcode"
-hevc_ps_select="golomb"
+hevcparse_select="golomb"
intrax8_select="blockdsp idctdsp"
mdct_select="fft"
rdft_select="fft"
vc1dsp_select="h264chroma qpeldsp startcode"
# decoders / encoders
-aac_decoder_select="imdct15 mdct sinewin"
+aac_decoder_select="adts_header imdct15 mdct sinewin"
aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
aac_latm_decoder_select="aac_decoder aac_latm_parser"
ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
+clearvideo_decoder_select="idctdsp"
cllc_decoder_select="bswapdsp"
comfortnoise_encoder_select="lpc"
cook_decoder_select="audiodsp mdct sinewin"
hap_decoder_select="snappy texturedsp"
hap_encoder_deps="libsnappy"
hap_encoder_select="texturedspenc"
-hevc_decoder_select="bswapdsp cabac hevc_ps videodsp"
+hevc_decoder_select="bswapdsp cabac hevcparse videodsp"
huffyuv_decoder_select="bswapdsp huffyuvdsp"
huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp"
iac_decoder_select="imc_decoder"
mp3on4float_decoder_select="mpegaudio"
mpc7_decoder_select="bswapdsp mpegaudiodsp"
mpc8_decoder_select="mpegaudiodsp"
-mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
-mpeg_xvmc_decoder_select="mpeg2video_decoder"
mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
mpeg1video_encoder_select="aandcttables mpegvideoenc"
mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
tscc_decoder_deps="zlib"
txd_decoder_select="texturedsp"
twinvq_decoder_select="mdct lsp sinewin"
-utvideo_decoder_select="bswapdsp"
+utvideo_decoder_select="bswapdsp huffyuvdsp"
utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
vble_decoder_select="huffyuvdsp"
vc1_decoder_select="blockdsp error_resilience h263_decoder h264qpel intrax8 mpeg_er mpegvideo vc1dsp"
zmbv_encoder_deps="zlib"
# hardware accelerators
-d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
-dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
-dxva2_lib_deps="dxva2"
+d3d11va_deps="dxva_h ID3D11VideoDecoder"
+dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32"
vda_deps="VideoDecodeAcceleration_VDADecoder_h blocks_extension pthreads"
vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
h263_vaapi_hwaccel_deps="vaapi"
h263_vaapi_hwaccel_select="h263_decoder"
+h264_cuvid_hwaccel_deps="cuvid CUVIDH264PICPARAMS"
+h264_cuvid_hwaccel_select="h264_decoder"
h264_d3d11va_hwaccel_deps="d3d11va"
h264_d3d11va_hwaccel_select="h264_decoder"
+h264_d3d11va2_hwaccel_deps="d3d11va"
+h264_d3d11va2_hwaccel_select="h264_decoder"
h264_dxva2_hwaccel_deps="dxva2"
h264_dxva2_hwaccel_select="h264_decoder"
h264_mmal_hwaccel_deps="mmal"
h264_vda_old_hwaccel_select="h264_decoder"
h264_vdpau_hwaccel_deps="vdpau"
h264_vdpau_hwaccel_select="h264_decoder"
+hevc_cuvid_hwaccel_deps="cuvid CUVIDHEVCPICPARAMS"
+hevc_cuvid_hwaccel_select="hevc_decoder"
hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
hevc_d3d11va_hwaccel_select="hevc_decoder"
+hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
+hevc_d3d11va2_hwaccel_select="hevc_decoder"
hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
hevc_dxva2_hwaccel_select="hevc_decoder"
hevc_qsv_hwaccel_deps="libmfx"
mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
mpeg2_d3d11va_hwaccel_deps="d3d11va"
mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
+mpeg2_d3d11va2_hwaccel_deps="d3d11va"
+mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
mpeg2_dxva2_hwaccel_deps="dxva2"
mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
mpeg2_mmal_hwaccel_deps="mmal"
mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
vc1_d3d11va_hwaccel_deps="d3d11va"
vc1_d3d11va_hwaccel_select="vc1_decoder"
+vc1_d3d11va2_hwaccel_deps="d3d11va"
+vc1_d3d11va2_hwaccel_select="vc1_decoder"
vc1_dxva2_hwaccel_deps="dxva2"
vc1_dxva2_hwaccel_select="vc1_decoder"
vc1_mmal_hwaccel_deps="mmal"
vp8_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferVP8"
vp8_vaapi_hwaccel_select="vp8_decoder"
wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
+wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
# hardware-accelerated codecs
-nvenc_deps_any="dlopen LoadLibrary"
-nvenc_extralibs='$ldl'
-omx_deps="dlopen pthreads"
-omx_extralibs='$ldl'
+nvenc_deps_any="libdl LoadLibrary"
+omx_deps="libdl pthreads"
omx_rpi_select="omx"
+qsv_deps="libmfx"
qsvdec_select="qsv"
qsvenc_select="qsv"
+qsvvpp_select="qsv"
vaapi_encode_deps="vaapi"
hwupload_cuda_filter_deps="cuda"
h264_mmal_decoder_deps="mmal"
h264_nvenc_encoder_deps="nvenc"
h264_omx_encoder_deps="omx"
-h264_qsv_decoder_deps="libmfx"
h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
-h264_qsv_encoder_deps="libmfx"
h264_qsv_encoder_select="qsvenc"
h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
-h264_vaapi_encoder_select="vaapi_encode golomb"
+h264_vaapi_encoder_select="cbs_h264 vaapi_encode"
hevc_nvenc_encoder_deps="nvenc"
-hevc_qsv_decoder_deps="libmfx"
hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser hevc_qsv_hwaccel qsvdec"
-hevc_qsv_encoder_deps="libmfx"
-hevc_qsv_encoder_select="hevc_ps qsvenc"
+hevc_qsv_encoder_select="hevcparse qsvenc"
hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
-hevc_vaapi_encoder_select="vaapi_encode golomb"
+hevc_vaapi_encoder_select="cbs_h265 vaapi_encode"
+mjpeg_qsv_encoder_deps="libmfx"
+mjpeg_qsv_encoder_select="qsvenc"
mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
mpeg2_mmal_decoder_deps="mmal"
-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"
+mpeg2_vaapi_encoder_select="cbs_mpeg2 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"
+vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
+vp9_vaapi_encoder_select="vaapi_encode"
nvenc_h264_encoder_select="h264_nvenc_encoder"
nvenc_hevc_encoder_select="hevc_nvenc_encoder"
# parsers
+aac_parser_select="adts_header"
h264_parser_select="golomb h264dsp h264parse"
-hevc_parser_select="hevc_ps"
+hevc_parser_select="hevcparse"
mpegaudio_parser_select="mpegaudioheader"
mpegvideo_parser_select="mpegvideo"
mpeg4video_parser_select="error_resilience h263dsp mpegvideo qpeldsp"
vc1_parser_select="vc1dsp"
# bitstream_filters
+aac_adtstoasc_bsf_select="adts_header"
+h264_metadata_bsf_select="cbs_h264"
+h264_redundant_pps_bsf_select="cbs_h264"
+hevc_metadata_bsf_select="cbs_h265"
mjpeg2jpeg_bsf_select="jpegtables"
+mpeg2_metadata_bsf_select="cbs_mpeg2"
+trace_headers_bsf_select="cbs_h264 cbs_h265 cbs_mpeg2"
# external libraries
avisynth_deps="LoadLibrary"
-avxsynth_deps="dlopen"
+avxsynth_deps="libdl"
avisynth_demuxer_deps_any="avisynth avxsynth"
avisynth_demuxer_select="riffdec"
libdcadec_decoder_deps="libdcadec"
sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
sdp_demuxer_select="rtpdec"
smoothstreaming_muxer_select="ismv_muxer"
-spdif_muxer_select="aac_parser"
+spdif_demuxer_select="adts_header"
+spdif_muxer_select="adts_header"
spx_muxer_select="ogg_muxer"
swf_demuxer_suggest="zlib"
tak_demuxer_select="tak_parser"
wav_demuxer_select="riffdec"
wav_muxer_select="riffenc"
webm_muxer_select="iso_media riffenc"
-webm_muxer_suggest="libopus_encoder libvorbis_encoder libvpx_vp8_encoder libvpx_vp9_encoder"
wtv_demuxer_select="mpegts_demuxer riffdec"
xmv_demuxer_select="riffdec"
xwma_demuxer_select="riffdec"
dv1394_indev_deps="dv1394"
dv1394_indev_select="dv_demuxer"
fbdev_indev_deps="linux_fb_h"
-jack_indev_deps="jack"
+jack_indev_deps="libjack"
jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
libcdio_indev_deps="libcdio"
libdc1394_indev_deps="libdc1394"
sndio_outdev_deps="sndio"
v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="vfw32 vfwcap_defines"
-xcbgrab_indev_deps="libxcb"
+xcbgrab_indev_deps="libxcb libxcb_shape"
+xcbgrab_indev_suggest="libxcb_shm libxcb_xfixes"
# protocols
-ffrtmpcrypt_protocol_deps="!librtmp_protocol"
+ffrtmpcrypt_protocol_conflict="librtmp_protocol"
ffrtmpcrypt_protocol_deps_any="gmp openssl"
ffrtmpcrypt_protocol_select="tcp_protocol"
-ffrtmphttp_protocol_deps="!librtmp_protocol"
+ffrtmphttp_protocol_conflict="librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
gopher_protocol_select="network"
http_protocol_select="tcp_protocol"
+http_protocol_suggest="zlib"
httpproxy_protocol_select="tcp_protocol"
+httpproxy_protocol_suggest="zlib"
https_protocol_select="tls_protocol"
+https_protocol_suggest="zlib"
icecast_protocol_select="http_protocol"
librtmp_protocol_deps="librtmp"
librtmpe_protocol_deps="librtmp"
librtmpte_protocol_deps="librtmp"
mmsh_protocol_select="http_protocol"
mmst_protocol_select="network"
-rtmp_protocol_deps="!librtmp_protocol"
+rtmp_protocol_conflict="librtmp_protocol"
rtmp_protocol_select="tcp_protocol"
+rtmp_protocol_suggest="zlib"
rtmpe_protocol_select="ffrtmpcrypt_protocol"
-rtmps_protocol_deps="!librtmp_protocol"
+rtmpe_protocol_suggest="zlib"
+rtmps_protocol_conflict="librtmp_protocol"
rtmps_protocol_select="tls_protocol"
+rtmps_protocol_suggest="zlib"
rtmpt_protocol_select="ffrtmphttp_protocol"
+rtmpt_protocol_suggest="zlib"
rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
+rtmpte_protocol_suggest="zlib"
rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
+rtmpts_protocol_suggest="zlib"
rtp_protocol_select="udp_protocol"
sctp_protocol_deps="struct_sctp_event_subscribe"
sctp_protocol_select="network"
srtp_protocol_select="rtp_protocol srtp"
tcp_protocol_select="network"
-tls_gnutls_protocol_deps="gnutls"
-tls_gnutls_protocol_select="tcp_protocol"
-tls_openssl_protocol_deps="openssl !tls_gnutls_protocol"
-tls_openssl_protocol_select="tcp_protocol"
-tls_protocol_deps_any="tls_gnutls_protocol tls_openssl_protocol"
+tls_protocol_deps_any="gnutls openssl"
+tls_protocol_select="tcp_protocol"
udp_protocol_select="network"
unix_protocol_deps="sys_un_h"
unix_protocol_select="network"
deinterlace_vaapi_filter_deps="vaapi"
delogo_filter_deps="gpl"
drawtext_filter_deps="libfreetype"
-frei0r_filter_deps="frei0r dlopen"
-frei0r_filter_extralibs='$ldl'
-frei0r_src_filter_deps="frei0r dlopen"
-frei0r_src_filter_extralibs='$ldl'
+drawtext_filter_suggest="libfontconfig"
+frei0r_filter_deps="frei0r libdl"
+frei0r_src_filter_deps="frei0r libdl"
hdcd_filter_deps="libhdcd"
hqdn3d_filter_deps="gpl"
interlace_filter_deps="gpl"
movie_filter_deps="avcodec avformat"
ocv_filter_deps="libopencv"
+overlay_qsv_filter_deps="libmfx"
+overlay_qsv_filter_select="qsvvpp"
resample_filter_deps="avresample"
scale_filter_deps="swscale"
scale_qsv_filter_deps="libmfx"
scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
+vpp_qsv_filter_deps="libmfx"
+vpp_qsv_filter_select="qsvvpp"
# examples
decode_audio_example_deps="avcodec avutil"
qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder"
transcode_aac_example_deps="avcodec avformat avresample"
+# EXTRALIBS_LIST
+cpu_init_extralibs="pthreads_extralibs"
+cws2fws_extralibs="zlib_extralibs"
+
# libraries, in linking order
avcodec_deps="avutil"
avcodec_select="null_bsf"
avresample_deps="avutil"
swscale_deps="avutil"
+avcodec_extralibs="pthreads_extralibs libm_extralibs"
+avdevice_extralibs="libm_extralibs"
+avformat_extralibs="libm_extralibs"
+avfilter_extralibs="pthreads_extralibs libm_extralibs"
+avresample_extralibs="libm_extralibs"
+avutil_extralibs="clock_gettime_extralibs cuda_extralibs cuvid_extralibs d3d11va_extralibs libm_extralibs libmfx_extralibs nanosleep_extralibs pthreads_extralibs user32_extralibs vaapi_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs wincrypt_extralibs"
+swscale_extralibs="libm_extralibs"
+
# programs
avconv_deps="avcodec avfilter avformat avresample swscale"
avconv_select="aformat_filter anull_filter asyncts_filter atrim_filter format_filter
fps_filter null_filter resample_filter scale_filter
trim_filter"
+avconv_suggest="psapi shell32"
avplay_deps="avcodec avfilter avformat avresample sdl"
-avplay_extralibs='$sdl_extralibs'
avplay_select="rdft format_filter transpose_filter hflip_filter vflip_filter"
+avplay_suggest="shell32"
avprobe_deps="avcodec avformat"
+avprobe_suggest="shell32"
# documentation
pod2man_deps="doc"
ar_default="ar"
cc_default="gcc"
host_cc_default="gcc"
+x86asmexe_default="nasm"
ln_s="ln -s -f"
nm_default="nm -g"
-objformat="elf"
pkg_config_default=pkg-config
ranlib="ranlib"
strip="strip"
version_script='--version-script'
-yasmexe="yasm"
# machine
arch_default=$(uname -m)
# By default, enable only those hwaccels that have no external dependencies.
enable d3d11va dxva2 vda vdpau
+# internal components are enabled by default
+enable $EXTRALIBS_LIST
+
+# Avoid external, non-system, libraries getting enabled by dependency resolution
+disable $EXTERNAL_LIBRARY_LIST
+
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
LIBPREF="lib"
OBJCC_C='-c'
OBJCC_E='-E -o $@'
OBJCC_O='-o $@'
+X86ASM_O='-o $@'
LD_O='-o $@'
LD_LIB='-l%'
LD_PATH='-L'
DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
DEPFLAGS='-MM'
+mkdir -p avbuild
+
# find source path
if test -f configure; then
source_path=.
BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
-ALL_COMPONENTS="
+AVCODEC_COMPONENTS_LIST="
$BSF_LIST
$DECODER_LIST
- $DEMUXER_LIST
$ENCODER_LIST
- $FILTER_LIST
$HWACCEL_LIST
+ $PARSER_LIST
+"
+
+AVDEVICE_COMPONENTS_LIST="
$INDEV_LIST
- $MUXER_LIST
$OUTDEV_LIST
- $PARSER_LIST
+"
+
+AVFILTER_COMPONENTS_LIST="
+ $FILTER_LIST
+"
+
+AVFORMAT_COMPONENTS_LIST="
+ $DEMUXER_LIST
+ $MUXER_LIST
$PROTOCOL_LIST
"
+ALL_COMPONENTS="
+ $AVCODEC_COMPONENTS_LIST
+ $AVDEVICE_COMPONENTS_LIST
+ $AVFILTER_COMPONENTS_LIST
+ $AVFORMAT_COMPONENTS_LIST
+"
+
for n in $COMPONENT_LIST; do
v=$(toupper ${n%s})_LIST
eval enable \$$v
--extra-ldexeflags=*)
add_ldexeflags $optval
;;
+ --extra-ldsoflags=*)
+ add_ldsoflags $optval
+ ;;
--extra-libs=*)
add_extralibs $optval
;;
warn "avserver has been removed, the ${opt} option is only"\
"provided for compatibility and will be removed in the future"
;;
+ --enable-yasm|--disable-yasm)
+ warn "The ${opt} option is only provided for compatibility and will be\n"\
+ "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
+ test $opt = --enable-yasm && x86asm=yes || x86asm=no
+ ;;
--enable-?*|--disable-?*)
eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
if is_in $option $COMPONENT_LIST; then
enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
+enabled_all gnutls openssl &&
+ die "GnuTLS and OpenSSL must not be enabled at the same time."
+
# Disable all the library-specific components if the library itself
# is disabled, see AVCODEC_LIST and following _LIST variables.
map 'disable_components $v' $LIBRARY_LIST
-mkdir -p avbuild
echo "# $0 $LIBAV_CONFIGURATION" > $logfile
set >> $logfile
ar_default="${cross_prefix}${ar_default}"
cc_default="${cross_prefix}${cc_default}"
-occ_default="${cross_prefix}${occ_default}"
+objcc_default="${cross_prefix}${objcc_default}"
+x86asmexe_default="${cross_prefix}${x86asmexe_default}"
nm_default="${cross_prefix}${nm_default}"
pkg_config_default="${cross_prefix}${pkg_config_default}"
ranlib="${cross_prefix}${ranlib}"
sysinclude_default="${sysroot}/usr/include"
-set_default arch cc pkg_config sysinclude target_exec target_os
+set_default arch cc pkg_config sysinclude target_exec target_os x86asmexe
enabled cross_compile || host_cc_default=$cc
set_default host_cc
done
}
-ccc_flags(){
- for flag; do
- case $flag in
- -std=c99) echo -c99 ;;
- -mcpu=*) echo -arch ${flag#*=} ;;
- -mieee) echo -ieee ;;
- -O*|-fast) echo $flag ;;
- -fno-math-errno) echo -assume nomath_errno ;;
- -g) echo -g3 ;;
- -Wall) echo -msg_enable level2 ;;
- -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
- -Wl,*) echo $flag ;;
- -f*|-W*) ;;
- *) echo $flag ;;
- esac
- done
-}
-
cparser_flags(){
for flag; do
case $flag in
_ident=$($_cc -qversion 2>/dev/null | head -n1)
_cflags_speed='-O5'
_cflags_size='-O5 -qcompact'
- elif $_cc -V 2>/dev/null | grep -q Compaq; then
- _type=ccc
- _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
- _DEPFLAGS='-M'
- _cflags_speed='-fast'
- _cflags_size='-O1'
- _flags_filter=ccc_flags
elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
test -d "$sysroot" || die "No valid sysroot specified."
_type=armcc
# some compilers silently accept -std=c11, so we also need to check that the
# version macro is defined properly
-if test_cflags_cpp -std=c11 "__STDC_VERSION__ >= 201112L"; then
- add_cflags -std=c11
-else
+check_cpp_condition stdlib.h "__STDC_VERSION__ >= 201112L" -std=c11 &&
+ add_cflags -std=c11 ||
check_cflags -std=c99
-fi
-check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
-#include <stdlib.h>
-EOF
-check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
-#include <stdlib.h>
-EOF
+check_cppflags -D_FILE_OFFSET_BITS=64
+check_cppflags -D_LARGEFILE_SOURCE
add_host_cppflags -D_ISOC99_SOURCE
check_host_cflags -std=c99
enable $subarch
enabled spic && enable_weak pic
+enabled x86_64 && objformat=elf64 || objformat="elf32"
+
# OS specific
case $target_os in
aix)
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
add_ldflags -Wl,-dynamic,-search_paths_first
+ check_cflags -Werror=partial-availability
SLIBSUF=".dylib"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
- objformat="macho"
- enabled x86_64 && objformat="macho64"
+ enabled x86_64 && objformat="macho64" || objformat="macho32"
enabled_any pic shared ||
{ check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
check_header dispatch/dispatch.h &&
add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
+ if test -n "$sysroot"; then
+ is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
+ is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
+ fi
;;
msys*)
die "Native MSYS builds are discouraged, please use the MINGW environment."
;;
mingw32*|mingw64*)
- if test $target_os = "mingw32ce"; then
- disable network
- else
- target_os=mingw32
- fi
+ target_os=mingw32
LIBTARGET=i386
if enabled x86_64; then
LIBTARGET="i386:x86-64"
- elif enabled arm; then
- LIBTARGET=arm-wince
+ fi
+ if enabled shared; then
+ # Cannot build both shared and static libs when using dllexport.
+ disable static
fi
check_ldflags -Wl,--nxcompat
check_ldflags -Wl,--dynamicbase
SLIBSUF=".dll"
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_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
- SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
- objformat="win32"
+ SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+ SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)'
+ enabled x86_64 && objformat="win64" || objformat="win32"
dlltool="${cross_prefix}dlltool"
ranlib=:
enable dos_paths
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
- objformat="win32"
+ enabled x86_64 && objformat="win64" || objformat="win32"
ranlib=:
enable dos_paths
;;
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_LIB='lib$(NAME).dll.a'
SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(NAME).dll.a'
- objformat="win32"
+ enabled x86_64 && objformat="win64" || objformat="win32"
enable dos_paths
;;
*-dos|freedos|opendos)
-l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
-l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
;;
- osf1)
- add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
- ;;
minix)
;;
none)
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
die "ERROR: MinGW32 runtime version must be >= 3.15."
add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
- check_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700__" &&
+ check_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
+ check_${pfx}cpp_condition windows.h "defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0502" &&
+ add_${pfx}cppflags -D_WIN32_WINNT=0x0502
eval test \$${pfx_no_}cc_type = "gcc" &&
add_${pfx}cppflags -D__printf__=__gnu_printf__
elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
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
+ 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'
sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
extern_prefix=${sym%%ff_extern*}
-check_cc <<EOF && enable_weak inline_asm
-void foo(void) { __asm__ volatile ("" ::); }
-EOF
+! disabled inline_asm && check_inline_asm inline_asm '"" ::'
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
- check_as <<EOF && enable as_dn_directive
-ra .dn d0.i16
-.unreq ra
+ check_as <<EOF && enable as_arch_directive
+.arch armv7-a
EOF
check_as <<EOF && enable as_fpu_directive
.fpu neon
EOF
# llvm's integrated assembler supports .object_arch from llvm 3.5
- [ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
+ [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
+ check_as <<EOF && enable as_object_arch
.object_arch armv4
EOF
check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
- # AltiVec flags: The FSF version of GCC differs from the Apple version
if enabled altivec; then
- check_cflags -maltivec -mabi=altivec &&
- { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
- check_cflags -faltivec
+ check_cflags -maltivec -mabi=altivec
# check if our compiler supports Motorola AltiVec C API
- check_cc <<EOF || disable altivec
-$inc_altivec_h
-int main(void) {
- vector signed int v1 = (vector signed int) { 0 };
- vector signed int v2 = (vector signed int) { 1 };
- v1 = vec_add(v1, v2);
- return 0;
-}
-EOF
+ check_code cc altivec.h "vector signed int v1 = (vector signed int) { 0 };
+ vector signed int v2 = (vector signed int) { 1 };
+ v1 = vec_add(v1, v2);" ||
+ disable altivec
enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
fi
if enabled vsx; then
check_cflags -mvsx &&
- check_builtin vec_vsx_ld "altivec.h" "__builtin_vec_vsx_ld" || disable vsx
+ check_code cc altivec.h "int v[4] = { 0 };
+ vector signed int v1 = vec_vsx_ld(0, v);" ||
+ disable vsx
fi
if enabled power8; then
enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
- if ! disabled_any asm mmx yasm; then
- if check_cmd $yasmexe --version; then
- enabled x86_64 && yasm_extra="-m amd64"
- yasm_debug="-g dwarf2"
- elif check_cmd nasm -v; then
- yasmexe=nasm
- yasm_debug="-g -F dwarf"
- enabled x86_64 && test "$objformat" = elf && objformat=elf64
+ probe_x86asm(){
+ x86asmexe_probe=$1
+ if check_cmd $x86asmexe_probe -v; then
+ x86asmexe=$x86asmexe_probe
+ x86asm_type=nasm
+ x86asm_debug="-g -F dwarf"
+ X86ASMDEP=
+ X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
+ elif check_cmd $x86asmexe_probe --version; then
+ x86asmexe=$x86asmexe_probe
+ x86asm_type=yasm
+ x86asm_debug="-g dwarf2"
+ X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
+ X86ASM_DEPFLAGS=
fi
+ check_x86asm "movbe ecx, [5]" && enable x86asm
+ }
- YASMFLAGS="-f $objformat $yasm_extra"
- enabled pic && append YASMFLAGS "-DPIC"
- test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
+ if ! disabled_any asm mmx x86asm; then
+ disable x86asm
+ for program in $x86asmexe nasm yasm; do
+ probe_x86asm $program && break
+ done
+ disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
+ X86ASMFLAGS="-f $objformat"
+ enabled pic && append X86ASMFLAGS "-DPIC"
+ test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
case "$objformat" in
- elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
+ elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
esac
- check_yasm "movbe ecx, [5]" && enable yasm ||
- die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
- check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
- check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
- check_yasm "vfmadd132ps ymm0, ymm1, ymm2" || disable fma3_external
- check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
- check_yasm "CPU amdnop" || disable cpunop
+ check_x86asm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
+ check_x86asm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
+ check_x86asm "vfmadd132ps ymm0, ymm1, ymm2" || disable fma3_external
+ check_x86asm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
+ check_x86asm "CPU amdnop" || disable cpunop
fi
case "$cpu" in
check_ldflags -Wl,--as-needed
-if check_func dlopen; then
- ldl=
-elif check_func dlopen -ldl; then
- ldl=-ldl
-fi
-
if ! disabled network; then
check_func getaddrinfo $network_extralibs
check_func inet_aton $network_extralibs
require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
;;
tcmalloc)
- require_pkg_config libtcmalloc gperftools/tcmalloc.h tc_malloc
+ require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
malloc_prefix=tc_
;;
esac
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 clock_gettime time.h clock_gettime -lrt && LIBRT="-lrt"; }
+ { check_lib clock_gettime time.h clock_gettime ||
+ check_lib clock_gettime time.h clock_gettime -lrt; }
check_func fcntl
check_func fork
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 dxgidebug.h
check_header dxva.h
check_header dxva2api.h
check_header io.h
check_header mach/mach_time.h
check_header malloc.h
check_header poll.h
-check_header sys/mman.h
check_header sys/param.h
check_header sys/resource.h
check_header sys/select.h
check_header valgrind/valgrind.h
check_header VideoDecodeAcceleration/VDADecoder.h
check_header windows.h
-check_header X11/extensions/XvMClib.h
# it seems there are versions of clang in some distros that try to use the
# gcc headers, which explodes for stdatomic
# so we also check that atomics actually work here
check_builtin stdatomic_h stdatomic.h "atomic_int foo; atomic_store(&foo, 0)"
+check_lib ole32 "windows.h" CoTaskMemFree -lole32
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
+check_type "cuviddec.h" "CUVIDH264PICPARAMS"
+check_type "cuviddec.h" "CUVIDHEVCPICPARAMS"
+check_struct "cuviddec.h" "CUVIDDECODECREATEINFO" bitDepthMinus8
+
check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
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_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
check_type "va/va.h va/va_enc_mpeg2.h" "VAEncPictureParameterBufferMPEG2"
check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
+check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
fi
enabled pthreads &&
- check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
+ check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
disabled zlib || check_lib zlib zlib.h zlibVersion -lz
disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
-check_lib libm math.h sin -lm && LIBM="-lm"
+# On some systems dynamic loading requires no extra linker flags
+check_lib libdl dlfcn.h dlopen || check_lib libdl dlfcn.h dlopen -ldl
+
+check_lib libm math.h sin -lm
atan2f_args=2
ldexpf_args=2
powf_args=2
for func in $MATH_FUNCS; do
- eval check_mathfunc $func \${${func}_args:-1} $LIBM
+ eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
done
# these are off by default, so fail if requested and not available
-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 avisynth && require_header avisynth/avisynth_c.h
+enabled avxsynth && require_header avxsynth/avxsynth_c.h
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 cuvid && require cuvid cuviddec.h cuvidCreateDecoder -lnvcuvid
+enabled frei0r && require_header frei0r.h
+enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
+enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
+enabled libdc1394 && require_pkg_config libdc1394 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 libfdk_aac && require_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen
+enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
+enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
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 libhdcd && require_pkg_config libhdcd libhdcd "hdcd/hdcd_simple.h" hdcd_new
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
-enabled libkvazaar && require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
-enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
+enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
+enabled libmfx && require_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
enabled libnpp && require libnpp npp.h nppGetLibVersion -lnppi -lnppc
enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
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 libopencv && require_pkg_config libopencv opencv opencv/cv.h cvCreateImageHeader
+enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
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
+ require_pkg_config libopenjpeg libopenjpeg1 openjpeg.h opj_version -DOPJ_STATIC; }
+enabled libopus && require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
+enabled libpulse && require_pkg_config libpulse libpulse-simple pulse/simple.h pa_simple_new
+enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
+enabled libschroedinger && require_pkg_config libschroedinger schroedinger-1.0 schroedinger/schro.h schro_init
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy
-enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
+enabled libspeex && require_pkg_config libspeex 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 && 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 libvpx && require_pkg_config libvpx "vpx >= 1.3.0" vpx/vpx_codec.h vpx_codec_version &&
+ { enabled libvpx_vp8_decoder &&
+ check_pkg_config libvpx_vp8_decoder vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx
+ enabled libvpx_vp8_encoder &&
+ check_pkg_config libvpx_vp8_encoder vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx
+ enabled libvpx_vp9_decoder &&
+ check_pkg_config libvpx_vp9_decoder vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx
+ enabled libvpx_vp9_encoder &&
+ check_pkg_config libvpx_vp9_encoder vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx
+ disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder &&
+ die "libvpx enabled but no supported decoders/encoders found"
+ }
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 libwebp && require_pkg_config libwebp libwebp webp/encode.h WebPGetEncoderVersion
+enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
+ require_cpp_condition x264.h "X264_BUILD >= 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 libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
+ require_cpp_condition x265.h "X265_BUILD >= 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 mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
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 && require_header OMX_Core.h
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_extralibs; } ||
+ die "ERROR: OpenMAX IL headers not found"; } && enable omx
+enabled openssl && { { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
+ check_pkg_config openssl openssl openssl/ssl.h SSL_library_init; } ||
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 ||
enabled gnutls && check_lib gmp gmp.h mpz_export -lgmp
if enabled nvenc; then
- check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."
- check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" ||
- die "ERROR: NVENC API version 5 or older is not supported"
+ require_header nvEncodeAPI.h
+ require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6"
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 &&
- enable sdl
-fi
+# SDL adds some CFLAGS that should not be part of the general CFLAGS.
+enabled avplay &&
+ test_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent
! disabled pod2man && check_cmd pod2man --help && enable pod2man || disable pod2man
! disabled texi2html && check_cmd texi2html -version && enable texi2html || disable texi2html
enabled_any alsa_indev alsa_outdev &&
check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
-enabled jack_indev && check_lib jack jack/jack.h jack_client_open -ljack &&
- check_func jack_port_get_latency_range -ljack
+enabled libjack &&
+ require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
enabled_any sndio_indev sndio_outdev && check_lib sndio sndio.h sio_open -lsndio
fi
if enabled libxcb; then
- check_pkg_config xcb-shape xcb/shape.h xcb_shape_rectangles || {
- enabled libxcb && die "ERROR: libxcb not found";
- } && enable libxcb
-
+ require_pkg_config libxcb xcb xcb/xcb.h xcb_connect
+ require_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_rectangles
disabled libxcb_shm ||
- check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
- enabled libxcb_shm && die "ERROR: libxcb_shm not found";
- } && check_header sys/shm.h && enable libxcb_shm
-
+ check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
disabled libxcb_xfixes ||
- check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
- enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
- } && enable libxcb_xfixes
-
- add_cflags "$xcb_shape_cflags $xcb_shm_cflags $xcb_xfixes_cflags"
- add_extralibs "$xcb_shape_extralibs $xcb_shm_extralibs $xcb_xfixes_extralibs"
+ check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
fi
-enabled dxva2 &&
- check_lib dxva2_lib windows.h CoTaskMemFree -lole32
+# d3d11va requires linking directly to dxgi and d3d11 if not building for
+# the desktop api partition
+check_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
+#ifdef WINAPI_FAMILY
+#include <winapifamily.h>
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#error desktop, not uwp
+#else
+// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
+#endif
+#else
+#error no family set
+#endif
+EOF
enabled vaapi && require vaapi va/va.h vaInitialize -lva
# add some linker flags
check_ldflags -Wl,--warn-common
check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
-enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
+enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
# add some strip flags
check_cflags -falign-stack=maintain-16-byte ||
disable aligned_stack
fi
-elif enabled ccc; then
- # disable some annoying warnings
- add_cflags -msg_disable bitnotint
- add_cflags -msg_disable mixfuncvoid
- add_cflags -msg_disable nonstandcast
- add_cflags -msg_disable unsupieee
elif enabled gcc; then
check_optflags -fno-tree-vectorize
check_cflags -Werror=implicit-function-declaration
disable inline_asm
elif enabled pathscale; then
add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
+ disable inline_asm
elif enabled_any msvc icl; then
enabled x86_32 && disable aligned_stack
enabled_all x86_32 debug && add_cflags -Oy-
;;
esac
-case $target_os in
- osf1)
- enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
- ;;
-esac
-
enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
check_deps $CONFIG_LIST \
$HAVE_LIST \
$ALL_COMPONENTS \
+flatten_extralibs(){
+ unset nested_entries
+ list_name=$1
+ eval list=\$${1}
+ for entry in $list; do
+ entry_copy=$entry
+ resolve entry_copy
+ append nested_entries $(filter '*_extralibs' $entry_copy)
+ flat_entries=$(filter_out '*_extralibs' $entry_copy)
+ eval $entry="\$flat_entries"
+ done
+ append $list_name "$nested_entries"
+
+ resolve nested_entries
+ if test -n "$(filter '*_extralibs' $nested_entries)"; then
+ flatten_extralibs $list_name
+ fi
+}
+
+for linkunit in $LIBRARY_LIST; do
+ unset current_extralibs
+ eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
+ for comp in ${components}; do
+ enabled $comp || continue
+ comp_extralibs="${comp}_extralibs"
+ append current_extralibs $comp_extralibs
+ done
+ eval prepend ${linkunit}_extralibs $current_extralibs
+done
+
+for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
+ flatten_extralibs ${linkunit}_extralibs
+ unique ${linkunit}_extralibs
+ resolve ${linkunit}_extralibs
+ eval ${linkunit}_extralibs=\$\(\$ldflags_filter \$${linkunit}_extralibs\)
+done
+
map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
for thread in $THREADS_LIST; do
echo "big-endian ${bigendian-no}"
echo "runtime cpu detection ${runtime_cpudetect-no}"
if enabled x86; then
- echo "${yasmexe} ${yasm-no}"
+ echo "standalone assembly ${x86asm-no}"
+ echo "x86 assembler ${x86asmexe}"
echo "MMX enabled ${mmx-no}"
echo "MMXEXT enabled ${mmxext-no}"
echo "3DNow! enabled ${amd3dnow-no}"
ARCH=$arch
INTRINSICS=$intrinsics
CC=$cc
-OBJCC=$cc
AS=$as
OBJCC=$objcc
LD=$ld
DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
DEPAS=$as
DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
-YASM=$yasmexe
-DEPYASM=$yasmexe
+X86ASM=$x86asmexe
+DEPX86ASM=$x86asmexe
+DEPX86ASMFLAGS=\$(X86ASMFLAGS)
AR=$ar
ARFLAGS=$arflags
AR_O=$ar_o
+AR_CMD=$ar
+NM_CMD=$nm
RANLIB=$ranlib
STRIP=$strip
LN_S=$ln_s
CC_C=$CC_C
CC_E=$CC_E
CC_O=$CC_O
+X86ASM_O=$X86ASM_O
LD_O=$LD_O
LD_LIB=$LD_LIB
LD_PATH=$LD_PATH
DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
LDEXEFLAGS=$LDEXEFLAGS
+LDSOFLAGS=$LDSOFLAGS
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
STRIPFLAGS=$STRIPFLAGS
-YASMFLAGS=$YASMFLAGS
+X86ASMFLAGS=$X86ASMFLAGS
LIBPREF=$LIBPREF
LIBSUF=$LIBSUF
LIBNAME=$LIBNAME
CCDEP_FLAGS=$CCDEP_FLAGS
ASDEP=$ASDEP
ASDEP_FLAGS=$ASDEP_FLAGS
+X86ASMDEP=$X86ASMDEP
+X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
CC_DEPFLAGS=$CC_DEPFLAGS
AS_DEPFLAGS=$AS_DEPFLAGS
+X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
HOSTCC=$host_cc
HOSTLD=$host_ld
HOSTCFLAGS=$host_cflags
TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
CFLAGS-avplay=$sdl_cflags
CFLAGS_HEADERS=$CFLAGS_HEADERS
-ZLIB=$($ldflags_filter -lz)
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
COMPAT_OBJS=$compat_objs
map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> avbuild/config.mak' $LIBRARY_LIST
-print_program_extralibs(){
- eval "program_extralibs=\$${1}_extralibs"
- eval echo "EXTRALIBS-${1}=${program_extralibs}" >> avbuild/config.mak
-}
-
-map 'print_program_extralibs $v' $PROGRAM_LIST
+for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
+ eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> avbuild/config.mak
+done
cat > $TMPH <<EOF
/* Automatically generated by configure - do not modify! */
test -n "$malloc_prefix" &&
echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
-if enabled yasm; then
+if enabled x86asm; then
append config_files $TMPASM
printf '' >$TMPASM
fi
cp_if_changed $TMPH config.h
touch avbuild/.config
-enabled yasm && cp_if_changed $TMPASM config.asm
+enabled x86asm && cp_if_changed $TMPASM config.asm
cat > $TMPH <<EOF
/* Generated by ffconf */
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
source_path=${source_path}
LIBPREF=${LIBPREF}
LIBSUF=${LIBSUF}
-extralibs_avutil="$LIBRT $LIBM"
-extralibs_avcodec="$extralibs"
-extralibs_avformat="$extralibs"
-extralibs_avdevice="$extralibs"
-extralibs_avfilter="$extralibs"
-extralibs_avresample="$LIBM"
-extralibs_swscale="$LIBM"
+extralibs_avutil="$avutil_extralibs"
+extralibs_avcodec="$avcodec_extralibs"
+extralibs_avformat="$avformat_extralibs"
+extralibs_avdevice="$avdevice_extralibs"
+extralibs_avfilter="$avfilter_extralibs"
+extralibs_avresample="$avresample_extralibs"
+extralibs_swscale="$swscale_extralibs"
EOF
for lib in $LIBRARY_LIST; do