Build system fixes and documentation
[nbd.git] / configure.ac
index 3ebb983..51787db 100644 (file)
@@ -98,7 +98,7 @@ AC_FUNC_FORK
 AC_FUNC_SETVBUF_REVERSED
 AC_MSG_CHECKING(whether client should be built)
 case $host_os in
-     linux*) sbin_PROGRAMS=nbd-client
+     linux*) sbin_PROGRAMS="$sbin_PROGRAMS nbd-client"
              AC_MSG_RESULT(yes)
               ;;
      *) AC_MSG_RESULT(no) ;;
@@ -109,8 +109,13 @@ AC_TRY_COMPILE([#define u32 int
 #define __be32 int
 #define __be64 int
 #include "nbd.h"
+#ifdef __GNUC__
+#define UNUSED __attribute__((__unused__))
+#else
+#define UNUSED
+#endif
 ],
-[int foo=NBD_CMD_DISC], 
+[int UNUSED foo=NBD_CMD_DISC], 
   [AC_DEFINE(NBD_H_LOCAL, 1, Set to 1 if a (2.6) nbd.h can be found in the current directory)
     NBD_H='"nbd.h"'],
   AC_TRY_COMPILE([#define u32 int
@@ -118,13 +123,23 @@ AC_TRY_COMPILE([#define u32 int
 #define __be32 int
 #define __be64 int
 #include <linux/nbd.h>
+#ifdef __GNUC__
+#define UNUSED __attribute__((__unused__))
+#else
+#define UNUSED
+#endif
   ],
-[int foo=NBD_CMD_DISC],
+[int UNUSED foo=NBD_CMD_DISC],
     [AC_DEFINE(NBD_H_LINUX, 1, Set to 1 if a (2.6) nbd.h can be found in the linux directory in the search path)
       NBD_H='<linux/nbd.h>'],
     AC_TRY_COMPILE([#include <linux/nbd.h>
+#ifdef __GNUC__
+#define UNUSED __attribute__((__unused__))
+#else
+#define UNUSED
+#endif
       ],
-      [int foo=NBD_CMD_DISC],
+      [int UNUSED foo=NBD_CMD_DISC],
       [AC_DEFINE(NBD_H_LINUX, 1, Set to 1 if a (2.6) nbd.h can be found in the linux directory in the search path)
         NBD_H='<linux/nbd.h>'],
     AC_MSG_ERROR(Could not find an nbd.h from 2.6 or above.)
@@ -145,7 +160,7 @@ AC_SEARCH_LIBS(daemon, resolv,, AC_MSG_ERROR([Could not find an implementation o
 AC_CHECK_HEADERS([sys/mount.h],,,
 [[#include <sys/param.h>
 ]])
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h])
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h linux/types.h])
 AM_PATH_GLIB_2_0(2.6.0, [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]))
 AC_HEADER_SYS_WAIT
 AC_TYPE_OFF_T