From f2a250702a4d4f2735cacffef033ad8b6e3062d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ralf=20Cors=C3=A9pius?= Date: Tue, 18 Sep 2007 05:01:45 +0200 Subject: [PATCH] Add preliminary --with/without-internal-db processing. --- configure.ac | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 726b076..79c02e3 100644 --- a/configure.ac +++ b/configure.ac @@ -464,10 +464,36 @@ AC_SUBST(WITH_POPT_LIB) #================= -dnl ------------------ with internal db -AC_DEFINE(HAVE_DB3_DB_H, 1, [Define if you have the header file]) -# FIXME: Temporary helper until external BDB is fully supported -with_internal_db=yes +# Process --with/without-internal-db +## FIXME: Intentionally kept hidden until things have matured. +case "$with_internal_db" in +no ) + AC_CHECK_HEADER([db.h],[ + save_LIBS="$LIBS" + AC_CHECK_LIB([db],[db_create],[],[ + AC_MSG_ERROR([missing db_create in libdb]) + ]) + AC_CHECK_LIB([db],[db_env_create],[],[ + AC_MSG_ERROR([missing db_env_create in libdb]) + ]) + AC_CHECK_LIB([db],[db_env_set_func_fsync],[],[ + AC_MSG_ERROR([missing db_env_set_func_fsync in libdb]) + ]) + AC_CHECK_LIB([db],[db_strerror],[],[ + AC_MSG_ERROR([missing db_strerror in libdb]) + ]) + WITH_DB_LIB=-ldb + LIBS="$save_LIBS" + ],[ + AC_MSG_ERROR([missing required header db.h]) + ]) + ;; +* ) # Fall back to internal db + AC_DEFINE(HAVE_DB3_DB_H, 1, [Define if you have the header file]) + ;; +esac + +AC_SUBST([WITH_DB_LIB]) #================= # Check for sqlite3 library. -- 2.7.4