configure --with-external-db should fall back to external if unspecified.
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 after the check for an internal db fails fall back to the external db.h if available. This keeps the current behavior of defaulting to --without-external-db (no) if nothing is specified, but falls back to trying with the external one if there is no in tree internal db. Giving an explicit --with-external-db or --without-external-db doesn't change and produces an error if no external or no internal db is found.
This commit is contained in:
parent
64b6cbbb44
commit
9e64f8d5b7
26
configure.ac
26
configure.ac
|
@ -374,7 +374,7 @@ 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 )
|
||||
|
@ -393,11 +393,33 @@ yes )
|
|||
AC_MSG_ERROR([missing required header db.h])
|
||||
])
|
||||
;;
|
||||
* ) # Fall back to internal db if available
|
||||
no|maybe )
|
||||
# Try internal database first, then fall back to external
|
||||
# unless --without-external-db (no) was explicitly given.
|
||||
if [ test -x db/dist/configure ]; then
|
||||
AC_DEFINE(HAVE_DB_H, 1, [Define if you have the <db3/db.h> header file])
|
||||
else
|
||||
case "$with_external_db" in
|
||||
maybe)
|
||||
AC_CHECK_HEADERS([db.h],[
|
||||
AC_PREPROC_IFELSE([
|
||||
AC_LANG_SOURCE([
|
||||
#include <db.h>
|
||||
#if ((DB_VERSION_MAJOR < 4) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 5))
|
||||
#error Berkeley DB too old
|
||||
#endif
|
||||
])
|
||||
],[ WITH_DB_LIB=-ldb ],
|
||||
[ AC_MSG_ERROR([Berkeley DB version >= 4.5 required])
|
||||
])
|
||||
],[
|
||||
AC_MSG_ERROR([missing required header db.h])
|
||||
])
|
||||
;;
|
||||
no)
|
||||
AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue