r63: Code style cleanup
[nbd.git] / configure.ac
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])
10   AC_MSG_RESULT([yes])
11 else
12   AC_DEFINE(NBD_LFS,0)
13   AC_MSG_RESULT([no])
14 fi
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])
19   AC_MSG_RESULT([yes])
20 else
21   AC_MSG_RESULT([no])
22 fi
23 AC_PROG_CC
24 AC_MSG_CHECKING(whether warnings should be enabled)
25 if test -n "$GCC" ; then
26   AC_MSG_RESULT(yes)
27   CFLAGS="$CFLAGS -Wall -W -Wno-parentheses -Wstrict-prototypes -Wno-unused"
28 else
29   AC_MSG_RESULT(no)
30 fi
31 #AC_PROG_INSTALL
32 AC_C_BIGENDIAN
33 AC_C_INLINE
34 AC_C_CONST
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])
40 AC_FUNC_FORK
41 AC_FUNC_SETVBUF_REVERSED
42 AC_MSG_CHECKING(whether client should be built)
43 case "`uname`" in
44      *Linux*) sbin_PROGRAMS=nbd-client
45               AC_MSG_RESULT(yes)
46               ;;
47      *) AC_MSG_RESULT(no) ;;
48 esac
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])
52   AC_MSG_RESULT(yes)
53 else
54   AC_MSG_RESULT(no)
55 fi
56 AC_CHECK_HEADERS([linux/nbd.h],,,
57 [[#define u32 unsigned int
58 #define u64 unsigned long int
59 ]])
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])
61 AC_HEADER_SYS_WAIT
62 AC_TYPE_OFF_T
63 AC_TYPE_PID_T
64 AC_SUBST(sbin_PROGRAMS)
65 AM_CONFIG_HEADER(config.h)
66 AC_CONFIG_FILES([Makefile])
67 AC_OUTPUT
68