This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] ADAC removal part 3
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 26 Nov 2003 14:17:35 -0500
- Subject: [committed] ADAC removal part 3
This does the trick, although I'd like to clean it up a little more.
Tested on i686-pc-linux-gnu, committed.
* aclocal.m4 (gcc_AC_PROG_GNAT): Rewrite to account for removal
of ADAC.
* configure: Regenerate.
Index: aclocal.m4
===================================================================
RCS file: /cvs/gcc/gcc/gcc/aclocal.m4,v
retrieving revision 1.81
diff -u -r1.81 aclocal.m4
--- aclocal.m4 1 Nov 2003 02:34:58 -0000 1.81
+++ aclocal.m4 26 Nov 2003 19:13:14 -0000
@@ -318,46 +318,33 @@
dnl Test for GNAT.
dnl We require the gnatbind program, and a compiler driver that
-dnl understands Ada. The user may set the driver name explicitly
-dnl with ADAC; also, the user's CC setting is tried. Failing that,
-dnl we try gcc and cc, then a sampling of names known to be used for
-dnl the Ada driver on various systems.
+dnl understands Ada. We use the user's CC setting, already found.
dnl
dnl Sets the shell variable have_gnat to yes or no as appropriate, and
-dnl substitutes GNATBIND and ADAC.
+dnl substitutes GNATBIND.
AC_DEFUN([gcc_AC_PROG_GNAT],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
+AC_REQUIRE([AC_PROG_CC])
AC_CHECK_TOOL(GNATBIND, gnatbind, no)
-AC_CACHE_CHECK([for compiler driver that understands Ada],
- gcc_cv_prog_adac,
+AC_CACHE_CHECK([whether compiler driver understands Ada],
+ gcc_cv_cc_supports_ada,
[cat >conftest.adb <<EOF
procedure conftest is begin null; end conftest;
EOF
-gcc_cv_prog_adac=no
-# Have to do ac_tool_prefix and user overrides by hand.
-for cand in ${ADAC+"$ADAC"} ${CC+"$CC"} \
- ${ac_tool_prefix}gcc gcc \
- ${ac_tool_prefix}cc cc \
- ${ac_tool_prefix}gnatgcc gnatgcc \
- ${ac_tool_prefix}gnatcc gnatcc \
- ${ac_tool_prefix}adagcc adagcc \
- ${ac_tool_prefix}adacc adacc ; do
- # There is a bug in all released versions of GCC which causes the
- # driver to exit successfully when the appropriate language module
- # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
- # Therefore we must check for the error message as well as an
- # unsuccessful exit.
- errors=`($cand -c conftest.adb) 2>&1 || echo failure`
- if test x"$errors" = x; then
- gcc_cv_prog_adac=$cand
- break
- fi
-done
+gcc_cv_cc_supports_ada=no
+# There is a bug in old released versions of GCC which causes the
+# driver to exit successfully when the appropriate language module
+# has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
+# Therefore we must check for the error message as well as an
+# unsuccessful exit.
+errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
+if test x"$errors" = x; then
+ gcc_cv_cc_supports_ada=yes
+ break
+fi
rm -f conftest.*])
-ADAC=$gcc_cv_prog_adac
-AC_SUBST(ADAC)
-if test x$GNATBIND != xno && test x$ADAC != xno; then
+if test x$GNATBIND != xno && test x$gcc_cv_supports_ada != xno; then
have_gnat=yes
else
have_gnat=no
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html