Hi!

:= assigned variable gets evaluated right away, including the case when
host doesn't have any Ada compiler installed.  In that case we remove ada
from enabled languages, but still RTS_DIR is sometimes computed.

With this patch we could call gnatls 4 times (or even 6 times) instead of
just once, but as gnatls isn't very expensive command, I think it is worth
doing that.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2011-11-30  Jakub Jelinek  <ja...@redhat.com>

        PR bootstrap/51201
        * gcc-interface/Make-lang.in: Initialize RTS_DIR with = instead of :=.

--- gcc/ada/gcc-interface/Make-lang.in.jj       2011-11-28 17:58:01.000000000 
+0100
+++ gcc/ada/gcc-interface/Make-lang.in  2011-11-30 11:47:18.723657889 +0100
@@ -118,7 +118,7 @@ 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 )))
+    RTS_DIR=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
 
     ADA_TOOLS_FLAGS_TO_PASS=\
         CC="$(CC)" \
@@ -153,7 +153,7 @@ 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 
)))
+    RTS_DIR=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
     ADA_TOOLS_FLAGS_TO_PASS=\
         CC="$(CC)" \
         $(COMMON_FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS)  \

        Jakub

Reply via email to