This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] ada/36001: Define GNATMAKE when building from the gcc subdirectory
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Samuel Tardieu <sam at rfc1149 dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 May 2008 18:26:38 +0200
- Subject: Re: [PATCH] ada/36001: Define GNATMAKE when building from the gcc subdirectory
- References: <20080509135616.D03EB8045@dawn.rfc1149.net>
Here is what I committed after noticing that the test was (harmlessly,
but confusingly) saying that the driver did not support Ada.
Thanks!
Paolo
2008-05-12 Samuel Tardieu <sam@rfc1149.net>
Paolo Bonzini <bonzini@gnu.org>
PR ada/36001
* acx.m4: Add optional parameter to ACX_PROG_GNAT.
gcc:
2008-05-12 Samuel Tardieu <sam@rfc1149.net>
Paolo Bonzini <bonzini@gnu.org>
PR ada/36001
* Makefile.in: Substitute GNATMAKE and GNATBIND.
* configure.ac: Add call to ACX_PROG_GNAT.
Index: config/acx.m4
===================================================================
--- config/acx.m4 (revision 135218)
+++ config/acx.m4 (working copy)
@@ -357,7 +357,8 @@ ac_c_preproc_warn_flag=yes])# AC_PROG_CP
# Test for GNAT.
# We require the gnatbind program, and a compiler driver that
-# understands Ada. We use the user's CC setting, already found.
+# understands Ada. We use the user's CC setting, already found,
+# and possibly add $1 to the command-line parameters.
#
# Sets the shell variable have_gnat to yes or no as appropriate, and
# substitutes GNATBIND and GNATMAKE.
@@ -380,7 +381,7 @@ acx_cv_cc_gcc_supports_ada=no
# Other compilers, like HP Tru64 UNIX cc, exit successfully when
# given a .adb file, but produce no object file. So we must check
# if an object file was really produced to guard against this.
-errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
+errors=`(${CC} $1[]m4_ifval([$1], [ ])-c conftest.adb) 2>&1 || echo failure`
if test x"$errors" = x && test -f conftest.$ac_objext; then
acx_cv_cc_gcc_supports_ada=yes
fi
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in (revision 135218)
+++ gcc/Makefile.in (working copy)
@@ -872,6 +872,10 @@ LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIB
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
+# Used from ada/Make-lang.in
+GNATBIND = @GNATBIND@
+GNATMAKE = @GNATMAKE@
+
# Libs needed (at present) just for jcf-dump.
LDEXP_LIB = @LDEXP_LIB@
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 135218)
+++ gcc/configure.ac (working copy)
@@ -276,6 +276,8 @@ rm -f a.out a.exe b.out
# Find the native compiler
AC_PROG_CC
AM_PROG_CC_C_O
+ACX_PROG_GNAT([-I"$srcdir"/ada])
+
# autoconf is lame and doesn't give us any substitution variable for this.
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
NO_MINUS_C_MINUS_O=yes