Fix compile error on solaris.
[deb_libnfs.git] / configure.ac
1 AC_PREREQ(2.50)
2 AC_INIT([libnfs], [0.0.0])
3 AC_CONFIG_HEADERS([config.h])
4 AM_INIT_AUTOMAKE([foreign])
5 AC_CANONICAL_HOST
6
7 # Work around stupid autoconf default cflags. pt 1
8 SAVE_CFLAGS="x${CFLAGS}"
9
10 AC_PROG_CC
11 AC_PROG_LIBTOOL
12
13 AM_PROG_CC_C_O
14
15 # Work around stupid autoconf default cflags. pt 2
16 if test "$SAVE_CFLAGS" = "x"; then
17 CFLAGS=""
18 fi
19
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])
23 fi
24
25 # option: logdir
26 AC_ARG_WITH([logdir],
27 [AC_HELP_STRING([--with-logdir=DIR],
28 [path to log directory [[LOCALSTATEDIR/log]]])],
29 [LOGDIR=$withval],
30 [LOGDIR='${localstatedir}/log'])
31
32 #if test ! -d "$LOGDIR"; then
33 # AC_MSG_ERROR([--with-logdir must specify a path])
34 #fi
35 AC_SUBST(LOGDIR)
36
37 #option: examples
38 AC_ARG_ENABLE([examples],
39 [AC_HELP_STRING([--enable-examples],
40 [Build example programs])],
41 [ENABLE_EXAMPLES=$enableval],
42 [ENABLE_EXAMPLES="no"])
43
44 if test x$ENABLE_EXAMPLES = xyes; then
45 MAYBE_EXAMPLES="examples"
46 fi
47 AC_SUBST(MAYBE_EXAMPLES)
48
49 case $host in
50 *darwin*)
51 RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
52 ;;
53 *solaris*)
54 AC_CHECK_HEADERS([sys/filio.h])
55 ;;
56 *)
57 ;;
58 esac
59
60 AC_SUBST(RPCGENFLAGS)
61
62 #output
63 AC_CONFIG_FILES([Makefile]
64 [include/Makefile]
65 [lib/Makefile]
66 [mount/Makefile]
67 [nfs/Makefile]
68 [portmap/Makefile]
69 [rquota/Makefile]
70 [examples/Makefile]
71 )
72
73 AC_OUTPUT