summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2012-08-18 02:55:11 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-05-12 12:15:13 (GMT)
commit10d2261539fa97d7c0e9227bd62cc4e6bef83d45 (patch)
treeb4522ca591d5338f180ca106650c561705a93e78 /configure.in
parenteeca6e0f05ce59361e6084deab6117c240520cdb (diff)
downloadmonitoring-plugins-10d2261539fa97d7c0e9227bd62cc4e6bef83d45.tar.gz
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.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in91
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
255LIBS="$_SAVEDLIBS" 255LIBS="$_SAVEDLIBS"
256CPPFLAGS="$_SAVEDCPPFLAGS" 256CPPFLAGS="$_SAVEDCPPFLAGS"
257 257
258AC_ARG_WITH([dbi], [AS_HELP_STRING([--without-dbi], [Skips the dbi plugin])])
258dnl Check for DBI libraries 259dnl Check for DBI libraries
259_SAVEDLIBS="$LIBS" 260AS_IF([test "x$with_dbi" != "xno"], [
260AC_CHECK_LIB(dbi,dbi_initialize) 261 _SAVEDLIBS="$LIBS"
261if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then 262 AC_CHECK_LIB(dbi,dbi_initialize)
262 EXTRAS="$EXTRAS check_dbi" 263 if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then
263 DBILIBS="-ldbi" 264 EXTRAS="$EXTRAS check_dbi"
264 AC_SUBST(DBILIBS) 265 DBILIBS="-ldbi"
265else 266 AC_SUBST(DBILIBS)
266 AC_MSG_WARN([Skipping dbi plugin]) 267 else
267 AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).]) 268 AC_MSG_WARN([Skipping dbi plugin])
268fi 269 AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).])
269LIBS="$_SAVEDLIBS" 270 fi
271 LIBS="$_SAVEDLIBS"
272])
273
274AC_ARG_WITH([radius], [AS_HELP_STRING([--without-radius], [Skips the radius plugin])])
270 275
271dnl Check for radius libraries 276dnl Check for radius libraries
272_SAVEDLIBS="$LIBS" 277AS_IF([test "x$with_radius" != "xno"], [
273AC_CHECK_LIB(radiusclient,rc_read_config) 278 _SAVEDLIBS="$LIBS"
274if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then 279 AC_CHECK_LIB(radiusclient,rc_read_config)
275 EXTRAS="$EXTRAS check_radius" 280 if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
276 RADIUSLIBS="-lradiusclient"
277 AC_SUBST(RADIUSLIBS)
278else
279 AC_CHECK_LIB(radiusclient-ng,rc_read_config)
280 if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
281 EXTRAS="$EXTRAS check_radius" 281 EXTRAS="$EXTRAS check_radius"
282 RADIUSLIBS="-lradiusclient-ng" 282 RADIUSLIBS="-lradiusclient"
283 AC_SUBST(RADIUSLIBS) 283 AC_SUBST(RADIUSLIBS)
284 else 284 else
285 AC_MSG_WARN([Skipping radius plugin]) 285 AC_CHECK_LIB(radiusclient-ng,rc_read_config)
286 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) 286 if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
287 EXTRAS="$EXTRAS check_radius"
288 RADIUSLIBS="-lradiusclient-ng"
289 AC_SUBST(RADIUSLIBS)
290 else
291 AC_MSG_WARN([Skipping radius plugin])
292 AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
293 fi
287 fi 294 fi
288fi 295 LIBS="$_SAVEDLIBS"
289LIBS="$_SAVEDLIBS" 296])
297
298AC_ARG_WITH([ldap], [AS_HELP_STRING([--without-ldap], [Skips the LDAP plugin])])
290 299
291dnl Check for LDAP libraries 300dnl Check for LDAP libraries
292_SAVEDLIBS="$LIBS" 301AS_IF([test "x$with_ldap" != "xno"], [
293AC_CHECK_LIB(ldap,main,,,-llber) 302 _SAVEDLIBS="$LIBS"
294if test "$ac_cv_lib_ldap_main" = "yes"; then 303 AC_CHECK_LIB(ldap,main,,,-llber)
295 LDAPLIBS="-lldap -llber"\ 304 if test "$ac_cv_lib_ldap_main" = "yes"; then
296 LDAPINCLUDE="-I/usr/include/ldap" 305 LDAPLIBS="-lldap -llber"\
297 AC_SUBST(LDAPLIBS) 306 LDAPINCLUDE="-I/usr/include/ldap"
298 AC_SUBST(LDAPINCLUDE) 307 AC_SUBST(LDAPLIBS)
299 AC_CHECK_FUNCS(ldap_set_option) 308 AC_SUBST(LDAPINCLUDE)
300 EXTRAS="$EXTRAS check_ldap" 309 AC_CHECK_FUNCS(ldap_set_option)
301 AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s) 310 EXTRAS="$EXTRAS check_ldap"
302else 311 AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
303 AC_MSG_WARN([Skipping LDAP plugin]) 312 else
304 AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).]) 313 AC_MSG_WARN([Skipping LDAP plugin])
305fi 314 AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
306LIBS="$_SAVEDLIBS" 315 fi
316 LIBS="$_SAVEDLIBS"
317])
307 318
308dnl Check for headers used by check_ide_smart 319dnl Check for headers used by check_ide_smart
309AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no) 320AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)