diff options
Diffstat (limited to 'gnattools/Makefile.in')
-rw-r--r-- | gnattools/Makefile.in | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in index fdd649194df..4ec7afd5dd8 100644 --- a/gnattools/Makefile.in +++ b/gnattools/Makefile.in @@ -24,6 +24,8 @@ srcdir = @srcdir@ libdir = @libdir@ build = @build@ target = @target@ +host = @host@ +host_alias = @host_alias@ prefix = @prefix@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -92,6 +94,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)" \ @@ -105,6 +108,22 @@ TOOLS_FLAGS_TO_PASS_RE= \ "TOOLSCASE=cross" # Variables for gnattools, cross +ifeq ($(build), $(host)) + GNATMAKE_FOR_HOST=gnatmake + GNATLINK_FOR_HOST=gnatlink + GNATBIND_FOR_HOST=gnatbind + GNATLS_FOR_HOST=gnatls +else + GNATMAKE_FOR_HOST=$(host_alias)-gnatmake + GNATLINK_FOR_HOST=$(host_alias)-gnatlink + GNATBIND_FOR_HOST=$(host_alias)-gnatbind + GNATLS_FOR_HOST=$(host_alias)-gnatls +endif + +# 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_FOR_HOST) -v | grep adalib ))) + TOOLS_FLAGS_TO_PASS_CROSS= \ "CC=$(CC)" \ "CXX=$(CXX)" \ @@ -117,9 +136,9 @@ TOOLS_FLAGS_TO_PASS_CROSS= \ "exeext=$(exeext)" \ "fsrcdir=$(fsrcdir)" \ "srcdir=$(fsrcdir)" \ - "GNATMAKE=gnatmake" \ - "GNATLINK=gnatlink" \ - "GNATBIND=gnatbind" \ + "GNATMAKE=$(GNATMAKE_FOR_HOST)" \ + "GNATLINK=$(GNATLINK_FOR_HOST)" \ + "GNATBIND=$(GNATBIND_FOR_HOST)" \ "TOOLSCASE=cross" \ "LIBGNAT=" @@ -188,11 +207,6 @@ regnattools: $(GCC_DIR)/stamp-gnatlib-rts $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \ $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools -# For cross builds of gnattools, -# 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. -RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib ))) gnattools-cross: $(GCC_DIR)/stamp-tools # gnattools1-re $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \ |