[PATCH] newlib: avoid duplicate awk checks

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Since AM_MAINTAINER_MODE calls AC_PROG_AWK, and some configure.ac
scripts call it too, we end up testing for awk multiple times.  If
we change NEWLIB_CONFIGURE to require the macro instead, then it
makes sure it's always expanded, but only once.

While we're here, do the same thing with AC_PROG_INSTALL since it
is also called by AM_MAINTAINER_MODE, although it doesn't currently
result in duplicate configure checks.
---
 newlib/acinclude.m4                           |  5 +-
 newlib/configure                              | 47 +------------------
 newlib/configure.ac                           |  1 -
 newlib/iconvdata/configure                    |  5 +-
 newlib/libc/configure                         |  5 +-
 newlib/libc/machine/a29k/configure            |  1 -
 newlib/libc/machine/aarch64/configure         |  1 -
 newlib/libc/machine/amdgcn/configure          |  1 -
 newlib/libc/machine/arc/configure             |  1 -
 newlib/libc/machine/arm/configure             |  1 -
 newlib/libc/machine/bfin/configure            |  1 -
 newlib/libc/machine/configure                 |  5 +-
 newlib/libc/machine/cr16/configure            |  1 -
 newlib/libc/machine/cris/configure            |  1 -
 newlib/libc/machine/crx/configure             |  1 -
 newlib/libc/machine/csky/configure            |  1 -
 newlib/libc/machine/d10v/configure            |  1 -
 newlib/libc/machine/d30v/configure            |  1 -
 newlib/libc/machine/epiphany/configure        |  1 -
 newlib/libc/machine/fr30/configure            |  1 -
 newlib/libc/machine/frv/configure             |  1 -
 newlib/libc/machine/ft32/configure            |  1 -
 newlib/libc/machine/h8300/configure           |  1 -
 newlib/libc/machine/h8500/configure           |  1 -
 newlib/libc/machine/hppa/configure            |  1 -
 newlib/libc/machine/i386/configure            |  5 +-
 newlib/libc/machine/i960/configure            |  1 -
 newlib/libc/machine/iq2000/configure          |  1 -
 newlib/libc/machine/lm32/configure            |  1 -
 newlib/libc/machine/m32c/configure            |  1 -
 newlib/libc/machine/m32r/configure            |  1 -
 newlib/libc/machine/m68hc11/configure         |  1 -
 newlib/libc/machine/m68k/configure            |  1 -
 newlib/libc/machine/m88k/configure            |  1 -
 newlib/libc/machine/mep/configure             |  1 -
 newlib/libc/machine/microblaze/configure      |  1 -
 newlib/libc/machine/mips/configure            |  1 -
 newlib/libc/machine/mn10200/configure         |  1 -
 newlib/libc/machine/mn10300/configure         |  1 -
 newlib/libc/machine/moxie/configure           |  1 -
 newlib/libc/machine/msp430/configure          |  1 -
 newlib/libc/machine/mt/configure              |  1 -
 newlib/libc/machine/nds32/configure           |  1 -
 newlib/libc/machine/necv70/configure          |  1 -
 newlib/libc/machine/nios2/configure           |  1 -
 newlib/libc/machine/nvptx/configure           |  1 -
 newlib/libc/machine/or1k/configure            |  1 -
 newlib/libc/machine/powerpc/configure         |  1 -
 newlib/libc/machine/pru/configure             |  1 -
 newlib/libc/machine/riscv/configure           |  1 -
 newlib/libc/machine/rl78/configure            |  1 -
 newlib/libc/machine/rx/configure              |  1 -
 newlib/libc/machine/sh/configure              |  1 -
 newlib/libc/machine/sparc/configure           |  1 -
 newlib/libc/machine/spu/configure             |  1 -
 newlib/libc/machine/tic4x/configure           |  1 -
 newlib/libc/machine/tic6x/configure           |  1 -
 newlib/libc/machine/tic80/configure           |  1 -
 newlib/libc/machine/v850/configure            |  1 -
 newlib/libc/machine/visium/configure          |  1 -
 newlib/libc/machine/w65/configure             |  1 -
 newlib/libc/machine/x86_64/configure          |  1 -
 newlib/libc/machine/xc16x/configure           |  1 -
 newlib/libc/machine/xscale/configure          |  1 -
 newlib/libc/machine/xstormy16/configure       |  1 -
 newlib/libc/machine/z8k/configure             |  1 -
 newlib/libc/sys/a29khif/configure             |  1 -
 newlib/libc/sys/amdgcn/configure              |  1 -
 newlib/libc/sys/arm/configure                 |  1 -
 newlib/libc/sys/configure                     |  5 +-
 newlib/libc/sys/d10v/configure                |  1 -
 newlib/libc/sys/decstation/configure          |  1 -
 newlib/libc/sys/epiphany/configure            |  1 -
 newlib/libc/sys/h8300hms/configure            |  1 -
 newlib/libc/sys/h8500hms/configure            |  1 -
 newlib/libc/sys/linux/configure               | 47 +------------------
 newlib/libc/sys/linux/configure.ac            |  1 -
 newlib/libc/sys/linux/linuxthreads/configure  | 47 +------------------
 .../libc/sys/linux/linuxthreads/configure.ac  |  1 -
 .../sys/linux/linuxthreads/machine/configure  |  5 +-
 .../linux/linuxthreads/machine/i386/configure | 47 +------------------
 .../linuxthreads/machine/i386/configure.ac    |  1 -
 newlib/libc/sys/linux/machine/configure       |  5 +-
 newlib/libc/sys/linux/machine/i386/configure  | 47 +------------------
 .../libc/sys/linux/machine/i386/configure.ac  |  1 -
 newlib/libc/sys/m88kbug/configure             |  1 -
 newlib/libc/sys/mmixware/configure            |  1 -
 newlib/libc/sys/netware/configure             |  1 -
 newlib/libc/sys/or1k/configure                |  1 -
 newlib/libc/sys/phoenix/configure             |  1 -
 newlib/libc/sys/phoenix/machine/arm/configure |  1 -
 newlib/libc/sys/phoenix/machine/configure     |  1 -
 newlib/libc/sys/rdos/configure                |  1 -
 newlib/libc/sys/rtems/configure               |  1 -
 newlib/libc/sys/sh/configure                  |  1 -
 newlib/libc/sys/sparc64/configure             |  1 -
 newlib/libc/sys/sun4/configure                |  1 -
 newlib/libc/sys/sysmec/configure              |  1 -
 newlib/libc/sys/sysnec810/configure           |  1 -
 newlib/libc/sys/sysnecv850/configure          |  1 -
 newlib/libc/sys/sysvi386/configure            |  1 -
 newlib/libc/sys/sysvnecv70/configure          |  1 -
 newlib/libc/sys/tic80/configure               |  1 -
 newlib/libc/sys/tirtos/configure              |  1 -
 newlib/libc/sys/w65/configure                 |  1 -
 newlib/libc/sys/z8ksim/configure              |  1 -
 newlib/libm/configure                         |  5 +-
 newlib/libm/machine/aarch64/configure         |  1 -
 newlib/libm/machine/arm/configure             |  1 -
 newlib/libm/machine/configure                 |  5 +-
 newlib/libm/machine/i386/configure            |  5 +-
 newlib/libm/machine/mips/configure            |  1 -
 newlib/libm/machine/nds32/configure           |  1 -
 newlib/libm/machine/powerpc/configure         |  1 -
 newlib/libm/machine/pru/configure             |  1 -
 newlib/libm/machine/riscv/configure           |  1 -
 newlib/libm/machine/sparc/configure           |  1 -
 newlib/libm/machine/spu/configure             |  1 -
 newlib/libm/machine/x86_64/configure          |  5 +-
 119 files changed, 36 insertions(+), 361 deletions(-)

diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4
index 912d4a3afc9b..2500ba6df17c 100644
--- a/newlib/acinclude.m4
+++ b/newlib/acinclude.m4
@@ -192,7 +192,10 @@ AC_CHECK_TOOL(AR, ar)
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(READELF, readelf, :)
 
-AC_PROG_INSTALL
+dnl We need these programs, but so does Automake.  Require the macros to avoid
+dnl expanding them multiple times.
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
 
 # Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13.  */
 ac_given_INSTALL=$INSTALL
diff --git a/newlib/configure.ac b/newlib/configure.ac
index e66b10343291..361bbfbac61a 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -276,7 +276,6 @@ dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
 dnl line of the macro which fail because appropriate LDFLAGS are not set.
 _LT_DECL_SED
 _LT_PROG_ECHO_BACKSLASH
-AC_PROG_AWK
 if test "${use_libtool}" = "yes"; then
 LT_INIT([win32-dll])
 fi
diff --git a/newlib/libc/sys/linux/configure.ac b/newlib/libc/sys/linux/configure.ac
index a06e3ec81017..7199176d4950 100644
--- a/newlib/libc/sys/linux/configure.ac
+++ b/newlib/libc/sys/linux/configure.ac
@@ -14,7 +14,6 @@ dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
 dnl line of the macro which fail because appropriate LDFLAGS are not set.
 _LT_DECL_SED
 _LT_PROG_ECHO_BACKSLASH
-AC_PROG_AWK
 if test "${use_libtool}" = "yes"; then
 LT_INIT([win32-dll])
 fi
diff --git a/newlib/libc/sys/linux/linuxthreads/configure.ac b/newlib/libc/sys/linux/linuxthreads/configure.ac
index bed8de1a4d02..b2044e756e15 100644
--- a/newlib/libc/sys/linux/linuxthreads/configure.ac
+++ b/newlib/libc/sys/linux/linuxthreads/configure.ac
@@ -14,7 +14,6 @@ dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
 dnl line of the macro which fail because appropriate LDFLAGS are not set.
 _LT_DECL_SED
 _LT_PROG_ECHO_BACKSLASH
-AC_PROG_AWK
 if test "${use_libtool}" = "yes"; then
 LT_INIT([win32-dll])
 fi
diff --git a/newlib/libc/sys/linux/linuxthreads/machine/i386/configure.ac b/newlib/libc/sys/linux/linuxthreads/machine/i386/configure.ac
index 2c836195a02e..7b3be0df5f75 100644
--- a/newlib/libc/sys/linux/linuxthreads/machine/i386/configure.ac
+++ b/newlib/libc/sys/linux/linuxthreads/machine/i386/configure.ac
@@ -14,7 +14,6 @@ dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
 dnl line of the macro which fail because appropriate LDFLAGS are not set.
 _LT_DECL_SED
 _LT_PROG_ECHO_BACKSLASH
-AC_PROG_AWK
 if test "${use_libtool}" = "yes"; then
 LT_INIT([win32-dll])
 fi
diff --git a/newlib/libc/sys/linux/machine/i386/configure.ac b/newlib/libc/sys/linux/machine/i386/configure.ac
index 5550a37e3614..3c843cd1632f 100644
--- a/newlib/libc/sys/linux/machine/i386/configure.ac
+++ b/newlib/libc/sys/linux/machine/i386/configure.ac
@@ -14,7 +14,6 @@ dnl add it into NEWLIB_CONFIGURE, executable tests are made before the first
 dnl line of the macro which fail because appropriate LDFLAGS are not set.
 _LT_DECL_SED
 _LT_PROG_ECHO_BACKSLASH
-AC_PROG_AWK
 if test "${use_libtool}" = "yes"; then
 LT_INIT([win32-dll])
 fi
-- 
2.33.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.