diff options
author | Lionel Elie Mamane <lionel.mamane@gestman.lu> | 2011-08-17 18:02:58 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel.mamane@gestman.lu> | 2011-08-17 18:10:59 +0200 |
commit | d6ed363c0bc98525c4f1fe8bd5e90d5af457d0fd (patch) | |
tree | a7c17556b0272efdb60527361482cb2749d64919 | |
parent | 2674376ddff9370988fe1fcad0ec519d1e68e869 (diff) |
Overhaul BerkeleyDB detection logic
- use first/newest (not last/oldest) Berkeley DB found
- link against same version than header used
-rwxr-xr-x | configure.in | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/configure.in b/configure.in index 81cb9a8f2397..0b8e3759631f 100755 --- a/configure.in +++ b/configure.in @@ -4811,16 +4811,16 @@ if test -n "$with_system_db" -o -n "$with_system_libs" && \ for dbver in 5.1 5.0 5 4.8 4.7 4; do for dash in - ''; do AC_CHECK_HEADER([db$dash$dbver/db.h], - [ db_header="db$dash$dbver/db.h"; break ]) + [ db_header="db$dash$dbver/db.h"; break 2 ]) done done if test -z "$db_header"; then - AC_CHECK_HEADER([db/db.h], [db_header='db/db.h']) + AC_CHECK_HEADER([db/db.h], [db_header='db/db.h'; dbver='']) fi if test -z "$db_header"; then - AC_CHECK_HEADER(db.h, [ db_header='db.h' ]) + AC_CHECK_HEADER(db.h, [ db_header='db.h'; dbver='' ]) fi if test -z "$db_header"; then @@ -4836,21 +4836,13 @@ if test -n "$with_system_db" -o -n "$with_system_libs" && \ SYSTEM_DB_CFLAGS="-DSYSTEM_DB_HEADER='<$db_header>'" DB_LIB= - for dbver in 5.1 5.0 5 4.8 4.7 4 ''; do - for dash in - ''; do - AC_CHECK_LIB(db$dash$dbver, dbopen, - [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ]) - AC_CHECK_LIB(db$dash$dbver, __db185_open, - [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ]) - done - test -n "$DB_LIB" && break + for dash in - ''; do + AC_CHECK_LIB(db$dash$dbver, dbopen, + [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ]) + AC_CHECK_LIB(db$dash$dbver, __db185_open, + [ DB_LIB="db$dash$dbver"; DB_CPPLIB="db_cxx$dash$dbver"; break ]) done - if test -z "$DB_LIB"; then - AC_CHECK_LIB(db, dbopen, - [ DB_LIB="db"; DB_CPPLIB="db_cxx" ]) - fi - if test -z "$DB_LIB" ; then AC_MSG_ERROR([db library not found. Use the correct -L flag, or install the Berkeley db development package.]) |