1 dnl Configure script for NBD system
2 dnl (c) 1998 Martin Mares <mj@ucw.cz>, (c) 2000 Pavel Machek <pavel@ucw.cz>,
3 dnl (c) 2003-2004 Wouter Verhelst <wouter@debian.org>
4 AC_INIT([nbd],[2.7.99pre2.8],[wouter@debian.org])
9 AC_HELP_STRING(--enable-lfs,Enable Large File Support),
11 if test "x$enableval" = "xyes" ; then
19 AC_MSG_CHECKING([whether Large File Support should be enabled])
20 if test $NBD_LFS -eq 1; then
21 AC_DEFINE(NBD_LFS,1, [Define to 1 if Large File Support should be enabled])
30 AC_HELP_STRING(--enable-syslog,Enable Syslog logging),
32 if test "x$enableval" = "xyes" ; then
40 AC_MSG_CHECKING([whether syslog logging is requested])
41 if test $ISSERVER -eq 1; then
42 AC_DEFINE(ISSERVER,1, [Define to 1 if you want nbd-server to log through syslog])
54 AC_CHECK_SIZEOF(unsigned short int)
55 AC_CHECK_SIZEOF(unsigned int)
56 AC_CHECK_SIZEOF(unsigned long int)
57 AC_CHECK_SIZEOF(unsigned long long int)
58 AC_CHECK_FUNCS([llseek alarm gethostbyname inet_ntoa memset socket strerror strstr])
60 AC_FUNC_SETVBUF_REVERSED
61 AC_MSG_CHECKING(whether client should be built)
63 *Linux*) sbin_PROGRAMS=nbd-client
66 *) AC_MSG_RESULT(no) ;;
68 AC_MSG_CHECKING(where to find a working nbd.h)
69 dnl We need to check for NBD_CMD_DISC, but that's part of an enum, it is not
70 dnl #define'd. Therefore, we check for something which is differently #define'd
71 dnl in the old or new versions, even if we don't really care about that.
72 dnl This might break at some time, but it should work for now, so...
73 AC_TRY_CPP([#include "nbd.h"
74 #ifdef LOCAL_END_REQUEST
78 [AC_DEFINE(NBD_H, "nbd.h", Set to where a (recent enough) nbd.h can be found)
80 AC_TRY_CPP([#include <linux/nbd.h>
81 #ifdef LOCAL_END_REQUEST
85 [AC_DEFINE(NBD_H, <linux/nbd.h>) NBD_H='<linux/nbd.h>'],
86 AC_MSG_ERROR(Could not find a (recent enough) nbd.h)
90 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/mount.h sys/socket.h syslog.h])
91 AM_PATH_GLIB_2_0(2.2.0, [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]))
95 AC_SUBST(sbin_PROGRAMS)
96 AC_CONFIG_HEADERS([config.h])
97 AC_CONFIG_FILES([Makefile])