2 AC_INIT(libnfs, m4_esyscmd([grep 'Version:' ./packaging/RPM/libnfs.spec.in 2>/dev/null | head -1 | sed -e 's/[ \t]*Version:[ \t]*\([^ \t]*\)[ \t]*.*/\1/' | tr -d '\n']))
3 AC_CONFIG_SRCDIR([lib/init.c])
5 if test "${libdir}" = '${exec_prefix}/lib'; then
7 x86_64|ppc64|powerpc64)
8 libdir='${exec_prefix}/lib64'
11 libdir='${exec_prefix}/lib'
17 install="/usr/bin/install"
28 ldconfig="echo no ldconfig on solaris"
29 LIBS="$LIBS -lsocket -lnsl"
35 if test "$ac_cv_prog_gcc" = yes; then
36 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
39 LOGDIR='${localstatedir}/log'
41 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
43 if test ! -z "$LOGDIR"; then
44 if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
45 AC_MSG_ERROR([--with-logdir must specify a path])
50 AC_CONFIG_HEADER(config.h)
54 #AC_CHECK_HEADERS(sched.h)
55 #AC_CHECK_FUNCS(mlockall)
57 AC_CACHE_CHECK([for sin_len in sock],libnfs_cv_HAVE_SOCK_SIN_LEN,[
58 AC_TRY_COMPILE([#include <sys/types.h>
59 #include <sys/socket.h>
60 #include <netinet/in.h>],
61 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
62 libnfs_cv_HAVE_SOCK_SIN_LEN=yes,libnfs_cv_HAVE_SOCK_SIN_LEN=no)])
63 if test x"$libnfs_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
64 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
67 AC_MSG_CHECKING(whether libpopt is available)
68 ac_save_CFLAGS="$CFLAGS"
70 CFLAGS="$CFLAGS $GLIB_CFLAGS"
71 LIBS="$GLIB_LIBS $LIBS -lpopt"
74 * Just see if we can compile/link with popt
78 int main(int argc, const char *argv[])
80 struct poptOption popt_options[] = {
83 poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
87 ], ac_cv_have_popt=yes, ac_cv_have_popt=no,
88 [echo $ac_n "compile with POPT. Assuming OK... $ac_c"
90 CFLAGS="$ac_save_CFLAGS"
92 if test "$ac_cv_have_popt" = yes ; then
96 AC_MSG_NOTICE(You need libpopt to compile libnfs. Install the libpopt-dev package.)
103 #AC_SUBST(LIBNFS_LDFLAGS)