--- ./configure.ac.orig	2017-05-16 10:32:11.000000000 +0200
+++ ./configure.ac	2018-01-05 14:00:09.261806009 +0100
@@ -512,7 +512,11 @@
 
 have_libdbi=no
 
-AC_ARG_ENABLE(libdbi,AS_HELP_STRING([--disable-libdbi],[do not build in support for libdbi]),[],[
+AC_ARG_ENABLE(libdbi,AS_HELP_STRING([--disable-libdbi],[do not build in support for libdbi]),
+[],
+[enable_libdbi=yes])
+
+AS_IF([test "x$enable_libdbi" != xno], [
     AC_CHECK_HEADER(dbi/dbi.h, [
        AC_CHECK_LIB(dbi, dbi_initialize, [
            AC_DEFINE(HAVE_LIBDBI,[1],[have got libdbi installed])
@@ -526,7 +530,11 @@
 
 have_librados=no
 
-AC_ARG_ENABLE(librados,AS_HELP_STRING([--disable-librados],[do not build in support for librados]),[],[
+AC_ARG_ENABLE(librados,AS_HELP_STRING([--disable-librados],[do not build in support for librados]),
+[],
+[enable_librados=yes])
+
+AS_IF([test "x$enable_librados" != xno], [
     AC_CHECK_HEADER(rados/librados.h, [
         AC_DEFINE(HAVE_LIBRADOS,[1],[have got librados installed])
         LIBS="${LIBS} -lrados"
@@ -538,7 +546,11 @@
 
 have_libwrap=no
 
-AC_ARG_ENABLE(libwrap, AS_HELP_STRING([--disable-libwrap], [do not build in support for libwrap (tcp wrapper)]),[],[
+AC_ARG_ENABLE(libwrap, AS_HELP_STRING([--disable-libwrap], [do not build in support for libwrap (tcp wrapper)]),
+[],
+[enable_libwrap=yes])
+
+AS_IF([test "x$enable_libwrap" != xno], [
     AC_CHECK_HEADER(tcpd.h,[
         AC_CHECK_FUNCS(hosts_access, [
             AC_DEFINE(HAVE_LIBWRAP,[1],[have got libwrap installed])
@@ -554,7 +566,6 @@
     ])
 ])
 
-
 AM_CONDITIONAL(BUILD_LIBWRAP,[test $have_libwrap != no])
 
 AM_CONDITIONAL(BUILD_RRDGRAPH,[test $enable_rrd_graph != no])
