check_header(){
log check_header "$@"
- header=$1
+ headers=$1
shift
- disable_sanitized $header
- check_cpp "$@" <<EOF && enable_sanitized $header
-#include <$header>
-int x;
-EOF
+ disable_sanitized $headers
+ {
+ for hdr in $headers; do
+ print_include $hdr
+ done
+ echo "int x;"
+ } | check_cpp "$@" && enable_sanitized $headers
}
check_header_objcc(){
require_header(){
log require "$@"
- header="$1"
+ headers="$1"
shift
- check_header "$header" "$@" || die "ERROR: $header header not found"
+ check_header "$headers" "$@" || die "ERROR: $headers not found"
}
require_cpp_condition(){
protocols
"
-AVRESAMPLE_COMPONENTS=""
-
-AVUTIL_COMPONENTS=""
-
COMPONENT_LIST="
$AVCODEC_COMPONENTS
$AVDEVICE_COMPONENTS
$AVFILTER_COMPONENTS
$AVFORMAT_COMPONENTS
- $AVRESAMPLE_COMPONENTS
- $AVUTIL_COMPONENTS
"
EXAMPLE_LIST="
ES2_gl_h
gsm_h
io_h
- mach_mach_time_h
machine_ioctl_bt848_h
machine_ioctl_meteor_h
malloc_h
opencv2_core_core_c_h
OpenGL_gl3_h
poll_h
- soundcard_h
- stdatomic_h
sys_param_h
sys_resource_h
sys_select_h
clock_gettime
closesocket
CommandLineToArgvW
- CryptGenRandom
fcntl
- fork
getaddrinfo
gethrtime
getopt
as_func
as_object_arch
asm_mod_q
- attribute_may_alias
- attribute_packed
blocks_extension
ebp_available
ebx_available
vaapi_x11
vdpau_x11
winrt
+ wincrypt
"
# options emitted with CONFIG_ prefix but not available on the command line
libdc1394_indev_deps="libdc1394"
openal_indev_deps="openal"
opengl_outdev_deps="opengl"
-oss_indev_deps_any="soundcard_h sys_soundcard_h"
-oss_outdev_deps_any="soundcard_h sys_soundcard_h"
+oss_indev_deps_any="sys_soundcard_h"
+oss_outdev_deps_any="sys_soundcard_h"
pulse_indev_deps="libpulse"
pulse_outdev_deps="libpulse"
sdl2_outdev_deps="sdl2"
disabled logging && logfile=/dev/null
+# we need to build at least one lib type
+if ! enabled_any static shared; then
+ cat <<EOF
+At least one library type must be built.
+Specify --enable-static to build the static libraries or --enable-shared to
+build the shared libraries as well. To only build the shared libraries specify
+--disable-static in addition to --enable-shared.
+EOF
+ exit 1
+fi
+
die_license_disabled() {
enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
}
nm_default="dumpbin -symbols"
ar_default="lib"
case "$arch" in
+ aarch64|arm64)
+ as_default="armasm64"
+ ;;
arm*)
as_default="armasm"
;;
void *v = localtime_r;
EOF
+ eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
}
probe_libc
-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
set_default $PATHS_LIST
set_default nm
-# we need to build at least one lib type
-if ! enabled_any static shared; then
- cat <<EOF
-At least one library type must be built.
-Specify --enable-static to build the static libraries or --enable-shared to
-build the shared libraries as well. To only build the shared libraries specify
---disable-static in addition to --enable-shared.
-EOF
- exit 1
-fi
-
disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
enable_weak_pic() {
enable pic
add_cppflags -DPIC
case "$target_os" in
- mingw*|cygwin*)
+ mingw*|cygwin*|win*)
;;
*)
add_cflags -fPIC
+ add_asflags -fPIC
;;
esac
- add_asflags -fPIC
}
enabled pic && enable_weak_pic
void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
EOF
-check_cc <<EOF && enable attribute_packed
-struct { int x; } __attribute__((packed)) x;
-EOF
-
-check_cc <<EOF && enable attribute_may_alias
-union { int x; } __attribute__((may_alias)) x;
-EOF
-
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
.object_arch armv4
EOF
+ # MS armasm fails to assemble our PIC constructs
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
elif enabled mips; then
check_func getrusage
check_func gettimeofday
check_func isatty
-check_func mach_absolute_time
check_func mkstemp
check_func mmap
check_func mprotect
check_func_headers conio.h kbhit
check_func_headers io.h setmode
check_func_headers lzo/lzo1x.h lzo1x_999_compress
+check_func_headers mach/mach_time.h mach_absolute_time
check_func_headers stdlib.h getenv
check_func_headers sys/stat.h lstat
check_header dxva2api.h -D_WIN32_WINNT=0x0600
check_header io.h
check_header libcrystalhd/libcrystalhd_if.h
-check_header mach/mach_time.h
check_header malloc.h
check_header net/udplite.h
check_header poll.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, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)"
+check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0)"
check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
check_lib ole32 "windows.h" CoTaskMemFree -lole32
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
-enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init -lspeex
+enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
check_type "dshow.h" IBaseFilter
# check for ioctl_meteor.h, ioctl_bt848.h and alternatives
-{ check_header dev/bktr/ioctl_meteor.h &&
- check_header dev/bktr/ioctl_bt848.h; } ||
-{ check_header machine/ioctl_meteor.h &&
- check_header machine/ioctl_bt848.h; } ||
-{ check_header dev/video/meteor/ioctl_meteor.h &&
- check_header dev/video/bktr/ioctl_bt848.h; } ||
-check_header dev/ic/bt8xx.h
+check_header "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
+ check_header "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
+ check_header "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
+ check_header "dev/ic/bt8xx.h"
if check_struct sys/soundcard.h audio_buf_info bytes; then
enable_sanitized sys/soundcard.h
audio_buf_info abc;
EOF
fi
-check_header soundcard.h
enabled alsa && check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
fi
done
-if disabled stdatomic_h; then
+if disabled stdatomic; then
if enabled atomics_gcc; then
add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
elif enabled atomics_win32; then