+##########################################
+# bluez support probe
+if test "$bluez" = "yes" ; then
+ `pkg-config bluez` || bluez="no"
+fi
+if test "$bluez" = "yes" ; then
+ cat > $TMPC << EOF
+#include <bluetooth/bluetooth.h>
+int main(void) { return bt_error(0); }
+EOF
+ bluez_cflags=`pkg-config --cflags bluez`
+ bluez_libs=`pkg-config --libs bluez`
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
+ $bluez_libs > /dev/null 2> /dev/null ; then
+ :
+ else
+ bluez="no"
+ fi
+fi
+
+##########################################
+# kvm probe
+if test "$kvm" = "yes" ; then
+ cat > $TMPC <<EOF
+#include <linux/kvm.h>
+#if !defined(KVM_API_VERSION) || \
+ KVM_API_VERSION < 12 || \
+ KVM_API_VERSION > 12 || \
+ !defined(KVM_CAP_USER_MEMORY) || \
+ !defined(KVM_CAP_SET_TSS_ADDR) || \
+ !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
+#error Invalid KVM version
+#endif
+int main(void) { return 0; }
+EOF
+ if test "$kerneldir" != "" ; then
+ kvm_cflags=-I"$kerneldir"/include
+ else
+ kvm_cflags=""
+ fi
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
+ > /dev/null 2>/dev/null ; then
+ :
+ else
+ kvm="no"
+ fi
+fi
+
+##########################################
+# AIO probe
+AIOLIBS=""
+
+if test "$aio" = "yes" ; then
+ aio=no
+ cat > $TMPC << EOF
+#include <pthread.h>
+int main(void) { pthread_mutex_t lock; return 0; }
+EOF
+ if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
+ aio=yes
+ AIOLIBS="-lpthread"
+ fi
+fi
+
+##########################################
+# iovec probe
+cat > $TMPC <<EOF
+#include <sys/uio.h>
+int main(void) { struct iovec iov; return 0; }
+EOF
+iovec=no
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+ iovec=yes
+fi
+
+##########################################
+# fdt probe
+if test "$fdt" = "yes" ; then
+ fdt=no
+ cat > $TMPC << EOF
+int main(void) { return 0; }
+EOF
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
+ fdt=yes
+ fi
+fi
+