From 10d2261539fa97d7c0e9227bd62cc4e6bef83d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Fri, 17 Aug 2012 19:55:11 -0700 Subject: 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. 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) -- cgit v0.10-9-g596f