diff options
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | m4/Makefile.am | 2 | ||||
-rw-r--r-- | m4/gnupg-pth.m4 | 105 | ||||
-rw-r--r-- | m4/gpg-error.m4 | 6 | ||||
-rw-r--r-- | m4/libtool.m4 | 18 | ||||
-rw-r--r-- | m4/onceonly.m4 | 66 | ||||
-rw-r--r-- | m4/socklen.m4 | 102 |
7 files changed, 84 insertions, 229 deletions
diff --git a/configure.ac b/configure.ac index 8b089ab..e0c5ca4 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ # Process this file with autoconf to produce a configure script. -AC_PREREQ(2.61) +AC_PREREQ([2.61]) min_automake_version="1.14" # To build a release you need to create a tag with the version number @@ -53,7 +53,7 @@ m4_define([mym4_revision], m4_argn(7, mym4_verslist)) m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist)) m4_esyscmd([echo ]mym4_version[>VERSION]) -AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org]) +AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org]) # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) @@ -78,12 +78,12 @@ AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip]) AM_MAINTAINER_MODE AC_CONFIG_SRCDIR(src/assuan.h.in) AC_CONFIG_MACRO_DIR(m4) -AM_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS([config.h]) AC_CANONICAL_HOST AM_SILENT_RULES AB_INIT -AC_GNU_SOURCE +AC_USE_SYSTEM_EXTENSIONS # Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH @@ -291,7 +291,7 @@ BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec" AC_SUBST(BUILD_FILEVERSION) AC_ARG_ENABLE([build-timestamp], - AC_HELP_STRING([--enable-build-timestamp], + AS_HELP_STRING([--enable-build-timestamp], [set an explicit build timestamp for reproducibility. (default is the current time in ISO-8601 format)]), [if test "$enableval" = "yes"; then @@ -349,8 +349,6 @@ AC_TYPE_UINT16_T AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T -AC_TYPE_SIGNAL -AC_DECL_SYS_SIGLIST gl_HEADER_SYS_SOCKET gl_TYPE_SOCKLEN_T @@ -460,7 +458,7 @@ AC_CHECK_FUNCS([getpeereid]) # Extra features # build_doc=yes -AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc], +AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc], [do not build the documentation]), build_doc=$enableval, build_doc=yes) AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno]) diff --git a/m4/Makefile.am b/m4/Makefile.am index 0848e42..589f6f9 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = socklen.m4 sys_socket_h.m4 onceonly.m4 autobuild.m4 gnupg-pth.m4 +EXTRA_DIST = socklen.m4 sys_socket_h.m4 autobuild.m4 diff --git a/m4/gnupg-pth.m4 b/m4/gnupg-pth.m4 deleted file mode 100644 index 6dc9e0e..0000000 --- a/m4/gnupg-pth.m4 +++ /dev/null @@ -1,105 +0,0 @@ -dnl GnuPG's check for Pth. -dnl Copyright (C) 2003 Free Software Foundation, Inc. -dnl -dnl This file is free software; as a special exception the author gives -dnl unlimited permission to copy and/or distribute it, with or without -dnl modifications, as long as this notice is preserved. -dnl -dnl This file is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the -dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - -# GNUPG_PTH_VERSION_CHECK(REQUIRED) -# -# If the version is sufficient, HAVE_PTH will be set to yes. -# -# Taken and modified from the m4 macros which come with Pth. -AC_DEFUN([GNUPG_PTH_VERSION_CHECK], - [ - _pth_version=`$PTH_CONFIG --version | awk 'NR==1 {print [$]3}'` - _req_version="ifelse([$1],,1.2.0,$1)" - - AC_MSG_CHECKING(for PTH - version >= $_req_version) - for _var in _pth_version _req_version; do - eval "_val=\"\$${_var}\"" - _major=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\1/'` - _minor=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\2/'` - _rtype=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\3/'` - _micro=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\4/'` - case $_rtype in - "a" ) _rtype=0 ;; - "b" ) _rtype=1 ;; - "." ) _rtype=2 ;; - esac - _hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \ - "major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"` - eval "${_var}_hex=\"\$_hex\"" - done - have_pth=no - if test ".$_pth_version_hex" != .; then - if test ".$_req_version_hex" != .; then - if test $_pth_version_hex -ge $_req_version_hex; then - have_pth=yes - fi - fi - fi - if test $have_pth = yes; then - AC_MSG_RESULT(yes) - AC_MSG_CHECKING([whether PTH installation is sane]) - AC_CACHE_VAL(gnupg_cv_pth_is_sane,[ - _gnupg_pth_save_cflags=$CFLAGS - _gnupg_pth_save_ldflags=$LDFLAGS - _gnupg_pth_save_libs=$LIBS - CFLAGS="$CFLAGS `$PTH_CONFIG --cflags`" - LDFLAGS="$LDFLAGS `$PTH_CONFIG --ldflags`" - LIBS="$LIBS `$PTH_CONFIG --libs --all`" - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pth.h> - ], - [[ pth_init ();]])], - gnupg_cv_pth_is_sane=yes, - gnupg_cv_pth_is_sane=no) - CFLAGS=$_gnupg_pth_save_cflags - LDFLAGS=$_gnupg_pth_save_ldflags - LIBS=$_gnupg_pth_save_libs - ]) - if test $gnupg_cv_pth_is_sane != yes; then - have_pth=no - fi - AC_MSG_RESULT($gnupg_cv_pth_is_sane) - else - AC_MSG_RESULT(no) - fi - ]) - - - -# GNUPG_PATH_PTH([MINIMUM_VERSION]) -# -# On return $have_pth is set as well as HAVE_PTH is defined and -# PTH_CLFAGS and PTH_LIBS are AS_SUBST. -# -AC_DEFUN([GNUPG_PATH_PTH], -[ AC_ARG_WITH(pth-prefix, - AC_HELP_STRING([--with-pth-prefix=PFX], - [prefix where GNU Pth is installed (optional)]), - pth_config_prefix="$withval", pth_config_prefix="") - if test x$pth_config_prefix != x ; then - PTH_CONFIG="$pth_config_prefix/bin/pth-config" - fi - AC_PATH_PROG(PTH_CONFIG, pth-config, no) - tmp=ifelse([$1], ,1.3.7,$1) - if test "$PTH_CONFIG" != "no"; then - GNUPG_PTH_VERSION_CHECK($tmp) - if test $have_pth = yes; then - PTH_CFLAGS=`$PTH_CONFIG --cflags` - PTH_LIBS=`$PTH_CONFIG --ldflags` - PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`" - AC_DEFINE(HAVE_PTH, 1, - [Defined if the GNU Pth is available]) - fi - fi - AC_SUBST(PTH_CFLAGS) - AC_SUBST(PTH_LIBS) -]) - diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index a9d572f..c9b235f 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -1,5 +1,5 @@ # gpg-error.m4 - autoconf macro to detect libgpg-error. -# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 g10 Code GmbH +# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-11-02 +# Last-changed: 2020-11-17 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, @@ -31,7 +31,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR], dnl since that is consistent with how our three siblings use the directory/ dnl package name in --with-$dir_name-prefix=PFX. AC_ARG_WITH(libgpg-error-prefix, - AC_HELP_STRING([--with-libgpg-error-prefix=PFX], + AS_HELP_STRING([--with-libgpg-error-prefix=PFX], [prefix where GPG Error is installed (optional)]), [gpg_error_config_prefix="$withval"]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 1d62b05..8795701 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -34,7 +34,7 @@ m4_define([_LT_COPYING], [dnl # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# can be downloaded from https://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) @@ -7474,7 +7474,7 @@ AC_LANG_POP # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE +AC_LANG_PUSH([Java]) # Source file extension for Java test sources. ac_ext=java @@ -7530,7 +7530,7 @@ if test -n "$compiler"; then _LT_CONFIG($1) fi -AC_LANG_RESTORE +AC_LANG_POP GCC=$lt_save_GCC CC=$lt_save_CC @@ -7545,7 +7545,7 @@ CFLAGS=$lt_save_CFLAGS # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE +AC_LANG_PUSH([Go]) # Source file extension for Go test sources. ac_ext=go @@ -7601,7 +7601,7 @@ if test -n "$compiler"; then _LT_CONFIG($1) fi -AC_LANG_RESTORE +AC_LANG_POP GCC=$lt_save_GCC CC=$lt_save_CC @@ -7616,7 +7616,9 @@ CFLAGS=$lt_save_CFLAGS # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE + +dnl Here, something like AC_LANG_PUSH([RC]) is expected. +dnl But Resource Compiler is not supported as a language by autoconf # Source file extension for RC test sources. ac_ext=rc @@ -7655,8 +7657,10 @@ if test -n "$compiler"; then _LT_CONFIG($1) fi +dnl Here, AC_LANG_POP is expected. GCC=$lt_save_GCC -AC_LANG_RESTORE +dnl Back to C +AC_LANG([C]) CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG diff --git a/m4/onceonly.m4 b/m4/onceonly.m4 deleted file mode 100644 index 6d913fa..0000000 --- a/m4/onceonly.m4 +++ /dev/null @@ -1,66 +0,0 @@ -# onceonly.m4 serial 4 (gettext-0.15) -dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This file defines some "once only" variants of standard autoconf macros. -dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS -dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS -dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS -dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC -dnl The advantage is that the check for each of the headers/functions/decls -dnl will be put only once into the 'configure' file. It keeps the size of -dnl the 'configure' file down, and avoids redundant output when 'configure' -dnl is run. -dnl The drawback is that the checks cannot be conditionalized. If you write -dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi -dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to -dnl empty, and the check will be inserted before the body of the AC_DEFUNed -dnl function. - -dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf -dnl have this macro built-in. But about AC_CHECK_DECLS_ONCE: note that in -dnl autoconf >= 2.60 the symbol separator is a comma, whereas here it is -dnl whitespace. - -dnl Autoconf version 2.57 or newer is recommended. -AC_PREREQ(2.54) - -# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of -# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). -AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ - : - AC_FOREACH([gl_HEADER_NAME], [$1], [ - AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]), - [-./], [___])), [ - AC_CHECK_HEADERS(gl_HEADER_NAME) - ]) - AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, - [-./], [___]))) - ]) -]) - -# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of -# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). -AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ - : - AC_FOREACH([gl_FUNC_NAME], [$1], [ - AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ - AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME])) - ]) - AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) - ]) -]) - -# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of -# AC_CHECK_DECLS(DECL1, DECL2, ...). -AC_DEFUN([AC_CHECK_DECLS_ONCE], [ - : - AC_FOREACH([gl_DECL_NAME], [$1], [ - AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ - AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) - ]) - AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) - ]) -]) diff --git a/m4/socklen.m4 b/m4/socklen.m4 index 5e3765a..251960b 100644 --- a/m4/socklen.m4 +++ b/m4/socklen.m4 @@ -1,5 +1,5 @@ -# socklen.m4 serial 4 -dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +# socklen.m4 serial 11 +dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,45 +8,69 @@ dnl From Albert Chin, Windows fixes from Simon Josefsson. dnl Check for socklen_t: historically on BSD it is an int, and in dnl POSIX 1g it is a type of its own, but some platforms use different -dnl types for the argument to getsockopt, getpeername, etc. So we -dnl have to test to find something that will work. +dnl types for the argument to getsockopt, getpeername, etc.: +dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS. +dnl So we have to test to find something that will work. -dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find -dnl it there first. That file is included by gnulib's socket_.h, which -dnl all users of this module should include. Cygwin must not include -dnl ws2tcpip.h. AC_DEFUN([gl_TYPE_SOCKLEN_T], - [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl + [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl AC_CHECK_TYPE([socklen_t], , - [AC_MSG_CHECKING([for socklen_t equivalent]) - AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv], - [# Systems have either "struct sockaddr *" or - # "void *" as the second argument to getpeername - gl_cv_socklen_t_equiv= - for arg2 in "struct sockaddr" void; do - for t in int size_t "unsigned int" "long int" "unsigned long int"; do - AC_TRY_COMPILE( - [#include <sys/types.h> - #include <sys/socket.h> + [AC_CACHE_CHECK([for socklen_t equivalent], + [gl_cv_socklen_t_equiv], + [# Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include <sys/types.h> + #include <sys/socket.h> - int getpeername (int, $arg2 *, $t *);], - [$t len; - getpeername (0, 0, &len);], - [gl_cv_socklen_t_equiv="$t"]) - test "$gl_cv_socklen_t_equiv" != "" && break - done - test "$gl_cv_socklen_t_equiv" != "" && break - done - ]) - if test "$gl_cv_socklen_t_equiv" = ""; then - AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) - fi - AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) + int getpeername (int, $arg2 *, $t *);]], + [[$t len; + getpeername (0, 0, &len);]])], + [gl_cv_socklen_t_equiv="$t"]) + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + if test "$gl_cv_socklen_t_equiv" = ""; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + ]) AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], - [type to use in place of socklen_t if not defined])], - [#include <sys/types.h> - #if HAVE_SYS_SOCKET_H - # include <sys/socket.h> - #elif HAVE_WS2TCPIP_H - # include <ws2tcpip.h> - #endif])]) + [type to use in place of socklen_t if not defined])], + [gl_SOCKET_HEADERS])]) + +dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find +dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users +dnl of this module should use the same include pattern as gl_SOCKET_HEADERS. +dnl When you change this macro, keep also in sync: +dnl - gl_CHECK_SOCKET_HEADERS, +dnl - the Include section of modules/socklen. +AC_DEFUN([gl_SOCKET_HEADERS], +[ +/* <sys/types.h> is not needed according to POSIX, but the + <sys/socket.h> in i386-unknown-freebsd4.10 and + powerpc-apple-darwin5.5 required it. */ +#include <sys/types.h> +#if HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#elif HAVE_WS2TCPIP_H +# include <ws2tcpip.h> +#endif +]) + +dnl Tests for the existence of the header for socket facilities. +dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H. +dnl This macro must match gl_SOCKET_HEADERS. +AC_DEFUN([gl_CHECK_SOCKET_HEADERS], + [AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = no; then + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([ws2tcpip.h]) + fi + ]) |