dnl $OpenLDAP$
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
dnl
-dnl Copyright 1998-2013 The OpenLDAP Foundation.
+dnl Copyright 1998-2017 The OpenLDAP Foundation.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl Get major and minor version from <db.h>
AC_DEFUN([OL_BDB_HEADER_VERSION],
[AC_CACHE_CHECK([for Berkeley DB major version in db.h], [ol_cv_bdb_major],[
- AC_LANG_CONFTEST([
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([
#include <db.h>
#ifndef DB_VERSION_MAJOR
# define DB_VERSION_MAJOR 1
#endif
__db_version DB_VERSION_MAJOR
-])
- set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+])])
+ set X `eval "$ac_cpp -P conftest.$ac_ext" | $EGREP __db_version` none none
ol_cv_bdb_major=${3}
])
case $ol_cv_bdb_major in [[1-9]]*) : ;; *)
dnl Determine minor version
AC_CACHE_CHECK([for Berkeley DB minor version in db.h], [ol_cv_bdb_minor],[
- AC_LANG_CONFTEST([
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([
#include <db.h>
#ifndef DB_VERSION_MINOR
# define DB_VERSION_MINOR 0
#endif
__db_version DB_VERSION_MINOR
-])
- set X `eval "$ac_cpp conftest.$ac_ext" | $EGREP __db_version` none none
+])])
+ set X `eval "$ac_cpp -P conftest.$ac_ext" | $EGREP __db_version` none none
ol_cv_bdb_minor=${3}
])
case $ol_cv_bdb_minor in [[0-9]]*) : ;; *)
#ifndef DB_VERSION_MINOR
# define DB_VERSION_MINOR 0
#endif
+#ifndef DB_VERSION_PATCH
+# define DB_VERSION_PATCH 0
+#endif
-#define DB_VERSION_MM ((DB_VERSION_MAJOR<<8)|DB_VERSION_MINOR)
+#define DB_VERSION_FULL ((DB_VERSION_MAJOR<<16)|(DB_VERSION_MINOR<<8)|DB_VERSION_PATCH)
-/* require 4.4 or later */
-#if DB_VERSION_MM >= 0x0404
+/* require 4.4 or later, but less than 6.0.20 */
+#if DB_VERSION_FULL >= 0x040400 && DB_VERSION_FULL < 0x060014
__db_version_compat
+#endif
+#if DB_VERSION_FULL >= 0x060014
+#error "BerkeleyDB 6.0.20+ license is incompatible with LDAP"
#endif
], [ol_cv_bdb_compat=yes], [ol_cv_bdb_compat=no])])
])
]])
AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
-AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
+[AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
int main(argc, argv)
int argc;
{
OL_PTHREAD_TEST_FUNCTION
}
-]))
+])])
dnl --------------------------------------------------------------------
AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
if test "$ol_link_threads" = no ; then