+dnl Check and set OS
+
+AC_CANONICAL_HOST
+
+case $host_os in
+ *linux*)
+ AC_DEFINE(HAVE_LINUX)
+ [ rm -f src/device.c; ln -sf linux/device.c src/device.c ]
+ ;;
+ *freebsd*)
+ AC_DEFINE(HAVE_FREEBSD)
+ [ rm -f src/device.c; ln -sf freebsd/device.c src/device.c ]
+ ;;
+ *solaris*)
+ AC_DEFINE(HAVE_SOLARIS)
+ [ rm -f src/device.c; ln -sf solaris/device.c src/device.c ]
+ ;;
+ *openbsd*)
+ AC_DEFINE(HAVE_OPENBSD)
+ [ rm -f src/device.c; ln -sf openbsd/device.c src/device.c ]
+ ;;
+ *netbsd*)
+ AC_DEFINE(HAVE_NETBSD)
+ [ rm -f src/device.c; ln -sf netbsd/device.c src/device.c ]
+ ;;
+esac
+
+AC_CACHE_SAVE
+