source: box/trunk/infrastructure/m4/ax_check_bdb_v1.m4 @ 245

Revision 245, 1.5 KB checked in by martin, 6 years ago (diff)

Add more libdb version checks when configuring for Berkeley DB

  • Property svn:eol-style set to native
Line 
1dnl @synopsis AX_CHECK_BDB_V1
2dnl
3dnl This macro find an installation of Berkeley DB version 1, or compatible.
4dnl It will define the following macros on success:
5dnl
6dnl HAVE_DB     - If Berkeley DB version 1 or compatible is available
7dnl DB_HEADER   - The relative path and filename of the header file
8dnl LIBS        - Updated for correct library
9dnl
10dnl @category C
11dnl @author Martin Ebourne
12dnl @version 2005/07/12
13dnl @license AllPermissive
14
15AC_DEFUN([AX_CHECK_BDB_V1], [
16  ac_have_bdb=no
17  AC_CHECK_HEADERS([db_185.h db4/db_185.h db3/db_185.h db1/db.h db.h],
18                   [ac_bdb_header=$ac_header; break], [ac_bdb_header=""])
19  if test "x$ac_bdb_header" != x; then
20    AC_SEARCH_LIBS([__db185_open],
21                   [db db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db4 db-3 db3],
22                   [ac_have_bdb=yes],
23                   [AC_SEARCH_LIBS([dbopen], [db-1 db1 db], [ac_have_bdb=yes])])
24  fi
25  if test "x$ac_have_bdb" = "xyes"; then
26    AC_MSG_CHECKING([whether found db libraries work])
27    AC_RUN_IFELSE([AC_LANG_PROGRAM([[
28        $ac_includes_default
29        #include "$ac_bdb_header"]], [[
30        DB *dbp = dbopen(0, 0, 0, DB_HASH, 0);
31        if(dbp) dbp->close(dbp);
32        return 0;
33      ]])], [
34      AC_MSG_RESULT([yes])
35      AC_DEFINE([HAVE_DB], 1, [Define to 1 if Berkeley DB is available])
36      AC_DEFINE_UNQUOTED([DB_HEADER], ["$ac_bdb_header"],
37                          [Define to the location of the Berkeley DB 1.85 header])
38      ], [
39      AC_MSG_RESULT([no])
40      ac_have_bdb=no
41      ])
42  fi
43  ])dnl
Note: See TracBrowser for help on using the repository browser.