- removed unneeded dependency to libpopt
[deb_libnfs.git] / configure.ac
CommitLineData
84004dbf
RS
1AC_PREREQ(2.50)
2AC_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']))
3AC_CONFIG_SRCDIR([lib/init.c])
4
5if 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
14fi
15
16is_solaris="no"
17install="/usr/bin/install"
18ldconfig="ldconfig"
19
20case `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 ;;
33esac
34
35if test "$ac_cv_prog_gcc" = yes; then
36 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
37fi
38
39LOGDIR='${localstatedir}/log'
40AC_ARG_WITH([logdir],
41 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
42 LOGDIR=$withval)
43if 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
47fi
48AC_SUBST(LOGDIR)
49
50AC_CONFIG_HEADER(config.h)
51
52EXTRA_OBJ=""
53
54#AC_CHECK_HEADERS(sched.h)
55#AC_CHECK_FUNCS(mlockall)
56
57AC_CACHE_CHECK([for sin_len in sock],libnfs_cv_HAVE_SOCK_SIN_LEN,[
58AC_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);],
62libnfs_cv_HAVE_SOCK_SIN_LEN=yes,libnfs_cv_HAVE_SOCK_SIN_LEN=no)])
63if 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])
65fi
84004dbf
RS
66AC_SUBST(libdir)
67AC_SUBST(install)
68AC_SUBST(ldconfig)
69#AC_SUBST(LIBNFS_LDFLAGS)
70
71AC_OUTPUT(Makefile)