diff options
Diffstat (limited to 'gcc/aclocal.m4')
-rw-r--r-- | gcc/aclocal.m4 | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index 9829363d549..22025e1a138 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -318,46 +318,33 @@ AC_SUBST(INSTALL_DATA)dnl 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 |