-AC_MSG_CHECKING(whether there is a local nbd.h)
-if test -f nbd.h; then
- AC_DEFINE(HAVE_LOCAL_NBD_H,1, [Define to 1 if you want to use a local nbd.h (not provided, must be supplied by you)])
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-AC_CHECK_HEADERS([linux/nbd.h],,,
-[[#define u32 unsigned int
-#define u64 unsigned long int
+AC_SUBST(NBD_CLIENT_NAME)
+AC_SEARCH_LIBS(bind, socket,, AC_MSG_ERROR([Could not find an implementation of the bind() system call]))
+AC_SEARCH_LIBS(inet_ntoa, nsl,, AC_MSG_ERROR([Could not find an implementation of the inet_ntoa() system call]))
+AC_SEARCH_LIBS(daemon, resolv,, AC_MSG_ERROR([Could not find an implementation of the daemon() system call]))
+AC_CHECK_HEADERS([sys/mount.h],,,
+[[#include <sys/param.h>