INN commit: trunk (13 files)
INN Commit
rra at isc.org
Tue Jun 5 14:54:06 UTC 2018
Date: Tuesday, June 5, 2018 @ 07:54:06
Author: iulius
Revision: 10292
Update to latest rra-c-util upstream version
The Autoconf m4 macros now check that the library's key header
can be found as well as the library. It removes the need of
several checks added in configure.ac to achieve that.
Modified:
trunk/configure.ac
trunk/innfeed/imap_connection.c
trunk/m4/bdb.m4
trunk/m4/lib-helper.m4
trunk/m4/openssl.m4
trunk/m4/sasl.m4
trunk/m4/zlib.m4
trunk/nnrpd/nnrpd.h
trunk/nnrpd/tls.h
trunk/storage/ovdb/ovdb-private.h
trunk/storage/ovdb/ovdb.c
trunk/tests/tap/libtap.sh
trunk/tests/tap/macros.h
-----------------------------+
configure.ac | 100 +-----------------------------------------
innfeed/imap_connection.c | 3 -
m4/bdb.m4 | 13 +++--
m4/lib-helper.m4 | 9 +++
m4/openssl.m4 | 45 +++++++++++-------
m4/sasl.m4 | 13 +++--
m4/zlib.m4 | 13 +++--
nnrpd/nnrpd.h | 6 --
nnrpd/tls.h | 3 -
storage/ovdb/ovdb-private.h | 6 +-
storage/ovdb/ovdb.c | 6 --
tests/tap/libtap.sh | 4 -
tests/tap/macros.h | 2
13 files changed, 75 insertions(+), 148 deletions(-)
Modified: configure.ac
===================================================================
--- configure.ac 2018-06-05 14:18:37 UTC (rev 10291)
+++ configure.ac 2018-06-05 14:54:06 UTC (rev 10292)
@@ -417,31 +417,9 @@
AS_IF([test x"$inn_use_KRB5" = xtrue], [KRB5_AUTH=auth_krb5])
AC_SUBST([KRB5_AUTH])
-dnl If Berkeley DB is found, check the presence of its header and whether the
-dnl Berkeley DB library has ndbm support.
-AS_IF([test x"$inn_use_BDB" = xtrue],
- [inn_BDB_incroot=
- inn_BDB_header_found=
- AS_IF([test x"$inn_BDB_includedir" != x],
- [inn_BDB_incroot="$inn_BDB_includedir"],
- [AS_IF([test x"$inn_BDB_root" != x],
- [inn_BDB_incroot="${inn_BDB_root}/include"])])
- AS_IF([test x"$inn_BDB_incroot" = x],
- [AC_CHECK_HEADERS([db.h],
- [inn_BDB_header_found=yes],
- [inn_BDB_header_found=no])],
- [AS_IF([test -f "${inn_BDB_incroot}/db.h"],
- [inn_BDB_header_found=yes
- AC_DEFINE([HAVE_DB_H], [1],
- [Define if you have the <db.h> header file.])],
- [inn_BDB_header_found=no])])
- AS_IF([test x"${inn_BDB_header_found}" = xyes],
- [INN_LIB_BDB_NDBM],
- [AS_IF([test x"$with_bdb" = x],
- [BDB_CPPFLAGS=
- BDB_LDFLAGS=
- BDB_LIBS=],
- [AC_MSG_ERROR([cannot find usable Berkeley DB header])])])])
+dnl If Berkeley DB is found, check whether the Berkeley DB library
+dnl has ndbm support.
+AS_IF([test x"$inn_use_BDB" = xtrue], [INN_LIB_BDB_NDBM])
dnl The dbm libraries are a special case. If we're building with Berkeley DB,
dnl just use the ndbm support provided by it.
@@ -456,78 +434,6 @@
AC_SUBST([DBM_LIBS])])
AC_SUBST([DBM_CPPFLAGS])
-dnl If zlib support is found, check the presence of its header.
-AS_IF([test x"$inn_use_ZLIB" = xtrue],
- [inn_ZLIB_incroot=
- inn_ZLIB_header_found=
- AS_IF([test x"$inn_ZLIB_includedir" != x],
- [inn_ZLIB_incroot="$inn_ZLIB_includedir"],
- [AS_IF([test x"$inn_ZLIB_root" != x],
- [inn_ZLIB_incroot="${inn_ZLIB_root}/include"])])
- AS_IF([test x"$inn_ZLIB_incroot" = x],
- [AC_CHECK_HEADERS([zlib.h],
- [inn_ZLIB_header_found=yes],
- [inn_ZLIB_header_found=no])],
- [AS_IF([test -f "${inn_ZLIB_incroot}/zlib.h"],
- [inn_ZLIB_header_found=yes
- AC_DEFINE([HAVE_ZLIB_H], [1],
- [Define if you have the <zlib.h> header file.])],
- [inn_ZLIB_header_found=no])])
- AS_IF([test x"${inn_ZLIB_header_found}" = xyes], [],
- [AS_IF([test x"$with_zlib" = x],
- [ZLIB_CPPFLAGS=
- ZLIB_LDFLAGS=
- ZLIB_LIBS=],
- [AC_MSG_ERROR([cannot find usable zlib header])])])])
-
-dnl If OpenSSL support is found, check the presence of its header.
-AS_IF([test x"$inn_use_OPENSSL" = xtrue],
- [inn_OPENSSL_incroot=
- inn_OPENSSL_header_found=
- AS_IF([test x"$inn_OPENSSL_includedir" != x],
- [inn_OPENSSL_incroot="$inn_OPENSSL_includedir"],
- [AS_IF([test x"$inn_OPENSSL_root" != x],
- [inn_OPENSSL_incroot="${inn_OPENSSL_root}/include"])])
- AS_IF([test x"$inn_OPENSSL_incroot" = x],
- [AC_CHECK_HEADERS([openssl/ssl.h],
- [inn_OPENSSL_header_found=yes],
- [inn_OPENSSL_header_found=no])],
- [AS_IF([test -f "${inn_OPENSSL_incroot}/openssl/ssl.h"],
- [inn_OPENSSL_header_found=yes
- AC_DEFINE([HAVE_OPENSSL_SSL_H], [1],
- [Define if you have the <openssl/ssl.h> header file.])],
- [inn_OPENSSL_header_found=no])])
- AS_IF([test x"${inn_OPENSSL_header_found}" = xyes], [],
- [AS_IF([test x"$with_openssl" = x],
- [OPENSSL_CPPFLAGS=
- OPENSSL_LDFLAGS=
- OPENSSL_LIBS=],
- [AC_MSG_ERROR([cannot find usable OpenSSL header])])])])
-
-dnl If SASL support is found, check the presence of its header.
-AS_IF([test x"$inn_use_SASL" = xtrue],
- [inn_SASL_incroot=
- inn_SASL_header_found=
- AS_IF([test x"$inn_SASL_includedir" != x],
- [inn_SASL_incroot="$inn_SASL_includedir"],
- [AS_IF([test x"$inn_SASL_root" != x],
- [inn_SASL_incroot="${inn_SASL_root}/include"])])
- AS_IF([test x"$inn_SASL_incroot" = x],
- [AC_CHECK_HEADERS([sasl/sasl.h],
- [inn_SASL_header_found=yes],
- [inn_SASL_header_found=no])],
- [AS_IF([test -f "${inn_SASL_incroot}/sasl/sasl.h"],
- [inn_SASL_header_found=yes
- AC_DEFINE([HAVE_SASL_SASL_H], [1],
- [Define if you have the <sasl/sasl.h> header file.])],
- [inn_SASL_header_found=no])])
- AS_IF([test x"${inn_SASL_header_found}" = xyes], [],
- [AS_IF([test x"$with_sasl" = x],
- [SASL_CPPFLAGS=
- SASL_LDFLAGS=
- SASL_LIBS=],
- [AC_MSG_ERROR([cannot find usable Cyrus SASL header])])])])
-
dnl If configuring with large file support, determine the right flags to
dnl use based on the platform.
if test x"$inn_enable_largefiles" = xyes ; then
Modified: innfeed/imap_connection.c
===================================================================
--- innfeed/imap_connection.c 2018-06-05 14:18:37 UTC (rev 10291)
+++ innfeed/imap_connection.c 2018-06-05 14:54:06 UTC (rev 10292)
@@ -45,9 +45,6 @@
#include "article.h"
#include "configfile.h"
-#ifndef HAVE_SASL_SASL_H
-# undef HAVE_SASL
-#endif
#ifdef HAVE_SASL
# include <sasl/sasl.h>
# include <sasl/saslplug.h>
Modified: m4/bdb.m4
===================================================================
--- m4/bdb.m4 2018-06-05 14:18:37 UTC (rev 10291)
+++ m4/bdb.m4 2018-06-05 14:54:06 UTC (rev 10292)
@@ -30,6 +30,7 @@
dnl package, available at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
dnl
dnl Written by Russ Allbery <eagle at eyrie.org>
+dnl Copyright 2018 Russ Allbery <eagle at eyrie.org>
dnl Copyright 2013
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
@@ -53,10 +54,13 @@
AC_DEFUN([_INN_LIB_BDB_INTERNAL],
[INN_LIB_HELPER_PATHS([BDB])
INN_LIB_BDB_SWITCH
- AC_CHECK_LIB([db], [db_create],
- [BDB_LIBS="-ldb"],
+ AC_CHECK_HEADER([db.h],
+ [AC_CHECK_LIB([db], [db_create],
+ [BDB_LIBS="-ldb"],
+ [AS_IF([test x"$1" = xtrue],
+ [AC_MSG_ERROR([cannot find usable Berkeley DB library])])])],
[AS_IF([test x"$1" = xtrue],
- [AC_MSG_ERROR([cannot find usable Berkeley DB library])])])
+ [AC_MSG_ERROR([cannot find usable Berkeley DB header])])])
INN_LIB_BDB_RESTORE])
dnl The main macro for packages with mandatory Berkeley DB support.
@@ -75,7 +79,8 @@
[AS_IF([test x"$inn_use_BDB" = xtrue],
[_INN_LIB_BDB_INTERNAL([true])],
[_INN_LIB_BDB_INTERNAL([false])])])
- AS_IF([test x"$BDB_LIBS" != x],
+ AS_IF([test x"$BDB_LIBS" = x],
+ [INN_LIB_HELPER_VAR_CLEAR([BDB])],
[inn_use_BDB=true
AC_DEFINE([HAVE_BDB], 1, [Define if libdb is available.])])])
Modified: m4/lib-helper.m4
===================================================================
--- m4/lib-helper.m4 2018-06-05 14:18:37 UTC (rev 10291)
+++ m4/lib-helper.m4 2018-06-05 14:54:06 UTC (rev 10292)
@@ -13,6 +13,7 @@
dnl package, available at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
dnl
dnl Written by Russ Allbery <eagle at eyrie.org>
+dnl Copyright 2018 Russ Allbery <eagle at eyrie.org>
dnl Copyright 2011, 2013
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
@@ -91,6 +92,14 @@
AC_SUBST([$1][_LDFLAGS])
AC_SUBST([$1][_LIBS])])
+dnl Unset all of the variables used by a library probe. Used with the
+dnl _OPTIONAL versions of header probes when a header or library wasn't found
+dnl and therefore the library isn't usable.
+AC_DEFUN([INN_LIB_HELPER_VAR_CLEAR],
+[$1[]_CPPFLAGS=
+ $1[]_LDFLAGS=
+ $1[]_LIBS=])
+
dnl Handles --with options for a non-optional library. First argument is the
dnl base for the switch names. Second argument is the short description.
dnl Third argument is the variable prefix. The variables set are used by
Modified: m4/openssl.m4
===================================================================
--- m4/openssl.m4 2018-06-05 14:18:37 UTC (rev 10291)
+++ m4/openssl.m4 2018-06-05 14:54:06 UTC (rev 10292)
@@ -28,7 +28,7 @@
dnl package, available at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
dnl
dnl Written by Russ Allbery <eagle at eyrie.org>
-dnl Copyright 2016 Russ Allbery <eagle at eyrie.org>
+dnl Copyright 2016, 2018 Russ Allbery <eagle at eyrie.org>
dnl Copyright 2010, 2013
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
@@ -49,20 +49,11 @@
AC_DEFUN([INN_LIB_OPENSSL_RESTORE], [INN_LIB_HELPER_RESTORE([OPENSSL])])
AC_DEFUN([INN_LIB_CRYPTO_RESTORE], [INN_LIB_HELPER_RESTORE([CRYPTO])])
-dnl Checks if the OpenSSL and crypto libraries are present. The single
-dnl argument, if "true", says to fail if the OpenSSL SSL library could not be
-dnl found.
-AC_DEFUN([_INN_LIB_OPENSSL_INTERNAL],
-[AC_REQUIRE([INN_ENABLE_REDUCED_DEPENDS])
- INN_LIB_HELPER_PATHS([OPENSSL])
- CRYPTO_CPPFLAGS="$OPENSSL_CPPFLAGS"
- CRYPTO_LDFLAGS="$OPENSSL_LDFLAGS"
- CRYPTO_LIBS=
- AC_SUBST([CRYPTO_CPPFLAGS])
- AC_SUBST([CRYPTO_LDFLAGS])
- AC_SUBST([CRYPTO_LIBS])
- INN_LIB_OPENSSL_SWITCH
- inn_openssl_extra=
+dnl Check for the OpenSSL and crypto libraries and assemble OPENSSL_LIBS and
+dnl CRYPTO_LIBS. Helper function for _INN_LIB_OPENSSL_INTERNAL. Must be
+dnl called with INN_LIB_OPENSSL_SWITCH enabled.
+AC_DEFUN([_INN_LIB_OPENSSL_INTERNAL_LIBS],
+[inn_openssl_extra=
LIBS=
AS_IF([test x"$inn_reduced_depends" != xtrue],
[AC_SEARCH_LIBS([dlopen], [dl])])
@@ -81,7 +72,25 @@
[OPENSSL_LIBS="-lssl $CRYPTO_LIBS"],
[AS_IF([test x"$1" = xtrue],
[AC_MSG_ERROR([cannot find usable OpenSSL library])])],
- [$CRYPTO_LIBS])])
+ [$CRYPTO_LIBS])])])
+
+dnl Checks if the OpenSSL header and OpenSSL and crypto libraries are present.
+dnl The single argument, if "true", says to fail if the OpenSSL SSL library
+dnl could not be found.
+AC_DEFUN([_INN_LIB_OPENSSL_INTERNAL],
+[AC_REQUIRE([INN_ENABLE_REDUCED_DEPENDS])
+ INN_LIB_HELPER_PATHS([OPENSSL])
+ CRYPTO_CPPFLAGS="$OPENSSL_CPPFLAGS"
+ CRYPTO_LDFLAGS="$OPENSSL_LDFLAGS"
+ CRYPTO_LIBS=
+ AC_SUBST([CRYPTO_CPPFLAGS])
+ AC_SUBST([CRYPTO_LDFLAGS])
+ AC_SUBST([CRYPTO_LIBS])
+ INN_LIB_OPENSSL_SWITCH
+ AC_CHECK_HEADER([openssl/ssl.h],
+ [_INN_LIB_OPENSSL_INTERNAL_LIBS([$1])],
+ [AS_IF([test x"$1" = xtrue],
+ [AC_MSG_ERROR([cannot find usable OpenSSL header])])])
INN_LIB_OPENSSL_RESTORE])
dnl The main macro for packages with mandatory OpenSSL support.
@@ -100,6 +109,8 @@
[AS_IF([test x"$inn_use_OPENSSL" = xtrue],
[_INN_LIB_OPENSSL_INTERNAL([true])],
[_INN_LIB_OPENSSL_INTERNAL([false])])])
- AS_IF([test x"$OPENSSL_LIBS" != x],
+ AS_IF([test x"$OPENSSL_LIBS" = x],
+ [INN_LIB_HELPER_VAR_CLEAR([OPENSSL])
+ INN_LIB_HELPER_VAR_CLEAR([CRYPTO])],
[inn_use_OPENSSL=true
AC_DEFINE([HAVE_OPENSSL], 1, [Define if libssl is available.])])])
Modified: m4/sasl.m4
===================================================================
--- m4/sasl.m4 2018-06-05 14:18:37 UTC (rev 10291)
+++ m4/sasl.m4 2018-06-05 14:54:06 UTC (rev 10292)
@@ -26,6 +26,7 @@
dnl package, available at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
dnl
dnl Written by Russ Allbery <eagle at eyrie.org>
+dnl Copyright 2018 Russ Allbery <eagle at eyrie.org>
dnl Copyright 2013
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
@@ -49,10 +50,13 @@
AC_DEFUN([_INN_LIB_SASL_INTERNAL],
[INN_LIB_HELPER_PATHS([SASL])
INN_LIB_SASL_SWITCH
- AC_CHECK_LIB([sasl2], [sasl_getprop],
- [SASL_LIBS="-lsasl2"],
+ AC_CHECK_HEADER([sasl/sasl.h],
+ [AC_CHECK_LIB([sasl2], [sasl_getprop],
+ [SASL_LIBS="-lsasl2"],
+ [AS_IF([test x"$1" = xtrue],
+ [AC_MSG_ERROR([cannot find usable Cyrus SASL library])])])],
[AS_IF([test x"$1" = xtrue],
- [AC_MSG_ERROR([cannot find usable Cyrus SASL library])])])
+ [AC_MSG_ERROR([cannot find usable Cyrus SASL header])])])
INN_LIB_SASL_RESTORE])
dnl The main macro for packages with mandatory Cyrus SASL support.
@@ -71,6 +75,7 @@
[AS_IF([test x"$inn_use_SASL" = xtrue],
[_INN_LIB_SASL_INTERNAL([true])],
[_INN_LIB_SASL_INTERNAL([false])])])
- AS_IF([test x"$SASL_LIBS" != x],
+ AS_IF([test x"$SASL_LIBS" = x],
+ [INN_LIB_HELPER_VAR_CLEAR([SASL])],
[inn_use_SASL=true
AC_DEFINE([HAVE_SASL], 1, [Define if libsasl2 is available.])])])
Modified: m4/zlib.m4
===================================================================
--- m4/zlib.m4 2018-06-05 14:18:37 UTC (rev 10291)
+++ m4/zlib.m4 2018-06-05 14:54:06 UTC (rev 10292)
@@ -24,6 +24,7 @@
dnl package, available at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
dnl
dnl Written by Russ Allbery <eagle at eyrie.org>
+dnl Copyright 2018 Russ Allbery <eagle at eyrie.org>
dnl Copyright 2013
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
@@ -47,10 +48,13 @@
AC_DEFUN([_INN_LIB_ZLIB_INTERNAL],
[INN_LIB_HELPER_PATHS([ZLIB])
INN_LIB_ZLIB_SWITCH
- AC_CHECK_LIB([z], [compress],
- [ZLIB_LIBS="-lz"],
+ AC_CHECK_HEADER([zlib.h],
+ [AC_CHECK_LIB([z], [compress],
+ [ZLIB_LIBS="-lz"],
+ [AS_IF([test x"$1" = xtrue],
+ [AC_MSG_ERROR([cannot find usable zlib library])])])],
[AS_IF([test x"$1" = xtrue],
- [AC_MSG_ERROR([cannot find usable zlib library])])])
+ [AC_MSG_ERROR([cannot find usable zlib header])])])
INN_LIB_ZLIB_RESTORE])
dnl The main macro for packages with mandatory zlib support.
@@ -69,6 +73,7 @@
[AS_IF([test x"$inn_use_ZLIB" = xtrue],
[_INN_LIB_ZLIB_INTERNAL([true])],
[_INN_LIB_ZLIB_INTERNAL([false])])])
- AS_IF([test x"$ZLIB_LIBS" != x],
+ AS_IF([test x"$ZLIB_LIBS" = x],
+ [INN_LIB_HELPER_VAR_CLEAR([ZLIB])],
[inn_use_ZLIB=true
AC_DEFINE([HAVE_ZLIB], 1, [Define if libz is available.])])])
Modified: nnrpd/nnrpd.h
===================================================================
--- nnrpd/nnrpd.h 2018-06-05 14:18:37 UTC (rev 10291)
+++ nnrpd/nnrpd.h 2018-06-05 14:54:06 UTC (rev 10292)
@@ -26,17 +26,11 @@
#include "inn/vector.h"
#include "inn/timer.h"
-#ifndef HAVE_SASL_SASL_H
-# undef HAVE_SASL
-#endif
#ifdef HAVE_SASL
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
#endif
-#if !defined(HAVE_ZLIB_H)
-# undef HAVE_ZLIB
-#endif
#if defined(HAVE_ZLIB)
# include <zlib.h>
#endif
Modified: nnrpd/tls.h
===================================================================
--- nnrpd/tls.h 2018-06-05 14:18:37 UTC (rev 10291)
+++ nnrpd/tls.h 2018-06-05 14:54:06 UTC (rev 10292)
@@ -14,9 +14,6 @@
** by Chris Newman <chris.newman at innosoft.com> (1999/06)
*/
-#ifndef HAVE_OPENSSL_SSL_H
-# undef HAVE_OPENSSL
-#endif
#ifdef HAVE_OPENSSL
#ifndef TLS_H
Modified: storage/ovdb/ovdb-private.h
===================================================================
--- storage/ovdb/ovdb-private.h 2018-06-05 14:18:37 UTC (rev 10291)
+++ storage/ovdb/ovdb-private.h 2018-06-05 14:54:06 UTC (rev 10292)
@@ -1,6 +1,6 @@
-#ifndef HAVE_DB_H
-# undef HAVE_BDB
-#endif
+/* $Id$
+*/
+
#ifdef HAVE_BDB
#include <db.h>
Modified: storage/ovdb/ovdb.c
===================================================================
--- storage/ovdb/ovdb.c 2018-06-05 14:18:37 UTC (rev 10291)
+++ storage/ovdb/ovdb.c 2018-06-05 14:54:06 UTC (rev 10292)
@@ -1,4 +1,5 @@
-/*
+/* $Id$
+ *
* ovdb.c
* ovdb 2.00
* Overview storage using Berkeley DB 4.4 or higher
@@ -82,9 +83,6 @@
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
-#ifndef HAVE_ZLIB_H
-# undef HAVE_ZLIB
-#endif
#ifdef HAVE_ZLIB
# include <zlib.h>
# define MAX_UNZIP_SZ 100000
Modified: tests/tap/libtap.sh
===================================================================
--- tests/tap/libtap.sh 2018-06-05 14:18:37 UTC (rev 10291)
+++ tests/tap/libtap.sh 2018-06-05 14:54:06 UTC (rev 10292)
@@ -12,8 +12,8 @@
# <https://www.eyrie.org/~eagle/software/c-tap-harness/>.
#
# Written by Russ Allbery <eagle at eyrie.org>
-# Copyright 2009, 2010, 2011, 2012, 2016 Russ Allbery <eagle at eyrie.org>
-# Copyright 2006, 2007, 2008, 2013
+# Copyright 2009-2012, 2016 Russ Allbery <eagle at eyrie.org>
+# Copyright 2006-2008, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Modified: tests/tap/macros.h
===================================================================
--- tests/tap/macros.h 2018-06-05 14:18:37 UTC (rev 10291)
+++ tests/tap/macros.h 2018-06-05 14:54:06 UTC (rev 10292)
@@ -9,7 +9,7 @@
* This file is part of C TAP Harness. The current version plus supporting
* documentation is at <https://www.eyrie.org/~eagle/software/c-tap-harness/>.
*
- * Copyright 2008, 2012, 2013, 2015 Russ Allbery <eagle at eyrie.org>
+ * Copyright 2008, 2012-2013, 2015 Russ Allbery <eagle at eyrie.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
More information about the inn-committers
mailing list