This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Fix gccgo cross-install name


PR 48411 points out that when cross-compiling gccgo is being installed
under the name $(TARGET)-$(TARGET)-gccgo.  This patch fixes it by making
it behave like cp/Make-lang.in.  Bootstrapped on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


2012-02-14  Ian Lance Taylor  <iant@google.com>

	PR go/48411
	* Make-lang.in (gccgo-cross$(exeext)): New target.
	(go.all.cross): Depend on gccgo-cross$(exeext) instead of
	gccgo$(exeext).
	(go.install-common): Only install GCCGO_TARGET_INSTALL_NAME if
	gccgo-cross$(exeext) does not exist.


Index: gcc/go/Make-lang.in
===================================================================
--- gcc/go/Make-lang.in	(revision 184188)
+++ gcc/go/Make-lang.in	(working copy)
@@ -42,6 +42,13 @@ gccgo$(exeext): $(GCCGO_OBJS) $(EXTRA_GC
 	  $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
 	  $(EXTRA_GCC_LIBS) $(LIBS)
 
+# The cross-compiler version.  This is built mainly as a signal to the
+# go.install-common target.  If this executable exists, it means that
+# go.all.cross was run.
+gccgo-cross$(exeext): gccgo$(exeext)
+	-rm -f gccgo-cross$(exeext)
+	cp gccgo$(exeext) gccgo-cross$(exeext)
+
 # Use strict warnings.
 go-warn = $(STRICT_WARN)
 
@@ -107,7 +114,7 @@ gccgo.pod: go/gccgo.texi
 
 # Build hooks.
 
-go.all.cross: gccgo$(exeext)
+go.all.cross: gccgo-cross$(exeext)
 go.start.encap: gccgo$(exeext)
 go.rest.encap:
 go.info: doc/gccgo.info
@@ -136,13 +143,15 @@ check_go_parallelize = go-test.exp=*/tes
 
 go.install-common: installdirs
 	-rm -f $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
-	-rm -f $(DESTDIR)$(bindir)/$(GCCGO_TARGET_INSTALL_NAME)$(exeext)
 	$(INSTALL_PROGRAM) gccgo$(exeext) $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
-	if test -f $(DESTDIR)$(bindir)$(GCCGO_TARGET_INSTALL_NAME)$(exeext); then \
-	  :; \
-	else \
-	  cd $(DESTDIR)$(bindir) && \
-	   $(LN) $(GCCGO_INSTALL_NAME)$(exeext) $(GCCGO_TARGET_INSTALL_NAME)$(exeext); \
+	-if test -f go1$(exeext); then \
+	  if test -f gccgo-cross$(exeext); then \
+	    :; \
+	  else \
+	    rm -f $(DESTDIR)$(bindir)/$(GCCGO_TARGET_INSTALL_NAME)$(exeext); \
+	    ( cd $(DESTDIR)$(bindir) && \
+	      $(LN) $(GCCGO_INSTALL_NAME)$(exeext) $(GCCGO_TARGET_INSTALL_NAME)$(exeext) ); \
+	  fi; \
 	fi
 
 go.install-plugin:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]