From 0cdd3fee86c8f978ddf512b9d6416676a7077bc9 Mon Sep 17 00:00:00 2001 From: yoe Date: Tue, 23 Dec 2003 20:33:43 +0000 Subject: [PATCH] r42: Reverse the header-checking logic: use a local nbd.h and fall back to if it isn't available, instead of the other way around. --- cliserv.h | 9 +++++---- configure.in | 9 ++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cliserv.h b/cliserv.h index f4cde60..87051f1 100644 --- a/cliserv.h +++ b/cliserv.h @@ -36,13 +36,14 @@ typedef unsigned long long u64; #error I need at least some 64-bit type #endif +#ifdef HAVE_LOCAL_NBD_H +#include "nbd.h" +#else #ifdef HAVE_LINUX_NBD_H #include #else -/* get it from a kernel source somewhere, and dump it in this directory. - * Required for people trying to compile nbd-server on a non-linux - * system. */ -#include "nbd.h" +#error I need an nbd.h somewhere. Either install it in or put it in the current directory. +#endif #endif #if NBD_LFS==1 diff --git a/configure.in b/configure.in index f19efb1..15b1015 100644 --- a/configure.in +++ b/configure.in @@ -43,7 +43,14 @@ case "`uname`" in AC_MSG_RESULT(yes) ;; *) AC_MSG_RESULT(no) ;; - esac +esac +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 arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/mount.h sys/socket.h syslog.h]) AC_HEADER_SYS_WAIT AC_TYPE_OFF_T -- 1.7.10.4