Imported Upstream version 0.0~git20110724.48593f5
[deb_libnfs.git] / configure.ac
CommitLineData
dabf4152
AM
1AC_PREREQ(2.50)
2AC_INIT([libnfs], [0.0.0])
3AC_CONFIG_HEADERS([config.h])
4AM_INIT_AUTOMAKE([foreign])
5AC_CANONICAL_HOST
6
7# Work around stupid autoconf default cflags. pt 1
8SAVE_CFLAGS="x${CFLAGS}"
9
10AC_PROG_CC
11AC_PROG_LIBTOOL
12
13AM_PROG_CC_C_O
14
15# Work around stupid autoconf default cflags. pt 2
16if test "$SAVE_CFLAGS" = "x"; then
17 CFLAGS=""
18fi
19
20AC_CHECK_PROG([HAVE_RPCGEN], [rpcgen], [yes], [no])
21if test x$HAVE_RPCGEN != xyes; then
22 AC_MSG_ERROR([Can not find required program])
23fi
24
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"])
31
32if test x$ENABLE_EXAMPLES = xyes; then
33 MAYBE_EXAMPLES="examples"
34fi
35AC_SUBST(MAYBE_EXAMPLES)
36
3be27335
AM
37AC_ARG_ENABLE(tirpc,
38 [AC_HELP_STRING([--enable-tirpc],
39 [enable use of TI-RPC @<:@default=no@:>@])],
40 enable_tirpc=$enableval,
41 enable_tirpc='no')
42
dabf4152
AM
43case $host in
44 *darwin*)
45 RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
46 ;;
3be27335
AM
47 *cygwin*)
48 RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
49 ;;
dabf4152
AM
50 *solaris*)
51 AC_CHECK_HEADERS([sys/filio.h])
52 if test x$ENABLE_EXAMPLES = xyes; then
53 AC_CHECK_LIB([socket], [main], , [AC_MSG_ERROR([Can not find required library])])
54 AC_CHECK_LIB([nsl], [main], , [AC_MSG_ERROR([Can not find required library])])
55 fi
56 ;;
57 *)
58 ;;
59esac
60
61AC_SUBST(RPCGENFLAGS)
62
63# check for SA_LEN
64dnl Check if sockaddr data structure includes a "sa_len"
65AC_CHECK_MEMBER([struct sockaddr.sa_len],
66 [ AC_DEFINE(HAVE_SOCKADDR_LEN,1,[Whether sockaddr struct has sa_len]) ],
67 [],
68 [
69#include <sys/types.h>
70#include <sys/socket.h>
71])
72
3be27335
AM
73echo "Use TI-RPC: $enable_tirpc"
74if test "$enable_tirpc" = "yes"; then
75 CFLAGS="${CFLAGS} -I /usr/include/tirpc"
76 LDFLAGS="${LDFLAGS} -ltirpc"
77fi
78
dabf4152
AM
79#output
80AC_CONFIG_FILES([Makefile]
81 [include/Makefile]
82 [lib/Makefile]
83 [mount/Makefile]
84 [nfs/Makefile]
85 [portmap/Makefile]
86 [rquota/Makefile]
87 [examples/Makefile]
88 )
89
90AC_OUTPUT