From: Bruno Haible Date: Sun, 4 Oct 2020 21:44:52 +0000 (+0200) Subject: build: Modernize autoconf macros. X-Git-Tag: v0.21.1~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2cda016f42f06ba9ecbc2ca95e17a95da8774f0;p=thirdparty%2Fgettext.git build: Modernize autoconf macros. * gettext-runtime/m4/intdiv0.m4 (gt_INTDIV0): Improve m4 quoting. * gettext-runtime/m4/printf-posix.m4 (gt_PRINTF_POSIX): Likewise. * gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Improve indentation. * gettext-tools/m4/hostname.m4 (gt_PREREQ_HOSTNAME): Improve m4 quoting. Use AC_CACHE_CHECK and AC_COMPILE_IFELSE. * gettext-tools/m4/siginfo.m4 (gt_SIGINFO): Improve m4 quoting. Use AC_COMPILE_IFELSE. --- diff --git a/gettext-runtime/m4/intdiv0.m4 b/gettext-runtime/m4/intdiv0.m4 index c1034c760..0b4dcc209 100644 --- a/gettext-runtime/m4/intdiv0.m4 +++ b/gettext-runtime/m4/intdiv0.m4 @@ -1,4 +1,4 @@ -# intdiv0.m4 serial 7 (gettext-0.20.2) +# intdiv0.m4 serial 8 (gettext-0.21.1) dnl Copyright (C) 2002, 2007-2008, 2010-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, @@ -12,7 +12,7 @@ AC_DEFUN([gt_INTDIV0], AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], - gt_cv_int_divbyzero_sigfpe, + [gt_cv_int_divbyzero_sigfpe], [ gt_cv_int_divbyzero_sigfpe= changequote(,)dnl @@ -82,8 +82,8 @@ changequote([,])dnl fi ]) case "$gt_cv_int_divbyzero_sigfpe" in - *yes) value=1;; - *) value=0;; + *yes) value=1 ;; + *) value=0 ;; esac AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value], [Define if integer division by zero raises signal SIGFPE.]) diff --git a/gettext-runtime/m4/intl.m4 b/gettext-runtime/m4/intl.m4 index 043176d03..3a94c2092 100644 --- a/gettext-runtime/m4/intl.m4 +++ b/gettext-runtime/m4/intl.m4 @@ -1,4 +1,4 @@ -# intl.m4 serial 44 (gettext-0.21) +# intl.m4 serial 45 (gettext-0.21.1) dnl Copyright (C) 1995-2014, 2016-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, @@ -88,7 +88,7 @@ AC_DEFUN([AM_INTL_SUBDIR], case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; - *) HAVE_POSIX_PRINTF=0 ;; + *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then diff --git a/gettext-runtime/m4/printf-posix.m4 b/gettext-runtime/m4/printf-posix.m4 index 2707cf745..12b6cc5ad 100644 --- a/gettext-runtime/m4/printf-posix.m4 +++ b/gettext-runtime/m4/printf-posix.m4 @@ -1,5 +1,5 @@ -# printf-posix.m4 serial 6 (gettext-0.18.2) -dnl Copyright (C) 2003, 2007, 2009-2019 Free Software Foundation, Inc. +# printf-posix.m4 serial 7 (gettext-0.21.1) +dnl Copyright (C) 2003, 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. @@ -12,7 +12,7 @@ AC_DEFUN([gt_PRINTF_POSIX], [ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], - gt_cv_func_printf_posix, + [gt_cv_func_printf_posix], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ diff --git a/gettext-tools/m4/hostname.m4 b/gettext-tools/m4/hostname.m4 index 50756f3f1..f66cd3911 100644 --- a/gettext-tools/m4/hostname.m4 +++ b/gettext-tools/m4/hostname.m4 @@ -1,5 +1,5 @@ -# hostname.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +# hostname.m4 serial 2 (gettext-0.21.1) +dnl Copyright (C) 2001-2002, 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. @@ -7,20 +7,22 @@ dnl with or without modifications, as long as this notice is preserved. # Prerequisites of the hostname.c program. AC_DEFUN([gt_PREREQ_HOSTNAME], [ - AC_CHECK_HEADERS(arpa/inet.h) - AC_CHECK_FUNCS(gethostname gethostbyname inet_ntop) + AC_CHECK_HEADERS([arpa/inet.h]) + AC_CHECK_FUNCS([gethostname gethostbyname inet_ntop]) - AC_MSG_CHECKING([for IPv6 sockets]) - AC_CACHE_VAL(gt_cv_socket_ipv6,[ - AC_TRY_COMPILE([ -#include -#include -#include ], -[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;], - gt_cv_socket_ipv6=yes, gt_cv_socket_ipv6=no) - ]) - AC_MSG_RESULT($gt_cv_socket_ipv6) + AC_CACHE_CHECK([for IPv6 sockets], + [gt_cv_socket_ipv6], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + #include + #include + ]], + [[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;]])], + [gt_cv_socket_ipv6=yes], + [gt_cv_socket_ipv6=no]) + ]) if test $gt_cv_socket_ipv6 = yes; then - AC_DEFINE(HAVE_IPV6, 1, [Define if defines AF_INET6.]) + AC_DEFINE([HAVE_IPV6], [1], [Define if defines AF_INET6.]) fi ]) diff --git a/gettext-tools/m4/siginfo.m4 b/gettext-tools/m4/siginfo.m4 index 424fcfee2..f39f6b5ac 100644 --- a/gettext-tools/m4/siginfo.m4 +++ b/gettext-tools/m4/siginfo.m4 @@ -1,5 +1,5 @@ -# siginfo.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +# siginfo.m4 serial 2 (gettext-0.21.1) +dnl Copyright (C) 2001-2002, 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. @@ -35,16 +35,19 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gt_SIGINFO], [ AC_CACHE_CHECK([for signal handlers with siginfo_t], gt_cv_siginfo_t, - [AC_TRY_COMPILE([ -#include ], [ -struct sigaction action; -siginfo_t info; -action.sa_flags = SA_SIGINFO; -action.sa_sigaction = (void *) 0; -], gt_cv_siginfo_t=yes, gt_cv_siginfo_t=no)]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[struct sigaction action; + siginfo_t info; + action.sa_flags = SA_SIGINFO; + action.sa_sigaction = (void *) 0; + ]])], + [gt_cv_siginfo_t=yes], + [gt_cv_siginfo_t=no])]) if test $gt_cv_siginfo_t = yes; then - AC_DEFINE(HAVE_SIGINFO, 1, - [Define to 1 if defines the siginfo_t type, - and struct sigaction has the sa_sigaction member and the SA_SIGINFO flag.]) + AC_DEFINE([HAVE_SIGINFO], [1], + [Define to 1 if defines the siginfo_t type and + struct sigaction has the sa_sigaction member and the SA_SIGINFO flag.]) fi ])