summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in93
1 files changed, 33 insertions, 60 deletions
diff --git a/configure.in b/configure.in
index a4d3776..2b67720 100644
--- a/configure.in
+++ b/configure.in
@@ -1,66 +1,39 @@
- AC_INIT(rpcbind, 0.2.0)
+AC_INIT(rpcbind, 0.2.0)
- AM_INIT_AUTOMAKE
-# AM_MAINTAINER_MODE
+AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/rpcbind.c])
- AC_PROG_CC
- AM_CONFIG_HEADER(config.h)
- AC_HEADER_DIRENT
- AC_PREFIX_DEFAULT(/usr)
-
-AC_CONFIG_SRCDIR([src/config.h.in])
-AC_CONFIG_HEADERS([src/config.h])
-
-AC_PROG_LIBTOOL
-
-AC_ARG_ENABLE(debug,[ --enable-debug Turns on rpcbind debugging],
- [case "${enableval}" in
- yes) debug=true ;;
- no) debug=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
- esac],[debug=false])
-AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
-
-AC_ARG_ENABLE(warmstarts,[ --enable-warmstarts Enables Warm Starts],
- [case "${enableval}" in
- yes) warmstarts=true ;;
- no) warmstarts=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-warmstarts) ;;
- esac],[warmstarts=false])
-AM_CONDITIONAL(WARMSTART, test x$warmstarts = xtrue)
-
-if test "$warmstarts" = "true" ; then
- AC_ARG_WITH(statedir,
- [ --with-statedir=/foo use state dir /foo [/tmp]],
- statedir=$withval,
- statedir=/tmp)
- AC_SUBST(statedir)
- AC_DEFINE_UNQUOTED(RPCBIND_STATEDIR, "$statedir", [This defines the location where the state files will be kept for warm starts])
-fi
-AC_ARG_WITH(rpcuser,
- [ --with-rpcuser=user uid to use [root]],
- rpcuser=$withval,
- rpcuser=root)
- AC_SUBST(rpcuser)
-AC_DEFINE_UNQUOTED(RPCBIND_USER, "$rpcuser", [This defines the uid to run as])
-
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h \
- netinet/in.h stdlib.h string.h \
- sys/param.h sys/socket.h \
- sys/time.h syslog.h \
- unistd.h nss.h])
-
-AC_CHECK_LIB([pthread], [pthread_create])
-
+AC_PREFIX_DEFAULT(/usr)
+AC_PROG_CC
+
+AC_ARG_ENABLE([libwrap],
+ AS_HELP_STRING([--enable-libwrap], [Enables host name checking through tcpd @<:@default=no@:>@]))
+AM_CONDITIONAL(LIBWRAP, test x$enable_libwrap = xyes)
+
+AC_ARG_ENABLE([debug],
+ AS_HELP_STRING([--enable-debug], [Turns on rpcbind debugging @<:@default=no@:>@]))
+AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)
+
+AC_ARG_ENABLE([warmstarts],
+ AS_HELP_STRING([--enable-warmstarts], [Enables Warm Starts @<:@default=no@:>@]))
+AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes)
+
+AC_ARG_WITH([statedir],
+ AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/tmp@:>@])
+ ,, [with_statedir=/tmp])
+AC_SUBST([statedir], [$with_statedir])
+
+AC_ARG_WITH([rpcuser],
+ AS_HELP_STRING([--with-rpcuser=ARG], [use ARG for RPC @<:@default=root@:>@]),
+ ,, [with_rpcuser=root])
+AC_SUBST([rpcuser], [$with_rpcuser])
+
PKG_CHECK_MODULES([TIRPC], [libtirpc])
-AC_ARG_ENABLE(libwrap,[ --enable-libwrap Enables host name checking],
- [case "${enableval}" in
- yes) libwarp=true
- AC_CHECK_LIB([wrap], [hosts_access]) ;;
- no) libwarp=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-libwrap) ;;
- esac],[libwarp=false])
-AM_CONDITIONAL(LIBWRAP, test x$libwarp = xtrue)
+AS_IF([test x$enable_libwrap = xyes], [
+ AC_CHECK_LIB([wrap], [hosts_access], ,
+ AC_MSG_ERROR([libwrap support requested but unable to find libwrap]))
+])
+
+AC_SEARCH_LIBS([pthread_create], [pthread])
AC_OUTPUT([Makefile])