From 96a034f490595258f9069a3fed037ddc65df2c71 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 26 Apr 2021 23:27:59 -0700 Subject: [PATCH 3/3] maint: port to Autoconf 2.71 * configure.ac: Use AC_PROG_CC, not AC_PROG_CC_STDC. * gl/modules/smack (configure.ac): * m4/jm-macros.m4 (coreutils_MACROS): * m4/xattr.m4 (gl_FUNC_XATTR): Use AS_HELP_STRING, not AC_HELP_STRING. * m4/check-decl.m4 (gl_CHECK_DECLS): Do not require AC_HEADER_TIME; we no longer care about it directly. * m4/jm-macros.m4 (coreutils_MACROS): Do not require AC_ISC_POSIX, which became obsolete in 2006. Use AC_LINK_IFELSE instead of AC_TRY_LINK. --- configure.ac | 2 +- gl/modules/smack | 2 +- m4/check-decl.m4 | 4 +--- m4/jm-macros.m4 | 54 +++++++++++++++++++++++++++--------------------- m4/xattr.m4 | 4 ++-- 5 files changed, 35 insertions(+), 31 deletions(-) diff --git a/configure.ac b/configure.ac index 7fbecbf8d..02291a4ae 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,7 @@ m4_syscmd([test "${GNULIB_POSIXCHECK+set}" = set]) m4_if(m4_sysval, [0], [], [dnl gl_ASSERT_NO_GNULIB_POSIXCHECK]) -AC_PROG_CC_STDC +AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_GCC_TRADITIONAL diff --git a/gl/modules/smack b/gl/modules/smack index a6dcbaa62..1c4a541a6 100644 --- a/gl/modules/smack +++ b/gl/modules/smack @@ -10,7 +10,7 @@ configure.ac: # Check whether libsmack is available LIB_SMACK= AC_ARG_ENABLE([libsmack], - AC_HELP_STRING([--disable-libsmack], [disable libsmack support])) + AS_HELP_STRING([--disable-libsmack], [disable libsmack support])) if test "X$enable_libsmack" != "Xno"; then AC_CHECK_LIB([smack], [smack_new_label_from_self], [AC_CHECK_LIB([smack], [smack_new_label_from_path], diff --git a/m4/check-decl.m4 b/m4/check-decl.m4 index c67a95edb..02db0f330 100644 --- a/m4/check-decl.m4 +++ b/m4/check-decl.m4 @@ -1,4 +1,4 @@ -#serial 26 +#serial 27 # Check declarations for this package. dnl Copyright (C) 1997-2021 Free Software Foundation, Inc. @@ -13,8 +13,6 @@ dnl Putting it in a separate file like this helps share it between dnl different packages. AC_DEFUN([gl_CHECK_DECLS], [ - AC_REQUIRE([AC_HEADER_TIME]) - AC_CHECK_HEADERS_ONCE([grp.h pwd.h]) headers=' #include diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4 index db32cf483..fb66907f4 100644 --- a/m4/jm-macros.m4 +++ b/m4/jm-macros.m4 @@ -1,4 +1,4 @@ -#serial 112 -*- autoconf -*- +#serial 113 -*- autoconf -*- dnl Misc type-related macros for coreutils. @@ -24,9 +24,6 @@ AC_DEFUN([coreutils_MACROS], AM_MISSING_PROG(HELP2MAN, help2man) AC_SUBST([MAN]) - dnl This macro actually runs replacement code. See isc-posix.m4. - AC_REQUIRE([AC_ISC_POSIX])dnl - gl_CHECK_ALL_TYPES AC_REQUIRE([gl_CHECK_DECLS]) @@ -116,7 +113,7 @@ AC_DEFUN([coreutils_MACROS], # Check whether libcap is usable -- for ls --color support LIB_CAP= AC_ARG_ENABLE([libcap], - AC_HELP_STRING([--disable-libcap], [disable libcap support])) + AS_HELP_STRING([--disable-libcap], [disable libcap support])) if test "X$enable_libcap" != "Xno"; then AC_CHECK_LIB([cap], [cap_get_file], [AC_CHECK_HEADER([sys/capability.h], @@ -142,29 +139,38 @@ AC_DEFUN([coreutils_MACROS], # and doesn't have a separate math library. AC_SUBST([SEQ_LIBM]) - ac_seq_body=' - static double x, y; - x = floor (x); - x = rint (x); - x = modf (x, &y);' - AC_TRY_LINK([#include ], [$ac_seq_body], , - [ac_seq_save_LIBS="$LIBS" - LIBS="$LIBS -lm" - AC_TRY_LINK([#include ], [$ac_seq_body], [SEQ_LIBM=-lm]) - LIBS="$ac_seq_save_LIBS" - ]) - + jm_break=: + for jm_seqlibs in '' '-lm'; do + jm_seq_save_LIBS=$LIBS + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static double x, y; + x = floor (x); + x = rint (x); + x = modf (x, &y);]])], + [SEQ_LIBM=$jm_seqlibs + jm_break=break]) + LIBS=$jm_seq_save_LIBS + $jm_break + done # See is fpsetprec() required to use extended double precision # This is needed on 32 bit FreeBSD to give accurate conversion of: # `numfmt 9223372036854775808` - AC_TRY_LINK([#include ], - [#ifdef __i386__ - fpsetprec(FP_PE); - #else - # error not required on 64 bit - #endif - ], [ac_have_fpsetprec=yes], [ac_have_fpsetprec=no]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[#ifdef __i386__ + fpsetprec(FP_PE); + #else + # error not required on 64 bit + #endif + ]])], + [ac_have_fpsetprec=yes], + [ac_have_fpsetprec=no]) if test "$ac_have_fpsetprec" = "yes" ; then AC_DEFINE([HAVE_FPSETPREC], 1, [whether fpsetprec is present and required]) fi diff --git a/m4/xattr.m4 b/m4/xattr.m4 index 3fbcd9104..5f9248939 100644 --- a/m4/xattr.m4 +++ b/m4/xattr.m4 @@ -1,5 +1,5 @@ # xattr.m4 - check for Extended Attributes (Linux) -# serial 3 +# serial 4 # Copyright (C) 2003-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -11,7 +11,7 @@ AC_DEFUN([gl_FUNC_XATTR], [ AC_ARG_ENABLE([xattr], - AC_HELP_STRING([--disable-xattr], + AS_HELP_STRING([--disable-xattr], [do not support extended attributes]), [use_xattr=$enableval], [use_xattr=yes]) -- 2.27.0