[PATCH] gold: configury: fix obsolete macros

Pietro Monteiro pietro@sociotechnical.xyz
Tue Jun 3 02:07:38 GMT 2025


Running `autoreconf -vf -Wall' in the gold directory shows errors about the use
of obsolete macros.  This patch fix the issues with macros used or defined in
the gold directory.  However, it doesn't fix all warnings.  There are autoconf
warnings  from files in the config directory, and one automake warning about
target shadowing.  It cuts a lot of the noise down and makes an upgrade to
autoconf 2.71+ easier.

https://www.gnu.org/software/automake/manual/1.12.2/html_node/Obsolete-Macros.html#index-AM_005fCONFIG_005fHEADER
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fOUTPUT-2133

gold/ChangeLog:

	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* configure.ac: Replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS. Replace
	AC_OUTPUT(filelist) with AC_CONFIG_FILES(filelist) AC_OUTPUT.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
---
 gold/aclocal.m4   | 29 -----------------------------
 gold/configure    |  1 +
 gold/configure.ac |  5 +++--
 3 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/gold/aclocal.m4 b/gold/aclocal.m4
index d0455aad6c7..a8512a23690 100644
--- a/gold/aclocal.m4
+++ b/gold/aclocal.m4
@@ -751,35 +751,6 @@ else
 fi
 ])
 
-#  -*- Autoconf -*-
-# Obsolete and "removed" macros, that must however still report explicit
-# error messages when used, to smooth transition.
-#
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
-AC_CONFIG_HEADERS($@)])
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should simply use the 'AC][_PROG_CC' macro instead.
-Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
-but upon 'ac_cv_prog_cc_stdc'.])])
-
-AC_DEFUN([AM_C_PROTOTYPES],
-         [AC_FATAL([automatic de-ANSI-fication support has been removed])])
-AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
diff --git a/gold/configure b/gold/configure
index a2674d6ecbb..32aa3b62b09 100755
--- a/gold/configure
+++ b/gold/configure
@@ -13871,6 +13871,7 @@ DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
diff --git a/gold/configure.ac b/gold/configure.ac
index 36ffc2536c1..ff38a44b190 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -25,7 +25,7 @@ AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([no-dist parallel-tests])
 AM_SILENT_RULES([yes])
 
-AM_CONFIG_HEADER(config.h:config.in)
+AC_CONFIG_HEADERS(config.h:config.in)
 
 AC_USE_SYSTEM_EXTENSIONS
 
@@ -738,4 +738,5 @@ AM_LC_MESSAGES
 
 AM_MAINTAINER_MODE
 
-AC_OUTPUT(Makefile testsuite/Makefile po/Makefile.in:po/Make-in)
+AC_CONFIG_FILES([Makefile testsuite/Makefile po/Makefile.in:po/Make-in])
+AC_OUTPUT
-- 
2.43.0



More information about the Binutils mailing list