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])
5 AM_INIT_AUTOMAKE(foreign dist-bzip2)
10 AC_HELP_STRING(--enable-lfs,Enable Large File Support),
12 if test "x$enableval" = "xyes" ; then
20 AC_MSG_CHECKING([whether Large File Support should be enabled])
21 if test $NBD_LFS -eq 1; then
22 AC_DEFINE(NBD_LFS,1, [Define to 1 if Large File Support should be enabled])
31 AC_HELP_STRING(--enable-syslog,Enable Syslog logging),
33 if test "x$enableval" = "xyes" ; then
41 AC_MSG_CHECKING([whether syslog logging is requested])
42 if test $ISSERVER -eq 1; then
43 AC_DEFINE(ISSERVER,1, [Define to 1 if you want nbd-server to log through syslog])
55 AC_CHECK_SIZEOF(unsigned short int)
56 AC_CHECK_SIZEOF(unsigned int)
57 AC_CHECK_SIZEOF(unsigned long int)
58 AC_CHECK_SIZEOF(unsigned long long int)
59 AC_CHECK_FUNCS([llseek alarm gethostbyname inet_ntoa memset socket strerror strstr])
61 AC_FUNC_SETVBUF_REVERSED
62 AC_MSG_CHECKING(whether client should be built)
64 *Linux*) sbin_PROGRAMS=nbd-client
67 *) AC_MSG_RESULT(no) ;;
69 AC_MSG_CHECKING(where to find a working nbd.h)
70 dnl We need to check for NBD_CMD_DISC, but that's part of an enum, it is not
71 dnl #define'd. Therefore, we check for something which is differently #define'd
72 dnl in the old or new versions, even if we don't really care about that.
73 dnl This might break at some time, but it should work for now, so...
74 AC_TRY_CPP([#include "nbd.h"
75 #ifdef LOCAL_END_REQUEST
79 [AC_DEFINE(NBD_H_LOCAL, 1, Set to 1 if a (recent enough) nbd.h can be found in the current directory)
81 AC_TRY_CPP([#include <linux/nbd.h>
82 #ifdef LOCAL_END_REQUEST
86 [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>'],
87 AC_MSG_ERROR(Could not find a (recent enough) nbd.h)
91 AC_CHECK_HEADERS([sys/mount.h],,,
92 [[#include <sys/param.h>
94 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h])
95 AM_PATH_GLIB_2_0(2.2.0, [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]))
99 AC_SUBST(sbin_PROGRAMS)
100 AC_CONFIG_HEADERS([config.h])
101 AC_CONFIG_FILES([Makefile])