- make unsigned hyper overridable by cmdline by specifying -DU_INT64_PLATTFORM_TYPE...
[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"
23701e42 17is_darwin="no"
84004dbf
RS
18install="/usr/bin/install"
19ldconfig="ldconfig"
20
21case `uname` in
22 Linux*)
23 ;;
2e4fb8e6
M
24 Darwin*)
25 libdir='${exec_prefix}/lib'
23701e42
M
26 ldconfig='echo no ldconfig on darwin'
27 is_darwin="yes"
2e4fb8e6 28 ;;
84004dbf
RS
29 AIX*)
30 ;;
31 SunOS)
32 is_solaris="yes"
33 install="ginstall"
34 ldconfig="echo no ldconfig on solaris"
35 LIBS="$LIBS -lsocket -lnsl"
36 ;;
37 *)
38 ;;
39esac
40
41if test "$ac_cv_prog_gcc" = yes; then
42 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
43fi
44
45LOGDIR='${localstatedir}/log'
46AC_ARG_WITH([logdir],
47 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
48 LOGDIR=$withval)
49if test ! -z "$LOGDIR"; then
50 if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
51 AC_MSG_ERROR([--with-logdir must specify a path])
52 fi
53fi
54AC_SUBST(LOGDIR)
55
23701e42
M
56AC_ARG_WITH([examples],
57 [ --without-examples Disable build of examples],
58 [ENABLE_EXAMPLES="no"],
59 [ENABLE_EXAMPLES="yes"]
60 )
61AC_SUBST(ENABLE_EXAMPLES)
62
84004dbf
RS
63AC_CONFIG_HEADER(config.h)
64
65EXTRA_OBJ=""
66
67#AC_CHECK_HEADERS(sched.h)
68#AC_CHECK_FUNCS(mlockall)
69
70AC_CACHE_CHECK([for sin_len in sock],libnfs_cv_HAVE_SOCK_SIN_LEN,[
71AC_TRY_COMPILE([#include <sys/types.h>
72#include <sys/socket.h>
73#include <netinet/in.h>],
74[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
75libnfs_cv_HAVE_SOCK_SIN_LEN=yes,libnfs_cv_HAVE_SOCK_SIN_LEN=no)])
76if test x"$libnfs_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
77 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
78fi
84004dbf
RS
79AC_SUBST(libdir)
80AC_SUBST(install)
81AC_SUBST(ldconfig)
23701e42 82AC_SUBST(is_darwin)
84004dbf
RS
83#AC_SUBST(LIBNFS_LDFLAGS)
84
85AC_OUTPUT(Makefile)