From: Mike Frysinger <vapier@gentoo.org>
To: newlib@sourceware.org
Subject: [PATCH] libgloss: switch to standard AC_PROG_CC
Date: Fri, 18 Feb 2022 21:52:52 -0500 [thread overview]
Message-ID: <20220219025252.23879-1-vapier@gentoo.org> (raw)
Now that we use AC_NO_EXECUTABLES, and we require a recent version of
autoconf, we don't need to define our own copies of these macros. So
switch to the standard AC_PROG_CC.
---
libgloss/aarch64/aclocal.m4 | 368 ------------
libgloss/aarch64/configure | 1029 ++++++++++++++++++++++-----------
libgloss/aarch64/configure.ac | 3 +-
libgloss/acinclude.m4 | 55 --
libgloss/arm/aclocal.m4 | 368 ------------
libgloss/arm/configure | 1029 ++++++++++++++++++++++-----------
libgloss/arm/configure.ac | 3 +-
libgloss/configure | 801 ++++++++-----------------
libgloss/configure.ac | 2 +-
9 files changed, 1605 insertions(+), 2053 deletions(-)
diff --git a/libgloss/aarch64/configure.ac b/libgloss/aarch64/configure.ac
index 1ed0a767bc75..1e8fce7cca03 100644
--- a/libgloss/aarch64/configure.ac
+++ b/libgloss/aarch64/configure.ac
@@ -8,7 +8,8 @@ AC_ARG_PROGRAM
AC_PROG_INSTALL
-LIB_AC_PROG_CC
+AC_NO_EXECUTABLES
+AC_PROG_CC
AS=${AS-as}
AC_SUBST(AS)
AR=${AR-ar}
diff --git a/libgloss/acinclude.m4 b/libgloss/acinclude.m4
index cdd34b6f0304..d792f66b1e30 100644
--- a/libgloss/acinclude.m4
+++ b/libgloss/acinclude.m4
@@ -1,62 +1,7 @@
-# FIXME: We temporarily define our own version of AC_PROG_CC. This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable. This should really be fixed in autoconf
-# itself.
-
-AC_DEFUN([LIB_AC_PROG_CC_GNU],
-[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
-[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
-cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi])])
-
AC_DEFUN([LIB_AM_PROG_AS],
[# By default we simply use the C compiler to build assembly code.
-AC_REQUIRE([LIB_AC_PROG_CC])
test "${CCAS+set}" = set || CCAS=$CC
test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
])
-
-AC_DEFUN([LIB_AC_PROG_CC],
-[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_CHECK_PROG(CC, gcc, gcc)
-_AM_DEPENDENCIES(CC)
-if test -z "$CC"; then
- AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
- test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-fi
-
-LIB_AC_PROG_CC_GNU
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-dnl Check whether -g works, even if CFLAGS is set, in case the package
-dnl plays around with CFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- _AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-])
-
diff --git a/libgloss/arm/configure.ac b/libgloss/arm/configure.ac
index 3d7ba7da15d6..5c6fb8920ce5 100644
--- a/libgloss/arm/configure.ac
+++ b/libgloss/arm/configure.ac
@@ -28,7 +28,8 @@ AC_ARG_PROGRAM
AC_PROG_INSTALL
-LIB_AC_PROG_CC
+AC_NO_EXECUTABLES
+AC_PROG_CC
AS=${AS-as}
AC_SUBST(AS)
AR=${AR-ar}
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index 4aa0f19140fe..895ca4289115 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -248,7 +248,7 @@ dnl fi
AM_CONDITIONAL(CONFIG_LIBNOSYS, test x$config_libnosys = xtrue)
-LIB_AC_PROG_CC
+AC_PROG_CC
AS=${AS-as}
AC_SUBST(AS)
AC_CHECK_PROG(AR, ar, ar, :)
--
2.34.1
next reply other threads:[~2022-02-19 2:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-19 2:52 Mike Frysinger [this message]
2022-02-24 9:24 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220219025252.23879-1-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).