summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-11-18 11:51:18 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2020-11-18 11:51:18 +0900
commit9485ca7b5bf11194cff59edbfa6a0fba3bf6162a (patch)
tree754f3e9577ff7db3db28f0ed6b5f103d103b1b72 /m4
parent425bf499185d78aa8fcad6a30b8771e7865d449d (diff)
downloadlibgcrypt-9485ca7b5bf11194cff59edbfa6a0fba3bf6162a.tar.gz
build: Update to newer autoconf constructs.
* acinclude.m4 (GNUPG_SYS_SYMBOL_UNDERSCORE): Use AS_MESSAGE_LOG_FD instead of AC_FD_CC. (GNUPG_CHECK_MLOCK): Use AC_LINK_IFELSE instead of AC_TRY_LINK. Use AC_RUN_IFELSE instead of AC_TRY_RUN. * configure.ac (AC_ISC_POSIX): Replace by AC_SEARCH_LIBS. Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE. Use AS_HELP_STRING instead of AC_HELP_STRING. (AC_TYPE_SIGNAL): Remove. (AC_DECL_SYS_SIGLIST): Remove. * m4/Makefile.am (EXTRA_DIST): Update. * m4/onceonly.m4: Remove. * m4/socklen.m4: Update from gnulib. * m4/libtool.m4: Update from libgpg-error. * m4/gpg-error.m4: Update from libgpg-error. * m4/noexecstack.m4: Use AS_HELP_STRING instead of AC_HELP_STRING. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'm4')
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/gpg-error.m46
-rw-r--r--m4/libtool.m418
-rw-r--r--m4/noexecstack.m42
-rw-r--r--m4/onceonly.m466
-rw-r--r--m4/socklen.m4102
6 files changed, 79 insertions, 117 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 0c908759..9b953174 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1,2 +1,2 @@
-EXTRA_DIST = libtool.m4 onceonly.m4 socklen.m4 sys_socket_h.m4 noexecstack.m4
+EXTRA_DIST = libtool.m4 socklen.m4 sys_socket_h.m4 noexecstack.m4
EXTRA_DIST += gpg-error.m4
diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4
index a9d572fb..c9b235f2 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 1d62b058..8795701e 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/noexecstack.m4 b/m4/noexecstack.m4
index 4aab484f..ae0b26b8 100644
--- a/m4/noexecstack.m4
+++ b/m4/noexecstack.m4
@@ -25,7 +25,7 @@ AC_REQUIRE([AM_PROG_AS])
AC_MSG_CHECKING([whether non excutable stack support is requested])
AC_ARG_ENABLE(noexecstack,
- AC_HELP_STRING([--disable-noexecstack],
+ AS_HELP_STRING([--disable-noexecstack],
[disable non executable stack support]),
noexecstack_support=$enableval, noexecstack_support=yes)
AC_MSG_RESULT($noexecstack_support)
diff --git a/m4/onceonly.m4 b/m4/onceonly.m4
deleted file mode 100644
index 6d913faf..00000000
--- 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 5e3765a6..251960b0 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
+ ])