[PATCH] libgloss: switch to standard AC_PROG_CC

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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
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.