Fix example linkage under solaris
[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: logdir
26AC_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
35AC_SUBST(LOGDIR)
84004dbf 36
6c437065
TN
37#option: examples
38AC_ARG_ENABLE([examples],
39 [AC_HELP_STRING([--enable-examples],
40 [Build example programs])],
41 [ENABLE_EXAMPLES=$enableval],
42 [ENABLE_EXAMPLES="no"])
13283beb
TN
43
44if test x$ENABLE_EXAMPLES = xyes; then
45 MAYBE_EXAMPLES="examples"
46fi
6c437065
TN
47AC_SUBST(MAYBE_EXAMPLES)
48
fc01d2a9
TN
49case $host in
50 *darwin*)
51 RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t"
52 ;;
53 *solaris*)
54 AC_CHECK_HEADERS([sys/filio.h])
4a75cfa2
TN
55 if test x$ENABLE_EXAMPLES = xyes; then
56 AC_CHECK_LIB([socket], [main], , [AC_MSG_ERROR([Can not find required library])])
57 AC_CHECK_LIB([nsl], [main], , [AC_MSG_ERROR([Can not find required library])])
58 fi
fc01d2a9
TN
59 ;;
60 *)
61 ;;
62esac
63
64AC_SUBST(RPCGENFLAGS)
65
6c437065
TN
66#output
67AC_CONFIG_FILES([Makefile]
68 [include/Makefile]
69 [lib/Makefile]
70 [mount/Makefile]
71 [nfs/Makefile]
72 [portmap/Makefile]
73 [rquota/Makefile]
74 [examples/Makefile]
75 )
76
77AC_OUTPUT