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])
5 if test "${libdir}" = '${exec_prefix}/lib'; then
7 x86_64|ppc64|powerpc64)
8 libdir='${exec_prefix}/lib64'
11 libdir='${exec_prefix}/lib'
18 install="/usr/bin/install"
25 libdir='${exec_prefix}/lib'
26 ldconfig='echo no ldconfig on darwin'
34 ldconfig="echo no ldconfig on solaris"
35 LIBS="$LIBS -lsocket -lnsl"
41 if test "$ac_cv_prog_gcc" = yes; then
42 CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
45 LOGDIR='${localstatedir}/log'
47 [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]],
49 if test ! -z "$LOGDIR"; then
50 if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then
51 AC_MSG_ERROR([--with-logdir must specify a path])
56 AC_ARG_WITH([examples],
57 [ --without-examples Disable build of examples],
58 [ENABLE_EXAMPLES="no"],
59 [ENABLE_EXAMPLES="yes"]
61 AC_SUBST(ENABLE_EXAMPLES)
63 AC_ARG_WITH([ldconfig],
64 [ --without-ldconfig Disable call of ldconfig on make install],
65 [ldconfig='echo ldconfig disabled'])
67 if test x"$cross_compiling" = xyes; then
68 ldconfig='echo crosscompiling: ldconfig disabled'
71 AC_CONFIG_HEADER(config.h)
75 #AC_CHECK_HEADERS(sched.h)
76 #AC_CHECK_FUNCS(mlockall)
78 AC_CACHE_CHECK([for sin_len in sock],libnfs_cv_HAVE_SOCK_SIN_LEN,[
79 AC_TRY_COMPILE([#include <sys/types.h>
80 #include <sys/socket.h>
81 #include <netinet/in.h>],
82 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
83 libnfs_cv_HAVE_SOCK_SIN_LEN=yes,libnfs_cv_HAVE_SOCK_SIN_LEN=no)])
84 if test x"$libnfs_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
85 AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
91 #AC_SUBST(LIBNFS_LDFLAGS)