- removed unneeded dependency to libpopt
[deb_libnfs.git] / configure.ac
1 AC_PREREQ(2.50)
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])
4
5 if test "${libdir}" = '${exec_prefix}/lib'; then
6 case `uname -m` in
7 x86_64|ppc64|powerpc64)
8 libdir='${exec_prefix}/lib64'
9 ;;
10 *)
11 libdir='${exec_prefix}/lib'
12 ;;
13 esac
14 fi
15
16 is_solaris="no"
17 install="/usr/bin/install"
18 ldconfig="ldconfig"
19
20 case `uname` in
21 Linux*)
22 ;;
23 AIX*)
24 ;;
25 SunOS)
26 is_solaris="yes"
27 install="ginstall"
28 ldconfig="echo no ldconfig on solaris"
29 LIBS="$LIBS -lsocket -lnsl"
30 ;;
31 *)
32 ;;
33 esac
34
35 if test "$ac_cv_prog_gcc" = yes; then
36 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
37 fi
38
39 LOGDIR='${localstatedir}/log'
40 AC_ARG_WITH([logdir],
41 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
42 LOGDIR=$withval)
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])
46 fi
47 fi
48 AC_SUBST(LOGDIR)
49
50 AC_CONFIG_HEADER(config.h)
51
52 EXTRA_OBJ=""
53
54 #AC_CHECK_HEADERS(sched.h)
55 #AC_CHECK_FUNCS(mlockall)
56
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])
65 fi
66 AC_SUBST(libdir)
67 AC_SUBST(install)
68 AC_SUBST(ldconfig)
69 #AC_SUBST(LIBNFS_LDFLAGS)
70
71 AC_OUTPUT(Makefile)