2 AC_INIT([libnfs], [1.0.0])
3 AC_CONFIG_HEADERS([config.h])
4 AM_INIT_AUTOMAKE([foreign])
7 # Work around stupid autoconf default cflags. pt 1
8 SAVE_CFLAGS="x${CFLAGS}"
15 # Work around stupid autoconf default cflags. pt 2
16 if test "$SAVE_CFLAGS" = "x"; then
20 AC_CHECK_PROG([HAVE_RPCGEN], [rpcgen], [yes], [no])
21 if test x$HAVE_RPCGEN != xyes; then
22 AC_MSG_ERROR([Can not find required program])
26 AC_ARG_ENABLE([examples],
27 [AC_HELP_STRING([--enable-examples],
28 [Build example programs])],
29 [ENABLE_EXAMPLES=$enableval],
30 [ENABLE_EXAMPLES="no"])
32 if test x$ENABLE_EXAMPLES = xyes; then
33 MAYBE_EXAMPLES="examples"
35 AC_SUBST(MAYBE_EXAMPLES)
38 [AC_HELP_STRING([--enable-tirpc],
39 [enable use of TI-RPC @<:@default=no@:>@])],
40 enable_tirpc=$enableval,
45 RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
48 RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
51 AC_CHECK_HEADERS([sys/filio.h])
52 AC_CHECK_HEADERS([sys/sockio.h])
53 if test x$ENABLE_EXAMPLES = xyes; then
54 AC_CHECK_LIB([socket], [main], , [AC_MSG_ERROR([Can not find required library])])
55 AC_CHECK_LIB([nsl], [main], , [AC_MSG_ERROR([Can not find required library])])
65 dnl Check if sockaddr data structure includes a "sa_len"
66 AC_CHECK_MEMBER([struct sockaddr.sa_len],
67 [ AC_DEFINE(HAVE_SOCKADDR_LEN,1,[Whether sockaddr struct has sa_len]) ],
70 #include <sys/types.h>
71 #include <sys/socket.h>
74 echo "Use TI-RPC: $enable_tirpc"
75 if test "$enable_tirpc" = "yes"; then
76 CFLAGS="${CFLAGS} -I /usr/include/tirpc"
77 LDFLAGS="${LDFLAGS} -ltirpc"
81 AC_CONFIG_FILES([Makefile]