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(){
+ log check_header_objcc "$@"
+ rm -f -- "$TMPO"
+ header=$1
+ shift
+ disable_sanitized $header
+ {
+ echo "#include <$header>"
+ echo "int main(void) { return 0; }"
+ } | check_objcc && check_stat "$TMPO" && enable_sanitized $header
+}
+
+check_apple_framework(){
+ log check_apple_framework "$@"
+ framework="$1"
+ name="$(tolower $framework)"
+ header="${framework}/${framework}.h"
+ disable $name
+ check_header_objcc $header &&
+ enable $name && eval ${name}_extralibs='"-framework $framework"'
+}
+
check_func(){
log check_func "$@"
func=$1
check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not found"
}
+require_cpp(){
+ name="$1"
+ headers="$2"
+ classes="$3"
+ shift 3
+ check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
+}
+
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(){
# w32api 3.12 had it defined wrong
check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
+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"
-check_header sys/soundcard.h
+if check_struct sys/soundcard.h audio_buf_info bytes; then
+ enable_sanitized sys/soundcard.h
+else
+ check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
+ #include <sys/soundcard.h>
+ audio_buf_info abc;
+EOF
+fi
-enabled_any alsa_indev alsa_outdev &&
+enabled alsa && check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
enabled libjack &&