enable $name && eval ${name}_extralibs="\$@"
}
-check_pkg_config(){
- log check_pkg_config "$@"
+test_pkg_config(){
+ log test_pkg_config "$@"
name="$1"
pkg_version="$2"
pkg="${2%% *}"
pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
enable $name &&
- add_cflags "$pkg_cflags" &&
- eval $(sanitize_var_name ${name}_extralibs)="\$pkg_libs"
+ 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_LIST="
AVFoundation_AVFoundation_h
- alsa_asoundlib_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
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
fcntl
- flt_lim
fork
getaddrinfo
gethrtime
gmtime_r
inet_aton
isatty
- LoadLibrary
localtime_r
mach_absolute_time
MapViewOfFile
memalign
- mkstemp
mmap
mprotect
nanosleep
h264parse
h264pred
h264qpel
- hevc_ps
+ hevcparse
hpeldsp
huffman
huffyuvdsp
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"
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"
zmbv_encoder_deps="zlib"
# hardware accelerators
-d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
+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"
h264_vaapi_encoder_select="cbs_h264 vaapi_encode"
hevc_nvenc_encoder_deps="nvenc"
hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser hevc_qsv_hwaccel qsvdec"
-hevc_qsv_encoder_select="hevc_ps qsvenc"
+hevc_qsv_encoder_select="hevcparse qsvenc"
hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
hevc_vaapi_encoder_select="cbs_h265 vaapi_encode"
mjpeg_qsv_encoder_deps="libmfx"
# 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"
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
-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)
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
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 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
require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6"
fi
-# SDL is "special" and adds some CFLAGS that should not pollute anything else.
-if enabled avplay; then
- CFLAGS_SAVE=$CFLAGS
- check_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent &&
- sdl_cflags=$pkg_cflags
- CFLAGS=$CFLAGS_SAVE
-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
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
;;
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 \