aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2004-03-11 05:01:17 +0000
committerNathanael Nerode <neroden@gcc.gnu.org>2004-03-11 05:01:17 +0000
commite4c9c07571387e0d377858d4ee578cece464bba6 (patch)
tree5754cfb1e4fb54f59bd27aff97cdfe79c44ce77f /config
parente46e9f822e035f84349a34ae4dce020c98c30da5 (diff)
downloadgcc-e4c9c07571387e0d377858d4ee578cece464bba6.zip
gcc-e4c9c07571387e0d377858d4ee578cece464bba6.tar.gz
gcc-e4c9c07571387e0d377858d4ee578cece464bba6.tar.bz2
(top level)
2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * configure.in: Find default values for the tools as soon as possible. Disable ada if GNAT is not found. Emit error message about missing languages. Expand --enable-languages=all for the gcc subdirectory. (config) 2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * acx.m4 (ACX_PROG_GNAT): New macro, moved here from the gcc subdirectory. (gcc) 2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * configure.ac: Remove code to detect languages, it now lives exclusively in the top level. * aclocal.m4 (gcc_AC_PROG_GNAT): Moved to the top level, renamed to ACX_PROG_GNAT. (gcc/ada) 2004-03-08 Paolo Bonzini <bonzini@gnu.org> PR ada/14131 Move language detection to the top level. * config-lang.in: Build by default. From-SVN: r79299
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog7
-rw-r--r--config/acx.m435
2 files changed, 42 insertions, 0 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index ac35d3e..7a970b7 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-08 Paolo Bonzini <bonzini@gnu.org>
+
+ PR ada/14131
+ Move language detection to the top level.
+ * acx.m4 (ACX_PROG_GNAT): New macro, moved here
+ from the gcc subdirectory.
+
2004-03-09 Hans-Peter Nilsson <hp@axis.com>
* accross.m4 (AC_C_BIGENDIAN_CROSS): Compile endian probe with
diff --git a/config/acx.m4 b/config/acx.m4
index 96b7c8a..ab7f98a 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -155,3 +155,38 @@ AC_DEFUN([AC_PROG_CPP_WERROR],
[AC_REQUIRE([AC_PROG_CPP])dnl
m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD]))
ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR
+
+# Test for GNAT.
+# We require the gnatbind program, and a compiler driver that
+# understands Ada. We use the user's CC setting, already found.
+#
+# Sets the shell variable have_gnat to yes or no as appropriate, and
+# substitutes GNATBIND.
+AC_DEFUN([ACX_PROG_GNAT],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
+AC_REQUIRE([AC_PROG_CC])
+AC_CHECK_TOOL(GNATBIND, gnatbind, no)
+AC_CACHE_CHECK([whether compiler driver understands Ada],
+ acx_cv_cc_gcc_supports_ada,
+[cat >conftest.adb <<EOF
+procedure conftest is begin null; end conftest;
+EOF
+acx_cv_cc_gcc_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
+ acx_cv_cc_gcc_supports_ada=yes
+ break
+fi
+rm -f conftest.*])
+
+if test x$GNATBIND != xno && test x$acx_cv_gcc_supports_ada != xno; then
+ have_gnat=yes
+else
+ have_gnat=no
+fi
+])