add back a check for sa_len in sockaddr structure.
[deb_libnfs.git] / configure.ac
CommitLineData
84004dbf 1AC_PREREQ(2.50)
2842ff15 2AC_INIT([libnfs], [0.0.0])
6c437065
TN
3AC_CONFIG_HEADERS([config.h])
4AM_INIT_AUTOMAKE([foreign])
5AC_CANONICAL_HOST
84004dbf 6
6c437065
TN
7# Work around stupid autoconf default cflags. pt 1
8SAVE_CFLAGS="x${CFLAGS}"
84004dbf 9
6c437065
TN
10AC_PROG_CC
11AC_PROG_LIBTOOL
84004dbf 12
6c437065 13AM_PROG_CC_C_O
84004dbf 14
6c437065
TN
15# Work around stupid autoconf default cflags. pt 2
16if test "$SAVE_CFLAGS" = "x"; then
17 CFLAGS=""
84004dbf 18fi
e644e700 19
6c437065
TN
20AC_CHECK_PROG([HAVE_RPCGEN], [rpcgen], [yes], [no])
21if test x$HAVE_RPCGEN != xyes; then
22 AC_MSG_ERROR([Can not find required program])
d20a6d6b
SR
23fi
24
6c437065
TN
25#option: examples
26AC_ARG_ENABLE([examples],
27 [AC_HELP_STRING([--enable-examples],
28 [Build example programs])],
29 [ENABLE_EXAMPLES=$enableval],
30 [ENABLE_EXAMPLES="no"])
13283beb
TN
31
32if test x$ENABLE_EXAMPLES = xyes; then
33 MAYBE_EXAMPLES="examples"
34fi
6c437065
TN
35AC_SUBST(MAYBE_EXAMPLES)
36
fc01d2a9
TN
37case $host in
38 *darwin*)
39 RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
40 ;;
41 *solaris*)
42 AC_CHECK_HEADERS([sys/filio.h])
4a75cfa2
TN
43 if test x$ENABLE_EXAMPLES = xyes; then
44 AC_CHECK_LIB([socket], [main], , [AC_MSG_ERROR([Can not find required library])])
45 AC_CHECK_LIB([nsl], [main], , [AC_MSG_ERROR([Can not find required library])])
46 fi
fc01d2a9
TN
47 ;;
48 *)
49 ;;
50esac
51
52AC_SUBST(RPCGENFLAGS)
53
f7f931c7
RS
54# check for SA_LEN
55dnl Check if sockaddr data structure includes a "sa_len"
56AC_CHECK_MEMBER([struct sockaddr.sa_len],
57 [ AC_DEFINE(HAVE_SOCKADDR_LEN,1,[Whether sockaddr struct has sa_len]) ],
58 [],
59 [
60#include <sys/types.h>
61#include <sys/socket.h>
62])
63
6c437065
TN
64#output
65AC_CONFIG_FILES([Makefile]
66 [include/Makefile]
67 [lib/Makefile]
68 [mount/Makefile]
69 [nfs/Makefile]
70 [portmap/Makefile]
71 [rquota/Makefile]
72 [examples/Makefile]
73 )
74
75AC_OUTPUT