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
4 AC_INIT([nbd],[2.7],[wouter@debian.org])
5 AM_INIT_AUTOMAKE(nbd, 2.7)
6 AC_ARG_ENABLE(lfs, AC_HELP_STRING([--enable-lfs],[Enable Large File Support]), [NBD_LFS=1], [NBD_LFS=0])
7 AC_MSG_CHECKING([whether Large File Support should be enabled])
8 if test $NBD_LFS -eq 1; then
9 AC_DEFINE(NBD_LFS,1, [Define to 1 if Large File Support should be enabled])
15 AC_ARG_ENABLE(syslog, AC_HELP_STRING([--enable-syslog],[Enable Syslog logging]), [ISSERVER=1], [ISSERVER=0])
16 AC_MSG_CHECKING([whether syslog logging is requested])
17 if test $ISSERVER -eq 1; then
18 AC_DEFINE(ISSERVER,1, [Define to 1 if you want nbd-server to log through syslog])
24 AC_MSG_CHECKING(whether warnings should be enabled)
25 if test -n "$GCC" ; then
27 CFLAGS="$CFLAGS -Wall -W -Wno-parentheses -Wstrict-prototypes -Wno-unused"
35 AC_CHECK_SIZEOF(unsigned short int)
36 AC_CHECK_SIZEOF(unsigned int)
37 AC_CHECK_SIZEOF(unsigned long int)
38 AC_CHECK_SIZEOF(unsigned long long int)
39 AC_CHECK_FUNCS([llseek alarm gethostbyname inet_ntoa memset socket strerror strstr])
41 AC_FUNC_SETVBUF_REVERSED
42 AC_MSG_CHECKING(whether client should be built)
44 *Linux*) sbin_PROGRAMS=nbd-client
47 *) AC_MSG_RESULT(no) ;;
49 AC_MSG_CHECKING(whether there is a local nbd.h)
50 if test -f nbd.h; then
51 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])
56 AC_CHECK_HEADERS([linux/nbd.h],,,
57 [[#define u32 unsigned int
58 #define u64 unsigned long int
60 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/mount.h sys/socket.h syslog.h])
64 AC_SUBST(sbin_PROGRAMS)
65 AM_CONFIG_HEADER(config.h)
66 AC_CONFIG_FILES([Makefile])