* configure.in: check if libc already includes dbm functionality
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 2 May 2006 03:12:45 +0000 (03:12 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 2 May 2006 03:12:45 +0000 (03:12 +0000)
(as in FreeBSD 6), then don't bother to check specific libraries
such as libdbm, gdbm, etc.

ChangeLog
NEWS
configure.in

index 3b4d69665c74f8ceabdfd33c23e22d1a596fef08..3af0152c4231858ed8208484ad7b5ff4fa5e4dd4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-01  Erez Zadok  <ezk@cs.sunysb.edu>
+
+       * configure.in: check if libc already includes dbm functionality
+       (as in FreeBSD 6), then don't bother to check specific libraries
+       such as libdbm, gdbm, etc.
+
 2006-04-21  Erez Zadok  <ezk@cs.sunysb.edu>
 
        * configure.in: detect G/DBM support via gdbm_compat library
diff --git a/NEWS b/NEWS
index fba2cfdcd37e2dc91055aae29c9edf3320aab4f7..48b1db18ef471615151f9269780fcfd80f6bde57 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,7 @@ better tune Amd's responsiveness under heavy scheduler loads.
        * don't turn off attribute cache for regular NFS mounts (improves
          performance)
        * detect G/DBM support via gdbm_compat library (Debian)
+       * detect NDBM support in libc (FreeBSD 6)
 
 *** Notes specific to am-utils version 6.2a1
 
index 66db7c7254a59891f3164928041d3bb3fc01f449..e63be2e2af53c7d0d133def62936425869428ad6 100644 (file)
@@ -55,7 +55,7 @@ AH_BOTTOM([
 dnl
 dnl AC_CONFIG_AUX_DIR(m4)
 AC_PREREQ(2.52)
-AC_REVISION($Revision: 1.125 $)
+AC_REVISION($Revision: 1.126 $)
 AC_COPYRIGHT([Copyright (c) 1997-2006 Erez Zadok])
 dnl find out system type
 AC_MSG_NOTICE(*** SYSTEM TYPES ***)
@@ -659,6 +659,10 @@ dnl libgdbm for dbm_pagfno, so check for this.
     AC_CHECK_LIB(ndbm, dbm_pagfno, ac_cv_header_new_dbm="ndbm.h"; ac_cv_lib_new_dbm="ndbm",
       AC_CHECK_LIB(gdbm, dbm_pagfno, ac_cv_header_new_dbm="ndbm.h"; ac_cv_lib_new_dbm="ndbm -lgdbm")))
 fi
+dnl check if dbm_open is part of libc
+if test "$ac_cv_lib_new_dbm" = "" -a "$ac_cv_header_ndbm_h" = "yes"; then
+  AC_CHECK_LIB(c, dbm_open, ac_cv_header_new_dbm="ndbm.h"; ac_cv_lib_new_dbm="c")
+fi
 if test "$ac_cv_lib_new_dbm" = "" -a "$ac_cv_header_db1_ndbm_h" = "yes"; then
   AC_CHECK_LIB(db1, dbm_open, ac_cv_header_new_dbm="db1/ndbm.h"; ac_cv_lib_new_dbm="db1")
 fi
@@ -678,7 +682,10 @@ else
 fi
 if test "$ac_cv_header_new_dbm" != "" -a "$ac_cv_lib_new_dbm" != ""; then
   AC_DEFINE_UNQUOTED(NEW_DBM_H, "$ac_cv_header_new_dbm")
-  LIBS="-l$ac_cv_lib_new_dbm $LIBS"
+dnl don't bother adding "-lc" when it's the default anyway
+  if test "$ac_cv_lib_new_dbm" != "c" ; then
+    LIBS="-l$ac_cv_lib_new_dbm $LIBS"
+  fi
 fi
 fi
 dnl ======================================================================