configure.ac: Add --with-utempter and --without-utempter

The default is to detect the presence of the library, as before.

Suggested by Michael Weber (github: xmw).

Closes #88.
This commit is contained in:
Keegan McAllister
2012-03-27 22:16:52 -04:00
parent 3b2604b81c
commit 2c4bf49490
+12 -4
View File
@@ -61,11 +61,19 @@ AC_ARG_ENABLE([examples],
AM_CONDITIONAL([BUILD_EXAMPLES], [test x"$build_examples" != xno]) AM_CONDITIONAL([BUILD_EXAMPLES], [test x"$build_examples" != xno])
# Checks for libraries. # Checks for libraries.
AC_SEARCH_LIBS([utempter_remove_added_record], [utempter], AC_ARG_WITH([utempter],
[AC_DEFINE([HAVE_UTEMPTER], [1], [AS_HELP_STRING([--with-utempter], [write utmp entries using libutempter @<:@check@:>@])],
[Define if libutempter is available.])], [with_utempter="$withval"],
[AC_MSG_WARN([Unable to find libutempter; utmp entries will not be made.])]) [with_utempter="check"])
AS_IF([test x"$with_utempter" != xno],
[AC_SEARCH_LIBS([utempter_remove_added_record], [utempter],
[AC_DEFINE([HAVE_UTEMPTER], [1], [Define if libutempter is available.])],
[AS_IF([test x"$with_utempter" = xcheck],
[AC_MSG_WARN([Unable to find libutempter; utmp entries will not be made.])],
[AC_MSG_ERROR([--with-utempter was given but libutempter was not found.])])])])
AC_SEARCH_LIBS([compress], [z], , [AC_MSG_ERROR([Unable to find zlib.])]) AC_SEARCH_LIBS([compress], [z], , [AC_MSG_ERROR([Unable to find zlib.])])
AX_BOOST_BASE(, , [AC_MSG_ERROR([Unable to find boost libraries.])]) AX_BOOST_BASE(, , [AC_MSG_ERROR([Unable to find boost libraries.])])
AC_ARG_WITH([skalibs], AC_ARG_WITH([skalibs],