[nagiosplug] configure: add --without-ldap, --without-radius ...
Nagios Plugin Development
nagios-plugins at users.sourceforge.net
Sun May 12 14:30:41 CEST 2013
Module: nagiosplug
Branch: master
Commit: 10d2261539fa97d7c0e9227bd62cc4e6bef83d45
Author: Diego Elio Pettenò <flameeyes at flameeyes.eu>
Committer: Holger Weiss <holger at zedat.fu-berlin.de>
Date: Fri Aug 17 19:55:11 2012 -0700
URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=10d2261
configure: add --without-ldap, --without-radius and --without-dbi options.
When building for distributions such as Gentoo Linux, or FreeBSD
ports, it's convenient to be able to disable building certain
functionalities even if the dependencies are present, to avoid what
are called "automagic dependendencies".
Adding these parameters solve the issue.
---
configure.in | 91 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 51 insertions(+), 40 deletions(-)
diff --git a/configure.in b/configure.in
index 1d4ed00..25c0c9c 100644
--- a/configure.in
+++ b/configure.in
@@ -255,55 +255,66 @@ fi
LIBS="$_SAVEDLIBS"
CPPFLAGS="$_SAVEDCPPFLAGS"
+AC_ARG_WITH([dbi], [AS_HELP_STRING([--without-dbi], [Skips the dbi plugin])])
dnl Check for DBI libraries
-_SAVEDLIBS="$LIBS"
-AC_CHECK_LIB(dbi,dbi_initialize)
-if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then
- EXTRAS="$EXTRAS check_dbi"
- DBILIBS="-ldbi"
- AC_SUBST(DBILIBS)
-else
- AC_MSG_WARN([Skipping dbi plugin])
- AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).])
-fi
-LIBS="$_SAVEDLIBS"
+AS_IF([test "x$with_dbi" != "xno"], [
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(dbi,dbi_initialize)
+ if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then
+ EXTRAS="$EXTRAS check_dbi"
+ DBILIBS="-ldbi"
+ AC_SUBST(DBILIBS)
+ else
+ AC_MSG_WARN([Skipping dbi plugin])
+ AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).])
+ fi
+ LIBS="$_SAVEDLIBS"
+])
+
+AC_ARG_WITH([radius], [AS_HELP_STRING([--without-radius], [Skips the radius plugin])])
dnl Check for radius libraries
-_SAVEDLIBS="$LIBS"
-AC_CHECK_LIB(radiusclient,rc_read_config)
-if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
- EXTRAS="$EXTRAS check_radius"
- RADIUSLIBS="-lradiusclient"
- AC_SUBST(RADIUSLIBS)
-else
- AC_CHECK_LIB(radiusclient-ng,rc_read_config)
- if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
+AS_IF([test "x$with_radius" != "xno"], [
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(radiusclient,rc_read_config)
+ if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
EXTRAS="$EXTRAS check_radius"
- RADIUSLIBS="-lradiusclient-ng"
+ RADIUSLIBS="-lradiusclient"
AC_SUBST(RADIUSLIBS)
else
- AC_MSG_WARN([Skipping radius plugin])
- AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
+ AC_CHECK_LIB(radiusclient-ng,rc_read_config)
+ if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius"
+ RADIUSLIBS="-lradiusclient-ng"
+ AC_SUBST(RADIUSLIBS)
+ else
+ AC_MSG_WARN([Skipping radius plugin])
+ AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
+ fi
fi
-fi
-LIBS="$_SAVEDLIBS"
+ LIBS="$_SAVEDLIBS"
+])
+
+AC_ARG_WITH([ldap], [AS_HELP_STRING([--without-ldap], [Skips the LDAP plugin])])
dnl Check for LDAP libraries
-_SAVEDLIBS="$LIBS"
-AC_CHECK_LIB(ldap,main,,,-llber)
-if test "$ac_cv_lib_ldap_main" = "yes"; then
- LDAPLIBS="-lldap -llber"\
- LDAPINCLUDE="-I/usr/include/ldap"
- AC_SUBST(LDAPLIBS)
- AC_SUBST(LDAPINCLUDE)
- AC_CHECK_FUNCS(ldap_set_option)
- EXTRAS="$EXTRAS check_ldap"
- AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
-else
- AC_MSG_WARN([Skipping LDAP plugin])
- AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
-fi
-LIBS="$_SAVEDLIBS"
+AS_IF([test "x$with_ldap" != "xno"], [
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(ldap,main,,,-llber)
+ if test "$ac_cv_lib_ldap_main" = "yes"; then
+ LDAPLIBS="-lldap -llber"\
+ LDAPINCLUDE="-I/usr/include/ldap"
+ AC_SUBST(LDAPLIBS)
+ AC_SUBST(LDAPINCLUDE)
+ AC_CHECK_FUNCS(ldap_set_option)
+ EXTRAS="$EXTRAS check_ldap"
+ AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
+ else
+ AC_MSG_WARN([Skipping LDAP plugin])
+ AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
+ fi
+ LIBS="$_SAVEDLIBS"
+])
dnl Check for headers used by check_ide_smart
AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
More information about the Commits
mailing list