summaryrefslogtreecommitdiff
path: root/gcc/aclocal.m4
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-08 17:58:31 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-08 17:58:31 +0000
commit0af0145914901657e6ae2499cb136eb16618b729 (patch)
treebc545eaefeca1c114e651a287700be5bbdad760c /gcc/aclocal.m4
parent76147072b6b6bca07a1a4958700bb954b86509cc (diff)
downloadgcc-0af0145914901657e6ae2499cb136eb16618b729.tar.gz
top:
* aclocal.m4 (gcc_AC_PROG_GNAT): New. * configure.in: Use it. * configure: Regenerated. * config/pa/t-linux, config/pa/t-pa, config/pa/t-pa64, config/pa/t-pro: Set T_ADAFLAGS, not ADA_CFLAGS. ada: * Make-lang.in (ADAFLAGS): Add -W -Wall. (ADA_FLAGS_TO_PASS): Set ADA_CFLAGS=$(CFLAGS) also. (gnat1): Also depend on attribs.o. (gnatlib, gnatlib-shared): Set CC and ADAC in recursive make. * Makefile.in (X_ADAFLAGS, T_ADAFLAGS): New. (ADAC): Set to @ADAC@ in stage1, $(CC) later. (ADAFLAGS): Add -W -Wall. (ALL_ADAFLAGS, MOST_ADAFLAGS): Add X_ADAFLAGS and T_ADAFLAGS; take out CFLAGS. (.adb.o, .ads.o, a-numaux.o, a-teioed.o, s-interr.o, s-taskin.o, sdefault.o, s-tasdeb.o, s-vaflop.o, a-except.o, s-assert.o, s-stalib.o, s-memory.o, memtrack.o, mlib-tgt.o): Use $(ADAC), not $(CC), as compilation command. (gnattools): Depend directly on tools to build, don't use recursive make. (gnatlib): Set ADA_CFLAGS=$(GNATLIBCFLAGS) in recursive make. * einfo.h, sinfo.h: New files (autogenerated). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46085 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/aclocal.m4')
-rw-r--r--gcc/aclocal.m451
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index dd5a150ab8c..66c61362e2e 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -308,6 +308,57 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
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
+dnl Sets the shell variable have_gnat to yes or no as appropriate, and
+dnl substitutes GNATBIND and ADAC.
+AC_DEFUN([gcc_AC_PROG_GNAT],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
+AC_CHECK_TOOL(GNATBIND, gnatbind, no)
+AC_CACHE_CHECK([for compiler driver that understands Ada],
+ gcc_cv_prog_adac,
+[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.
+user_adac=$ADAC
+user_cc=$CC
+for cand in ${ac_tool_prefix}$user_adac $user_adac \
+ ${ac_tool_prefix}$user_cc $user_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
+rm -f conftest.*])
+ADAC=$gcc_cv_prog_adac
+AC_SUBST(ADAC)
+
+if test x$GNATBIND != xno && test x$ADAC != xno; then
+ have_gnat=yes
+else
+ have_gnat=no
+fi
+])
+
#serial 1
dnl This test replaces the one in autoconf.
dnl Currently this macro should have the same name as the autoconf macro