diff mbox

[Ada] Use noncanonical host name for canadian cross builds

Message ID 2173399.W6S5kklAdZ@polaris
State New
Headers show

Commit Message

Eric Botcazou May 16, 2016, 8:55 a.m. UTC
This brings consistency to the way host tools are invoked when doing canadian 
cross builds with Ada: gnattools was using host_alias and gcc/ada host, while 
the most correct incantation is probably host_noncanonical.

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


2016-05-16  Eric Botcazou  <ebotcazou@adacore.com>

gnattools/
	* configure.ac: Add ACX_NONCANONICAL_HOST.
	* configure: Regenerate.
	* Makefile.in: Replace host_alias with host_noncanonical.
	(gnattools-cross): Do not rename the tools.
gcc/
	* configure.ac: Add ACX_NONCANONICAL_HOST.
	* configure: Regenerate.
	* Makefile.in: Set host_noncanonical.
gcc/ada
	* gcc-interface/Make-lang.in (GNATMAKE_FOR_HOST): In the canadian
	cross case, use host_noncanonical instead of host as prefix.
	(GNATBIND_FOR_HOST): Likewise.
	(GNATLINK_FOR_HOST): Likewise.
	(GNATLS_FOR_HOST): Likewise.
diff mbox

Patch

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 236264)
+++ gcc/Makefile.in	(working copy)
@@ -56,6 +56,7 @@  MAKEOVERRIDES =
 
 build=@build@
 host=@host@
+host_noncanonical=@host_noncanonical@
 target=@target@
 target_noncanonical:=@target_noncanonical@
 
Index: gcc/ada/gcc-interface/Make-lang.in
===================================================================
--- gcc/ada/gcc-interface/Make-lang.in	(revision 236264)
+++ gcc/ada/gcc-interface/Make-lang.in	(working copy)
@@ -175,10 +175,10 @@  else
   # or a cross-native compiler. We provide defaults for tools targeting the
   # host platform, but they can be overriden by just setting <tool>_FOR_HOST
   # variables.
-  GNATMAKE_FOR_HOST=$(host)-gnatmake
-  GNATBIND_FOR_HOST=$(host)-gnatbind
-  GNATLINK_FOR_HOST=$(host)-gnatlink
-  GNATLS_FOR_HOST=$(host)-gnatls
+  GNATMAKE_FOR_HOST=$(host_noncanonical)-gnatmake
+  GNATBIND_FOR_HOST=$(host_noncanonical)-gnatbind
+  GNATLINK_FOR_HOST=$(host_noncanonical)-gnatlink
+  GNATLS_FOR_HOST=$(host_noncanonical)-gnatls
 
   ifeq ($(host), $(target))
     # This is a cross native. All the sources are taken from the currently
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 236264)
+++ gcc/configure.ac	(working copy)
@@ -35,6 +35,9 @@  AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
+# Determine the noncanonical host name, for Ada.
+ACX_NONCANONICAL_HOST
+
 # Determine the noncanonical target name, for directory use.
 ACX_NONCANONICAL_TARGET
 
Index: gnattools/Makefile.in
===================================================================
--- gnattools/Makefile.in	(revision 236264)
+++ gnattools/Makefile.in	(working copy)
@@ -25,7 +25,6 @@  libdir = @libdir@
 build = @build@
 target = @target@
 host = @host@
-host_alias = @host_alias@
 prefix = @prefix@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -34,6 +33,7 @@  INSTALL_PROGRAM = @INSTALL_PROGRAM@
 # Nonstandard autoconf-set variables.
 LN_S=@LN_S@
 target_noncanonical=@target_noncanonical@
+host_noncanonical=@host_noncanonical@
 
 # Variables for the user (or the top level) to override.
 exeext = @EXEEXT@
@@ -118,10 +118,10 @@  ifeq ($(build), $(host))
   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
+  GNATMAKE_FOR_HOST=$(host_noncanonical)-gnatmake
+  GNATLINK_FOR_HOST=$(host_noncanonical)-gnatlink
+  GNATBIND_FOR_HOST=$(host_noncanonical)-gnatbind
+  GNATLS_FOR_HOST=$(host_noncanonical)-gnatls
 endif
 
 # Put the host RTS dir first in the PATH to hide the default runtime
@@ -219,50 +219,6 @@  gnattools-cross: $(GCC_DIR)/stamp-tools
 	# gnattools2
 	$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
 	  $(TOOLS_FLAGS_TO_PASS_CROSS) common-tools
-	# Rename cross tools to where the GCC makefile wants them when
-	# installing.  FIXME: installation should be done elsewhere.
-	if [ -f $(GCC_DIR)/gnatbind$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatbind$(exeext) $(GCC_DIR)/gnatbind-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatchop$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatchop$(exeext) $(GCC_DIR)/gnatchop-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnat$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnat$(exeext) $(GCC_DIR)/gnat-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatkr$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatkr$(exeext) $(GCC_DIR)/gnatkr-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatlink$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatlink$(exeext) $(GCC_DIR)/gnatlink-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatls$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatls$(exeext) $(GCC_DIR)/gnatls-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatmake$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatmake$(exeext) $(GCC_DIR)/gnatmake-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatmem$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatmem$(exeext) $(GCC_DIR)/gnatmem-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatname$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatname$(exeext) $(GCC_DIR)/gnatname-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatprep$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatprep$(exeext) $(GCC_DIR)/gnatprep-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatxref$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatxref$(exeext) $(GCC_DIR)/gnatxref-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatfind$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatfind$(exeext) $(GCC_DIR)/gnatfind-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatclean$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatclean$(exeext) $(GCC_DIR)/gnatclean-cross$(exeext); \
-	fi
-	if [ -f $(GCC_DIR)/gnatsym$(exeext) ] ; then \
-	  mv $(GCC_DIR)/gnatsym$(exeext) $(GCC_DIR)/gnatsym-cross$(exeext); \
-	fi
 
 # Other
 # -----
Index: gnattools/configure.ac
===================================================================
--- gnattools/configure.ac	(revision 236264)
+++ gnattools/configure.ac	(working copy)
@@ -46,6 +46,7 @@  AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
+ACX_NONCANONICAL_HOST
 ACX_NONCANONICAL_TARGET
 
 # Need to pass this down for now :-P