diff mbox

gotools patch committed: Always install cgo as cgo

Message ID CAOyqgcWMrwMH-9riGux7A7Xv_rvM9KCp6_4oycdhJP=9BjYk+A@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Jan. 22, 2015, 4:20 a.m. UTC
The gotools Makefile was written to install cgo using
--program-transform-name.  That does not make sense, as cgo is an
internal program and the go tool will always look for the exact name
"cgo".  This patch fixes the problem by always installing cgo as
"cgo".  Bootstrapped and installed on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian


2015-01-21  Ian Lance Taylor  <iant@google.com>

* Makefile.am (noinst_PROGRAMS): New variable.
(libexecsub_PROGRAMS): Remove variable.
(install-exec-local, uninstall-local): New targets.
* Makefile.in: Rebuild.
diff mbox

Patch

Index: Makefile.am
===================================================================
--- Makefile.am	(revision 219984)
+++ Makefile.am	(working copy)
@@ -105,7 +105,7 @@  if NATIVE
 # and install them as regular programs.
 
 bin_PROGRAMS = go$(EXEEXT) gofmt$(EXEEXT)
-libexecsub_PROGRAMS = cgo$(EXEEXT)
+noinst_PROGRAMS = cgo$(EXEEXT)
 
 go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP)
 	$(GOLINK) $(go_cmd_go_files) zdefaultcc.go $(LIBS) $(NET_LIBS)
@@ -114,6 +114,14 @@  gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(
 cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP)
 	$(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(LIBS) $(NET_LIBS)
 
+install-exec-local: cgo$(EXEEXT)
+	$(MKDIR_P) $(DESTDIR)$(libexecsubdir)
+	rm -f $(DESTDIR)$(libexecsubdir)/cgo$(exeext)
+	$(INSTALL_PROGRAM) cgo$(exeext) $(DESTDIR)$(libexecsubdir)/cgo$(exeext)
+
+uninstall-local:
+	rm -f $(DESTDIR)$(libexecsubdir)/cgo$(exeext)
+
 else
 
 # For a non-native build we have to build the programs using a