4bdc5a5048f11b18d8ace43c53e37e5b337034fc
[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 Darwin*)
24 libdir='${exec_prefix}/lib'
25 ;;
26 AIX*)
27 ;;
28 SunOS)
29 is_solaris="yes"
30 install="ginstall"
31 ldconfig="echo no ldconfig on solaris"
32 LIBS="$LIBS -lsocket -lnsl"
33 ;;
34 *)
35 ;;
36 esac
37
38 if test "$ac_cv_prog_gcc" = yes; then
39 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
40 fi
41
42 LOGDIR='${localstatedir}/log'
43 AC_ARG_WITH([logdir],
44 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
45 LOGDIR=$withval)
46 if test ! -z "$LOGDIR"; then
47 if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
48 AC_MSG_ERROR([--with-logdir must specify a path])
49 fi
50 fi
51 AC_SUBST(LOGDIR)
52
53 AC_CONFIG_HEADER(config.h)
54
55 EXTRA_OBJ=""
56
57 #AC_CHECK_HEADERS(sched.h)
58 #AC_CHECK_FUNCS(mlockall)
59
60 AC_CACHE_CHECK([for sin_len in sock],libnfs_cv_HAVE_SOCK_SIN_LEN,[
61 AC_TRY_COMPILE([#include <sys/types.h>
62 #include <sys/socket.h>
63 #include <netinet/in.h>],
64 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
65 libnfs_cv_HAVE_SOCK_SIN_LEN=yes,libnfs_cv_HAVE_SOCK_SIN_LEN=no)])
66 if test x"$libnfs_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
67 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
68 fi
69 AC_SUBST(libdir)
70 AC_SUBST(install)
71 AC_SUBST(ldconfig)
72 #AC_SUBST(LIBNFS_LDFLAGS)
73
74 AC_OUTPUT(Makefile)