This does a configure check for posix timers instead of only enabling
them on linux (and w32) hosts, so that -clock dynticks also works on
FreeBSD >= 7.0 (and possibly others.)
Index: qemu/configure
@@ -1025,11 +1025,26 @@
rt=yes
fi
+##########################################
+# posix timer probe
+cat > $TMPC <<EOF
+#include <time.h>
+int main(void) { timer_create(CLOCK_REALTIME, (struct sigevent *)NULL,
(timer_t *)NULL); return 0; }
+EOF
+posixtimer=no
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ posixtimer=yes
+elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt 2> /dev/null ; then
+ posixtimer=yes
+ rt=yes
+fi
+
if test "$rt" = "yes" ; then
# Hack, we should have a general purpose LIBS for this sort of thing
AIOLIBS="$AIOLIBS -lrt"
fi