INN commit: trunk (authprogs/ckpasswd.c configure.ac)
INN Commit
rra at isc.org
Sat Dec 14 20:09:56 UTC 2013
Date: Saturday, December 14, 2013 @ 12:09:55
Author: iulius
Revision: 9586
ckpasswd: check for both gdbm/ndbm.h and gdbm-ndbm.h headers
libgdbm-dev in Debian provides /usr/include/gdbm-ndbm.h whereas
gdbm-devel in Red Hat provides /usr/include/gdbm/ndbm.h; INN then
has to make sure to search for the right header file when DBM support
is found.
Define HAVE_GDBM_SLASH_NDBM_H and HAVE_GDBM_HYPHEN_NDBM_H instead
of HAVE_GDBM_NDBM_H to properly disambiguate the two headers that are
mapped to the same preprocessor name by Autoconf.
Thanks to Jesse Rehmer for the bug report.
Modified:
trunk/authprogs/ckpasswd.c
trunk/configure.ac
----------------------+
authprogs/ckpasswd.c | 6 ++++--
configure.ac | 18 ++++++++++++++++--
2 files changed, 20 insertions(+), 4 deletions(-)
Modified: authprogs/ckpasswd.c
===================================================================
--- authprogs/ckpasswd.c 2013-12-14 18:59:12 UTC (rev 9585)
+++ authprogs/ckpasswd.c 2013-12-14 20:09:55 UTC (rev 9586)
@@ -37,10 +37,12 @@
# include <db.h>
# elif HAVE_NDBM_H
# include <ndbm.h>
-# elif HAVE_GDBM_NDBM_H
-# include <gdbm-ndbm.h>
# elif HAVE_DB1_NDBM_H
# include <db1/ndbm.h>
+# elif HAVE_GDBM_SLASH_NDBM_H
+# include <gdbm/ndbm.h>
+# elif HAVE_GDBM_HYPHEN_NDBM_H
+# include <gdbm-ndbm.h>
# endif
# define OPT_DBM "d:"
#else
Modified: configure.ac
===================================================================
--- configure.ac 2013-12-14 18:59:12 UTC (rev 9585)
+++ configure.ac 2013-12-14 20:09:55 UTC (rev 9586)
@@ -387,8 +387,22 @@
sys/select.h sys/time.h unistd.h])
dnl Some Linux systems have db1/ndbm.h instead of ndbm.h. Others have
-dnl gdbm-ndbm.h.
-AC_CHECK_HEADERS([ndbm.h db1/ndbm.h gdbm-ndbm.h], [break])
+dnl gdbm/ndbm.h or gdbm-ndbm.h. Detecting the last two ones is not
+dnl straight-forward because Autoconf defines the same preprocessor name
+dnl and the same shell variable for them; we therefore have to make sure
+dnl the cache is not populated, and to define HAVE_GDBM_SLASH_NDBM_H and
+dnl HAVE_GDBM_HYPHEN_NDBM_H separately.
+AC_CHECK_HEADERS([ndbm.h db1/ndbm.h], [break])
+AS_UNSET([ac_cv_header_gdbm_ndbm_h])
+AC_CHECK_HEADER([gdbm/ndbm.h])
+AS_IF([test x"$ac_cv_header_gdbm_ndbm_h" != xno],
+ [AC_DEFINE([HAVE_GDBM_SLASH_NDBM_H], [1],
+ [Define if you have the <gdbm/ndbm.h> header file.])],
+ [AS_UNSET([ac_cv_header_gdbm_ndbm_h])
+ AC_CHECK_HEADER([gdbm-ndbm.h])
+ AS_IF([test x"$ac_cv_header_gdbm_ndbm_h" != xno],
+ [AC_DEFINE([HAVE_GDBM_HYPHEN_NDBM_H], [1],
+ [Define if you have the <gdbm-ndbm.h> header file.])])])
dnl Check for whether various symbols are declared.
AC_CHECK_DECLS([pread, pwrite, snprintf, setproctitle, strlcat,
More information about the inn-committers
mailing list