[Rpm-maint] [PATCH] configure --with-external-db should fall back to internal if not specified.

Mark Wielaard mjw at redhat.com
Fri Mar 18 16:17:53 UTC 2016


configure.ac implies that there is a fall back to the internal db if
no external one is specified or found. But that doesn't work since
with_external_db defaults to no when not --with[out]-external-db isn't
given. Fix that by defaulting to "maybe" and then first check for an
external db before falling back to the internal db if available.
---
 configure.ac | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3befb15..3f693c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -374,10 +374,10 @@ AC_ARG_WITH(external_db, [AS_HELP_STRING([--with-external-db],[build against an
 yes|no) ;;
 *) AC_MSG_ERROR([invalid argument to --with-external-db]) ;;
 esac],
-[with_external_db=no])
+[with_external_db=maybe])
 
 case "$with_external_db" in
-yes )
+yes|maybe )
   AC_CHECK_HEADERS([db.h],[
     AC_PREPROC_IFELSE([
       AC_LANG_SOURCE([
@@ -390,10 +390,23 @@ yes )
       [ AC_MSG_ERROR([Berkeley DB version >= 4.5 required])
     ])
   ],[
+    case "$with_external_db" in
+    maybe)
+    # Fall back to internal db if available
+    if [ test -x db/dist/configure ]; then
+      AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
+      with_external_db=no
+    else
+      AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL])
+    fi
+    ;;
+    yes)
     AC_MSG_ERROR([missing required header db.h])
+    ;;
+    esac
   ])
   ;;
-* ) # Fall back to internal db if available
+no )
   if [ test -x db/dist/configure ]; then
     AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
   else
-- 
2.5.0



More information about the Rpm-maint mailing list