INN commit: trunk (7 files)
INN Commit
rra at isc.org
Sun Sep 21 18:02:15 UTC 2014
Date: Sunday, September 21, 2014 @ 11:02:14
Author: iulius
Revision: 9715
Do not build with Berkeley DB support if db.h is not found
Modified:
trunk/configure.ac
trunk/frontends/ovdb_init.c
trunk/frontends/ovdb_monitor.c
trunk/frontends/ovdb_server.c
trunk/frontends/ovdb_stat.c
trunk/storage/ovdb/ovdb-private.h
trunk/storage/ovdb/ovdb.c
-----------------------------+
configure.ac | 33 ++++++++++++++++++++++++++++-----
frontends/ovdb_init.c | 6 +++---
frontends/ovdb_monitor.c | 6 +++---
frontends/ovdb_server.c | 6 +++---
frontends/ovdb_stat.c | 6 +++---
storage/ovdb/ovdb-private.h | 4 ++--
storage/ovdb/ovdb.c | 6 +++---
7 files changed, 45 insertions(+), 22 deletions(-)
Modified: configure.ac
===================================================================
--- configure.ac 2014-09-21 12:55:56 UTC (rev 9714)
+++ configure.ac 2014-09-21 18:02:14 UTC (rev 9715)
@@ -343,12 +343,35 @@
[AC_MSG_ERROR([cannot find usable com_err header])])])])])
AC_SUBST([KRB5_AUTH])
+dnl If Berkeley DB is found, check the presence of its header.
+dnl Also, do not build with zlib support unless Berkeley DB is enabled.
+AS_IF([test x"$inn_use_BDB" = xtrue],
+ [inn_BDB_incroot=
+ inn_BDB_header_found=
+ AS_IF([test x"$inn_BDB_includedir" != x],
+ [inn_BDB_incroot="$inn_BDB_includedir"],
+ [AS_IF([test x"$inn_BDB_root" != x],
+ [inn_BDB_incroot="${inn_BDB_root}/include"])])
+ AS_IF([test x"$inn_BDB_incroot" = x],
+ [AC_CHECK_HEADERS([db.h],
+ [inn_BDB_header_found=yes],
+ [inn_BDB_header_found=no])],
+ [AS_IF([test -f "${inn_BDB_incroot}/db.h"],
+ [inn_BDB_header_found=yes
+ AC_DEFINE([HAVE_DB_H], [1],
+ [Define if you have the <db.h> header file.])],
+ [inn_BDB_header_found=no])])
+ AS_IF([test x"${inn_BDB_header_found}" = xyes],
+ [INN_LIB_BDB_NDBM
+ INN_LIB_ZLIB_OPTIONAL],
+ [AS_IF([test x"$with_bdb" = x],
+ [BDB_CPPFLAGS=
+ BDB_LDFLAGS=
+ BDB_LIBS=],
+ [AC_MSG_ERROR([cannot find usable Berkeley DB header])])])])
+
dnl The dbm libraries are a special case. If we're building with Berkeley DB,
-dnl just use the ndbm support provided by it. Also, do not build with zlib
-dnl support unless Berkeley DB is enabled.
-AS_IF([test x"$inn_use_BDB" = xtrue],
- [INN_LIB_BDB_NDBM
- INN_LIB_ZLIB_OPTIONAL])
+dnl just use the ndbm support provided by it.
AS_IF([test x"$inn_cv_lib_bdb_ndbm" != xyes],
[INN_SEARCH_AUX_LIBS([dbm_open], [ndbm dbm gdbm "gdbm_compat -lgdbm"],
[DBM_LIBS],
Modified: frontends/ovdb_init.c
===================================================================
--- frontends/ovdb_init.c 2014-09-21 12:55:56 UTC (rev 9714)
+++ frontends/ovdb_init.c 2014-09-21 18:02:14 UTC (rev 9715)
@@ -17,14 +17,14 @@
#include "../storage/ovdb/ovdb.h"
#include "../storage/ovdb/ovdb-private.h"
-#ifndef HAVE_BDB
+#ifndef HAVE_DB_H
int main(int argc UNUSED, char **argv UNUSED)
{
die("Berkeley DB support not compiled");
}
-#else /* HAVE_BDB */
+#else /* HAVE_DB_H */
static int open_db(DB **db, const char *name, int type)
{
@@ -440,5 +440,5 @@
exit(0);
}
-#endif /* HAVE_BDB */
+#endif /* HAVE_DB_H */
Modified: frontends/ovdb_monitor.c
===================================================================
--- frontends/ovdb_monitor.c 2014-09-21 12:55:56 UTC (rev 9714)
+++ frontends/ovdb_monitor.c 2014-09-21 18:02:14 UTC (rev 9715)
@@ -22,14 +22,14 @@
#include "../storage/ovdb/ovdb.h"
#include "../storage/ovdb/ovdb-private.h"
-#ifndef HAVE_BDB
+#ifndef HAVE_DB_H
int main(int argc UNUSED, char **argv UNUSED)
{
exit(0);
}
-#else /* HAVE_BDB */
+#else /* HAVE_DB_H */
static int signalled = 0;
static void sigfunc(int sig UNUSED)
@@ -275,5 +275,5 @@
return 1;
}
-#endif /* HAVE_BDB */
+#endif /* HAVE_DB_H */
Modified: frontends/ovdb_server.c
===================================================================
--- frontends/ovdb_server.c 2014-09-21 12:55:56 UTC (rev 9714)
+++ frontends/ovdb_server.c 2014-09-21 18:02:14 UTC (rev 9715)
@@ -37,7 +37,7 @@
#include "../storage/ovdb/ovdb.h"
#include "../storage/ovdb/ovdb-private.h"
-#ifndef HAVE_BDB
+#ifndef HAVE_DB_H
int
main(int argc UNUSED, char **argv UNUSED)
@@ -45,7 +45,7 @@
die("Berkeley DB support not compiled");
}
-#else /* HAVE_BDB */
+#else /* HAVE_DB_H */
#define SELECT_TIMEOUT 15
@@ -747,4 +747,4 @@
}
-#endif /* HAVE_BDB */
+#endif /* HAVE_DB_H */
Modified: frontends/ovdb_stat.c
===================================================================
--- frontends/ovdb_stat.c 2014-09-21 12:55:56 UTC (rev 9714)
+++ frontends/ovdb_stat.c 2014-09-21 18:02:14 UTC (rev 9715)
@@ -21,14 +21,14 @@
#include "../storage/ovdb/ovdb-private.h"
-#ifndef HAVE_BDB
+#ifndef HAVE_DB_H
int main(int argc UNUSED, char **argv UNUSED)
{
die("Berkeley DB support not compiled");
}
-#else /* HAVE_BDB */
+#else /* HAVE_DB_H */
static int signalled = 0;
static void sigfunc(int signum UNUSED)
@@ -897,5 +897,5 @@
return 0;
}
-#endif /* HAVE_BDB */
+#endif /* HAVE_DB_H */
Modified: storage/ovdb/ovdb-private.h
===================================================================
--- storage/ovdb/ovdb-private.h 2014-09-21 12:55:56 UTC (rev 9714)
+++ storage/ovdb/ovdb-private.h 2014-09-21 18:02:14 UTC (rev 9715)
@@ -1,4 +1,4 @@
-#ifdef HAVE_BDB
+#ifdef HAVE_DB_H
#include <db.h>
@@ -190,4 +190,4 @@
#define TRYAGAIN DB_LOCK_DEADLOCK
-#endif /* HAVE_BDB */
+#endif /* HAVE_DB_H */
Modified: storage/ovdb/ovdb.c
===================================================================
--- storage/ovdb/ovdb.c 2014-09-21 12:55:56 UTC (rev 9714)
+++ storage/ovdb/ovdb.c 2014-09-21 18:02:14 UTC (rev 9715)
@@ -111,7 +111,7 @@
# include <sys/un.h>
#endif
-#ifndef HAVE_BDB
+#ifndef HAVE_DB_H
/* Provide stub functions if we don't have db */
@@ -155,7 +155,7 @@
void ovdb_close(void) { }
-#else /* HAVE_BDB */
+#else /* HAVE_DB_H */
#define EXPIREGROUP_TXN_SIZE 100
#define DELETE_TXN_SIZE 500
@@ -3061,4 +3061,4 @@
ovdb_releaselock();
}
-#endif /* HAVE_BDB */
+#endif /* HAVE_DB_H */
More information about the inn-committers
mailing list