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.8.0-rc1],[wouter@debian.org])
5 AM_INIT_AUTOMAKE(foreign dist-bzip2)
8 dnl Assume we want LFS. If there's some weird operating system out there that
9 dnl doesn't support it, we can always add a check.
12 dnl AC_HELP_STRING(--enable-lfs,Enable Large File Support),
14 dnl if test "x$enableval" = "xyes" ; then
23 AC_MSG_CHECKING([whether Large File Support should be enabled])
24 if test $NBD_LFS -eq 1; then
25 AC_DEFINE(NBD_LFS,1, [Define to 1 if Large File Support should be enabled])
34 AC_HELP_STRING(--enable-syslog,Enable Syslog logging),
36 if test "x$enableval" = "xyes" ; then
44 AC_MSG_CHECKING([whether syslog logging is requested])
45 if test $ISSERVER -eq 1; then
46 AC_DEFINE(ISSERVER,1, [Define to 1 if you want nbd-server to log through syslog])
58 AC_CHECK_SIZEOF(unsigned short int)
59 AC_CHECK_SIZEOF(unsigned int)
60 AC_CHECK_SIZEOF(unsigned long int)
61 AC_CHECK_SIZEOF(unsigned long long int)
62 AC_CHECK_FUNCS([llseek alarm gethostbyname inet_ntoa memset socket strerror strstr])
64 AC_FUNC_SETVBUF_REVERSED
65 AC_MSG_CHECKING(whether client should be built)
67 *Linux*) sbin_PROGRAMS=nbd-client
70 *) AC_MSG_RESULT(no) ;;
72 AC_MSG_CHECKING(where to find a working nbd.h)
73 dnl We need to check for NBD_CMD_DISC, but that's part of an enum, it is not
74 dnl #define'd. Therefore, we check for something which is differently #define'd
75 dnl in the old or new versions, even if we don't really care about that.
76 dnl This might break at some time, but it should work for now, so...
77 AC_TRY_CPP([#include "nbd.h"
78 #ifdef LOCAL_END_REQUEST
82 [AC_DEFINE(NBD_H_LOCAL, 1, Set to 1 if a (recent enough) nbd.h can be found in the current directory)
84 AC_TRY_CPP([#include <linux/nbd.h>
85 #ifdef LOCAL_END_REQUEST
89 [AC_DEFINE(NBD_H_LINUX, 1, Set to 1 if a (recent enough) nbd.h can be found in the linux directory in the search path) NBD_H='<linux/nbd.h>'],
90 AC_MSG_ERROR(Could not find a (recent enough) nbd.h)
94 AC_CHECK_HEADERS([sys/mount.h],,,
95 [[#include <sys/param.h>
97 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h])
98 AM_PATH_GLIB_2_0(2.2.0, [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]))
102 AC_SUBST(sbin_PROGRAMS)
103 AC_CONFIG_HEADERS([config.h])
104 AC_CONFIG_FILES([Makefile])