]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Modernize autoconf macros.
authorBruno Haible <bruno@clisp.org>
Sun, 4 Oct 2020 21:44:52 +0000 (23:44 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Sep 2022 10:10:58 +0000 (12:10 +0200)
* 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.

gettext-runtime/m4/intdiv0.m4
gettext-runtime/m4/intl.m4
gettext-runtime/m4/printf-posix.m4
gettext-tools/m4/hostname.m4
gettext-tools/m4/siginfo.m4

index c1034c7603969eee50603a8f13a48e51550ba82c..0b4dcc2094d9d268c1ec3b7ebee301416649279f 100644 (file)
@@ -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.])
index 043176d03c16a85eaf688a629d243ff188f3f4a2..3a94c2092b58e1e035533c50da26ecfd1b710023 100644 (file)
@@ -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
index 2707cf74522448981a75b645c63d4b2386c4d70e..12b6cc5adc81395d3e6d39669331685764ad2514 100644 (file)
@@ -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([[
index 50756f3f160486f64ec4fcd34588873756ab9966..f66cd391181fa43c66a26e4db009c81a6f0eff56 100644 (file)
@@ -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 <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],
-[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 <sys/types.h>
+           #include <sys/socket.h>
+           #include <netinet/in.h>
+         ]],
+         [[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 <sys/socket.h> defines AF_INET6.])
+    AC_DEFINE([HAVE_IPV6], [1], [Define if <sys/socket.h> defines AF_INET6.])
   fi
 ])
index 424fcfee2d82b20af66898bd82bada76a91a3553..f39f6b5ac42d34ab0752649164f33933481e145c 100644 (file)
@@ -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 <signal.h>], [
-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 <signal.h>]],
+          [[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 <signal.h> 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 <signal.h> defines the siginfo_t type and
+       struct sigaction has the sa_sigaction member and the SA_SIGINFO flag.])
   fi
 ])