Commit | Line | Data |
---|---|---|
84004dbf RS |
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" | |
23701e42 | 17 | is_darwin="no" |
84004dbf RS |
18 | install="/usr/bin/install" |
19 | ldconfig="ldconfig" | |
20 | ||
21 | case `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 | ;; | |
39 | esac | |
40 | ||
41 | if test "$ac_cv_prog_gcc" = yes; then | |
42 | CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings" | |
43 | fi | |
44 | ||
45 | LOGDIR='${localstatedir}/log' | |
46 | AC_ARG_WITH([logdir], | |
47 | [ --with-logdir=DIR path to log directory [[LOCALSTATEDIR/log]]], | |
48 | LOGDIR=$withval) | |
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]) | |
52 | fi | |
53 | fi | |
54 | AC_SUBST(LOGDIR) | |
55 | ||
23701e42 M |
56 | AC_ARG_WITH([examples], |
57 | [ --without-examples Disable build of examples], | |
58 | [ENABLE_EXAMPLES="no"], | |
59 | [ENABLE_EXAMPLES="yes"] | |
60 | ) | |
61 | AC_SUBST(ENABLE_EXAMPLES) | |
62 | ||
e644e700 M |
63 | AC_ARG_WITH([ldconfig], |
64 | [ --without-ldconfig Disable call of ldconfig on make install], | |
65 | [ldconfig='echo ldconfig disabled']) | |
66 | ||
d20a6d6b SR |
67 | if test x"$cross_compiling" = xyes; then |
68 | ldconfig='echo crosscompiling: ldconfig disabled' | |
69 | fi | |
70 | ||
84004dbf RS |
71 | AC_CONFIG_HEADER(config.h) |
72 | ||
73 | EXTRA_OBJ="" | |
74 | ||
75 | #AC_CHECK_HEADERS(sched.h) | |
76 | #AC_CHECK_FUNCS(mlockall) | |
77 | ||
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]) | |
86 | fi | |
84004dbf RS |
87 | AC_SUBST(libdir) |
88 | AC_SUBST(install) | |
89 | AC_SUBST(ldconfig) | |
23701e42 | 90 | AC_SUBST(is_darwin) |
84004dbf RS |
91 | #AC_SUBST(LIBNFS_LDFLAGS) |
92 | ||
93 | AC_OUTPUT(Makefile) |