INN commit: trunk/m4 (berkeleydb.m4)
INN Commit
Russ_Allbery at isc.org
Mon May 5 21:27:28 UTC 2008
Date: Monday, May 5, 2008 @ 14:27:28
Author: iulius
Revision: 7819
Check for Berkeley DB in regular system locations.
Modified:
trunk/m4/berkeleydb.m4
---------------+
berkeleydb.m4 | 53 +++++++++++------------------------------------------
1 file changed, 11 insertions(+), 42 deletions(-)
Modified: berkeleydb.m4
===================================================================
--- berkeleydb.m4 2008-05-05 16:20:04 UTC (rev 7818)
+++ berkeleydb.m4 2008-05-05 21:27:28 UTC (rev 7819)
@@ -1,11 +1,10 @@
-dnl berkeleydb.m4 -- Find the path to the BerkeleyDB libraries.
+dnl berkeleydb.m4 -- Find the path to the Berkeley DB libraries.
dnl $Id$
dnl
dnl This file provides INN_LIB_BERKELEYDB, which defines the --with-berkeleydb
-dnl command-line option and probes for the location of BerkeleyDB if that
-dnl option is used without an optional path. It looks for BerkeleyDB in a
-dnl variety of standard locations and then exports DB_LDFLAGS, DB_CFLAGS, and
-dnl DB_LIBS.
+dnl command-line option and probes for the location of Berkeley DB if that
+dnl option is used without an optional path. It looks for Berkeley DB in $prefix,
+dnl /usr/local and /usr. It then exports DB_LDFLAGS, DB_CFLAGS, and DB_LIBS.
AC_DEFUN([INN_LIB_BERKELEYDB],
[DB_CPPFLAGS=
@@ -13,7 +12,7 @@
DB_LIBS=
AC_ARG_WITH([berkeleydb],
[AC_HELP_STRING([--with-berkeleydb@<:@=PATH@:>@],
- [Enable BerkeleyDB (for ovdb overview method)])],
+ [Enable Berkeley DB (for ovdb overview method)])],
DB_DIR=$with_berkeleydb,
DB_DIR=no)
AC_MSG_CHECKING([if Berkeley DB is desired])
@@ -21,55 +20,25 @@
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
- AC_MSG_CHECKING([for Berkeley DB location])
- dnl First check the default installation locations.
+ AC_MSG_CHECKING([for Berkeley DB location])
if test x"$DB_DIR" = xyes ; then
- for version in BerkeleyDB.4.6 BerkeleyDB.4.5 \
- BerkeleyDB.4.4 BerkeleyDB.4.3 BerkeleyDB.4.2 \
- BerkeleyDB.4.1 BerkeleyDB.4.0 \
- BerkeleyDB.3.3 BerkeleyDB.3.2 BerkeleyDB.3.1 \
- BerkeleyDB.3.0 BerkeleyDB ; do
- if test -d "/usr/local/$version" ; then
- DB_DIR=/usr/local/$version
+ for dir in $prefix /usr/local /usr ; do
+ if test -f "$dir/include/db.h" ; then
+ DB_DIR=$dir
break
fi
done
fi
-
- dnl If not found there, check the default locations for some BSD ports and
- dnl Linux distributions. They each do things in different ways.
if test x"$DB_DIR" = xyes ; then
- for version in db46 db45 db44 db43 db42 db41 db4 db3 db2 ; do
- if test -d "/usr/local/include/$version" ; then
- DB_CPPFLAGS="-I/usr/local/include/$version"
- DB_LDFLAGS="-L/usr/local/lib"
- DB_LIBS="-l$version"
- AC_MSG_RESULT([FreeBSD locations])
- break
- fi
- done
- if test x"$DB_LIBS" = x ; then
- for version in db44 db43 db42 db41 db4 db3 db2 ; do
- if test -d "/usr/include/$version" ; then
- DB_CPPFLAGS="-I/usr/include/$version"
- DB_LIBS="-l$version"
- AC_MSG_RESULT([Red Hat locations])
- break
- fi
- done
- if test x"$DB_LIBS" = x ; then
- DB_LIBS=-ldb
- AC_MSG_RESULT([trying -ldb])
- fi
- fi
+ AC_MSG_ERROR([cannot find Berkeley DB])
else
DB_CPPFLAGS="-I$DB_DIR/include"
DB_LDFLAGS="-L$DB_DIR/lib"
DB_LIBS="-ldb"
AC_MSG_RESULT([$DB_DIR])
fi
- AC_DEFINE([USE_BERKELEY_DB], 1, [Define if BerkeleyDB is available.])
+ AC_DEFINE([USE_BERKELEY_DB], 1, [Define if Berkeley DB is available.])
fi
AC_SUBST([DB_CPPFLAGS])
AC_SUBST([DB_LDFLAGS])
More information about the inn-committers
mailing list