]> granicus.if.org Git - apache/commitdiff
Due to some lunacy in ndbm.h on some platforms, we need to find the right
authorRoy T. Fielding <fielding@apache.org>
Tue, 21 Aug 2001 00:39:56 +0000 (00:39 +0000)
committerRoy T. Fielding <fielding@apache.org>
Tue, 21 Aug 2001 00:39:56 +0000 (00:39 +0000)
include directory for db.h if we include ndbm.h.

Submitted by: Justin Erenkrantz
Reviewed by: Roy Fielding

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90448 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/config.m4
modules/aaa/mod_auth_dbm.c

index 0a64b5ae4f1eab7b1ac433f07df9ba5931f5010d..e2b624aed778491f7181af11008c6c7a7bbb7697 100644 (file)
@@ -9,6 +9,20 @@ APACHE_MODULE(auth, user-based access control, , , yes)
 APACHE_MODULE(auth_anon, anonymous user access, , , most)
 APACHE_MODULE(auth_dbm, DBM-based access databases, , , most, [
   AC_SEARCH_LIBS(dbm_open,[c db1],,enable_auth_dbm=no)
+  dnl Glibc 2.2's ndbm.h includes <db.h> in ndbm.h.  So, we need to find
+  dnl where ndbm.h lives.  (2.2.4 looks like it includes <db1/db.h>.)
+  AC_TRY_COMPILE([#include "ndbm.h"], [dbm_open("/dev/null", 0, 0)],
+                 _good_db_path="yes", _good_db_path="no")
+  if test "$_good_db_path" = "no"; then
+    _old_cppflags=$CPPFLAGS
+    CPPFLAGS="$CPPFLAGS -I/usr/include/db1"
+    AC_TRY_COMPILE([#include "ndbm.h"], [dbm_open("/dev/null", 0, 0)],
+                 _good_db_path="yes", _good_db_path="no")
+    if test "$_good_db_path" = "no"; then
+      CPPFLAGS=$_old_cppflags
+      enable_auth_dbm=no
+    fi
+  fi
 ])
 
 APACHE_MODULE(auth_db, DB-based access databases, , , , [
index c904a2d36e96544c966282c7799eb0aed0efd037..f44b503bdbb45703a031f9195ab9dbc35aed5dae 100644 (file)
@@ -82,9 +82,6 @@
 #define dbm_open apr_dbm_open
 #define dbm_fetch apr_dbm_fetch
 #define dbm_close apr_dbm_close
-#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) \
-    && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
-#include <db1/ndbm.h>
 #else
 #include <ndbm.h>
 #endif