diff mbox

[Ada] Do not invoke gnatls unconditionally

Message ID 2635349.Pv1Pabyczp@polaris
State New
Headers show

Commit Message

Eric Botcazou Dec. 11, 2012, 8:01 a.m. UTC
Even if the Ada language isn't enabled, the Make-lang.in fragment of the Ada 
compiler is processed and invokes gnatls unconditionally, which can result in 
error messages if the command isn't present.

Tested on x86_64-suse-linux, applied on the mainline.


2012-12-11  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/Make-lang.in (RTS_DIR): Define only if Ada is enabled.

Comments

Mike Stump Dec. 11, 2012, 11:21 a.m. UTC | #1
On Dec 11, 2012, at 12:01 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Even if the Ada language isn't enabled, the Make-lang.in fragment of the Ada 
> compiler is processed and invokes gnatls unconditionally, which can result in 
> error messages if the command isn't present.

Thank you.
diff mbox

Patch

Index: gcc-interface/Make-lang.in
===================================================================
--- gcc-interface/Make-lang.in	(revision 194382)
+++ gcc-interface/Make-lang.in	(working copy)
@@ -122,7 +122,9 @@  ifeq ($(build), $(host))
 
     # put the host RTS dir first in the PATH to hide the default runtime
     # files that are among the sources
-    RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+    ifneq ($(findstring ada,$(LANGUAGES)),)
+      RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+    endif
 
     ADA_TOOLS_FLAGS_TO_PASS=\
         CC="$(CC)" \
@@ -157,7 +159,9 @@  else
   else
     # This is a canadian cross. We should use a toolchain running on the
     # build platform and targeting the host platform.
-    RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
+    ifneq ($(findstring ada,$(LANGUAGES)),)
+      RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
+    endif
     ADA_TOOLS_FLAGS_TO_PASS=\
         CC="$(CC)" \
         $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS)  \