@@ -178,6 +178,10 @@ else
GNATLINK_FOR_HOST=$(host)-gnatlink
GNATLS_FOR_HOST=$(host)-gnatls
+ ifneq ($(findstring ada,$(LANGUAGES)),)
+ RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
+ endif
+
ifeq ($(host), $(target))
# This is a cross native. All the sources are taken from the currently
# built runtime.
@@ -193,9 +197,6 @@ else
else
# This is a canadian cross. We should use a toolchain running on the
# build platform and targeting the host platform.
- ifneq ($(findstring ada,$(LANGUAGES)),)
- RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
- endif
ADA_TOOLS_FLAGS_TO_PASS=\
CC="$(CC)" \
CXX="$(CXX)" \
@@ -658,7 +659,7 @@ ada.tags: force
ada/doctools/xgnatugn$(build_exeext): ada/xgnatugn.adb
-$(MKDIR) ada/doctools
$(CP) $^ ada/doctools
- cd ada/doctools && $(GNATMAKE) -q xgnatugn
+ cd ada/doctools && gnatmake -q xgnatugn
# Note that doc/gnat_ugn.texi and doc/projects.texi do not depend on
# xgnatugn being built so we can distribute a pregenerated doc/gnat_ugn.info
@@ -2415,7 +2415,7 @@ TOOLS_FLAGS_TO_PASS= \
"GNATLINK=$(GNATLINK)" \
"GNATBIND=$(GNATBIND)"
-GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES)
+GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES) $(LDFLAGS)
# Build directory for the tools. Let's copy the target-dependent
# sources using the same mechanism as for gnatlib. The other sources are
@@ -24,6 +24,7 @@ srcdir = @srcdir@
libdir = @libdir@
build = @build@
target = @target@
+host = @host@
prefix = @prefix@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -92,6 +93,7 @@ TOOLS_FLAGS_TO_PASS_RE= \
"CC=../../xgcc -B../../" \
"CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
"CFLAGS=$(CFLAGS)" \
+ "LDFLAGS=$(LDFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
"ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
@@ -192,7 +194,11 @@ regnattools: $(GCC_DIR)/stamp-gnatlib-rts
# put the host RTS dir first in the PATH to hide the default runtime
# files that are among the sources
# FIXME: This should be done in configure.
+ifeq ($(host), $(build))
RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+else
+RTS_DIR:=$(strip $(subst \,/,$(shell $(host)-gnatls -v | grep adalib )))
+endif
gnattools-cross: $(GCC_DIR)/stamp-tools
# gnattools1-re
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \