2.7.8
[nbd.git] / configure.ac
blob040c9f380eb88c86741be8ccf16403a00988a8ba
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.8],[wouter@debian.org])
5 AM_INIT_AUTOMAKE(dist-bzip2 foreign)
7 AM_MAINTAINER_MODE
9 AC_ARG_ENABLE(
10   lfs, 
11   AC_HELP_STRING([--enable-lfs],[Enable Large File Support]),
12   [
13      if test "x$enableval" = "xyes" ; then
14         NBD_LFS=1
15      else
16         NBD_LFS=0
17      fi
18   ],
19   [NBD_LFS=0]
21 AC_MSG_CHECKING([whether Large File Support should be enabled])
22 if test $NBD_LFS -eq 1; then
23   AC_DEFINE(NBD_LFS,1, [Define to 1 if Large File Support should be enabled])
24   AC_MSG_RESULT([yes])
25 else
26   AC_DEFINE(NBD_LFS,0)
27   AC_MSG_RESULT([no])
30 AC_ARG_ENABLE(
31    syslog,
32    AC_HELP_STRING([--enable-syslog],[Enable Syslog logging]),
33    [
34       if test "x$enableval" = "xyes" ; then
35          ISSERVER=1
36       else
37          ISSERVER=0
38       fi
39    ],
40    [ISSERVER=0]
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])
45   AC_MSG_RESULT([yes])
46 else
47   AC_MSG_RESULT([no])
49 AC_PROG_CC
50 AC_MSG_CHECKING(whether warnings should be enabled)
51 if test -n "$GCC" ; then
52   AC_MSG_RESULT(yes)
53   CFLAGS="$CFLAGS -Wall -W -Wno-parentheses -Wstrict-prototypes -Wno-unused"
54 else
55   AC_MSG_RESULT(no)
57 #AC_PROG_INSTALL
58 AC_C_BIGENDIAN
59 AC_C_INLINE
60 AC_C_CONST
61 AC_CHECK_SIZEOF(unsigned short int)
62 AC_CHECK_SIZEOF(unsigned int)
63 AC_CHECK_SIZEOF(unsigned long int)
64 AC_CHECK_SIZEOF(unsigned long long int)
65 AC_CHECK_FUNCS([llseek alarm gethostbyname inet_ntoa memset socket strerror strstr])
66 AC_FUNC_FORK
67 AC_FUNC_SETVBUF_REVERSED
68 AC_MSG_CHECKING(whether client should be built)
69 case "`uname`" in
70      *Linux*) sbin_PROGRAMS=nbd-client
71               AC_MSG_RESULT(yes)
72               ;;
73      *) AC_MSG_RESULT(no) ;;
74 esac
75 AC_MSG_CHECKING(whether there is a local nbd.h)
76 if test -f nbd.h; then
77   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)])
78   AC_MSG_RESULT(yes)
79 else
80   AC_MSG_RESULT(no)
82 AC_CHECK_HEADERS([linux/nbd.h],,,
83 [[#define u32 unsigned int
84 #define u64 unsigned long int
85 #define __be32 unsigned int
86 #define __be64 unsigned long int
87 ]])
88 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/mount.h sys/socket.h syslog.h])
89 AC_HEADER_SYS_WAIT
90 AC_TYPE_OFF_T
91 AC_TYPE_PID_T
92 AC_SUBST(sbin_PROGRAMS)
93 AM_CONFIG_HEADER(config.h)
94 AC_CONFIG_FILES([Makefile])
95 AC_OUTPUT