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-2006 Wouter Verhelst <wouter@debian.org>
4 AC_INIT([nbd],[3.3],[wouter@debian.org])
5 AM_INIT_AUTOMAKE(foreign dist-bzip2)
10 AC_HELP_STRING(--disable-lfs,Disable Large File Support (default on)),
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
42 AC_MSG_CHECKING([whether syslog logging is requested])
43 if test $ISSERVER -eq 1; then
44 AC_DEFINE(ISSERVER,1, [Define to 1 if you want nbd-server to log through syslog])
52 AC_HELP_STRING(--enable-debug,Build a debugging version of the server),
54 if test "x$enableval" = "xyes"; then
63 AC_MSG_CHECKING([whether a debugging version is requested])
64 if test $DODBG -eq 1; then
66 if test $ISSERVER -eq 1; then
67 AC_MSG_ERROR([You requested both syslog logging and a debugging version of the server. Bad idea!])
69 AC_DEFINE(DODBG,1,[Define if you want a debugging version of nbd-server (lots of copious output)])
70 AC_DEFINE(NOFORK,1,[Define if you don't want the nbd-server to fork()])
77 AC_HELP_STRING(--enable-sdp,Build a version of nbd-server with support for the Socket Direct Protocol (SDP). Requires you to build and install a kernel with the InfiniBand patches (default disabled)),
79 if test "x$enableval" = "xyes"; then
80 AC_DEFINE(WITH_SDP, 1, [Define to 1 if you have and want support for the Socket Direct Protocol])
92 AC_CHECK_SIZEOF(unsigned short int)
93 AC_CHECK_SIZEOF(unsigned int)
94 AC_CHECK_SIZEOF(unsigned long int)
95 AC_CHECK_SIZEOF(unsigned long long int)
96 AC_CHECK_FUNCS([llseek alarm gethostbyname inet_ntoa memset socket strerror strstr mkstemp fdatasync])
97 AC_CHECK_HEADERS([linux/falloc.h])
99 if test "x$ac_cv_header_linux_falloc_h" = "xyes"
101 AC_CHECK_DECL(FALLOC_FL_PUNCH_HOLE, [HAVE_FL_PH=yes], [HAVE_FL_PH=no], [[#include <linux/falloc.h>]])
104 AC_MSG_CHECKING([for FALLOC_FL_PUNCH_HOLE support])
105 if test "x$HAVE_FL_PH" = "xyes"
107 AC_DEFINE(HAVE_FALLOC_PH, 1, [Define to 1 if you have FALLOC_FL_PUNCH_HOLE])
110 AC_DEFINE(HAVE_FALLOC_PH, 0, [Define to 1 if you have FALLOC_FL_PUNCH_HOLE])
114 AC_CHECK_FUNC([sync_file_range],
115 [AC_DEFINE([HAVE_SYNC_FILE_RANGE], [sync_file_range(2) is not supported], [sync_file_range(2) is supported])],
118 AC_FUNC_SETVBUF_REVERSED
119 AC_MSG_CHECKING(whether client should be built)
121 linux*) NBD_CLIENT_NAME="nbd-client"
124 *) NBD_CLIENT_NAME=""
128 AC_SUBST(NBD_CLIENT_NAME)
129 AC_SEARCH_LIBS(bind, socket,, AC_MSG_ERROR([Could not find an implementation of the bind() system call]))
130 AC_SEARCH_LIBS(inet_ntoa, nsl,, AC_MSG_ERROR([Could not find an implementation of the inet_ntoa() system call]))
131 AC_SEARCH_LIBS(daemon, resolv,, AC_MSG_ERROR([Could not find an implementation of the daemon() system call]))
132 AC_CHECK_HEADERS([sys/mount.h],,,
133 [[#include <sys/param.h>
135 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h linux/types.h])
136 AM_PATH_GLIB_2_0(2.26.0, [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]))
140 nbd_server_CPPFLAGS=$nbd_server_CPPFLAGS" -DSYSCONFDIR='\"$sysconfdir\"'"
141 AC_SUBST(nbd_server_CPPFLAGS)
142 AC_CONFIG_HEADERS([config.h])
143 AC_CONFIG_FILES([Makefile doc/Doxyfile doc/Makefile man/Makefile man/nbd-client.8.sh man/nbd-server.5.sh man/nbd-server.1.sh man/nbd-trdump.1.sh])