- fixed library path for mac osx (there is no lib64 path here...)
[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 ;;
2e4fb8e6
M
23 Darwin*)
24 libdir='${exec_prefix}/lib'
25 ;;
84004dbf
RS
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 ;;
36esac
37
38if test "$ac_cv_prog_gcc" = yes; then
39 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
40fi
41
42LOGDIR='${localstatedir}/log'
43AC_ARG_WITH([logdir],
44 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
45 LOGDIR=$withval)
46if 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
50fi
51AC_SUBST(LOGDIR)
52
53AC_CONFIG_HEADER(config.h)
54
55EXTRA_OBJ=""
56
57#AC_CHECK_HEADERS(sched.h)
58#AC_CHECK_FUNCS(mlockall)
59
60AC_CACHE_CHECK([for sin_len in sock],libnfs_cv_HAVE_SOCK_SIN_LEN,[
61AC_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);],
65libnfs_cv_HAVE_SOCK_SIN_LEN=yes,libnfs_cv_HAVE_SOCK_SIN_LEN=no)])
66if 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])
68fi
84004dbf
RS
69AC_SUBST(libdir)
70AC_SUBST(install)
71AC_SUBST(ldconfig)
72#AC_SUBST(LIBNFS_LDFLAGS)
73
74AC_OUTPUT(Makefile)