Patch to install g++ and c++ in $(tooldir)/bin for cross-compilers

Olly Betts olly@muscat.co.uk
Thu Jun 17 05:42:00 GMT 1999


Hi.

Building an egcs-1.1.2 cross-compiler (linux->mingw in my case but I believe
this is true for any host and target) installs "gcc" in $(tooldir)/bin but
not "c++" or "g++".  This is a pain - in particular it means you can't just
put $(tooldir)/bin at the start of PATH and expect autoconf configure
scripts to find the right c++ for cross-builds.

Attached is a patch to fix this.  This same issue may apply to other
frontends, but I only have "egcs-core" and "egcs-g++" installed so I can't
tell easily.

I noticed while doing this that binutils creates a hard-link between the
binary in $(tooldir)/bin and the copy in $(bindir), while egcs installs a
separate copy in $(tooldir)/bin and $(bindir).  The binutils approach seems
better (less disk space) but won't work if it's possible to specify
$(bindir) and $(tooldir) on different partitions (is it?).  So for this
reason and for consistency within egcs this patch installs separate copies
in the two directories.

Cheers,
Olly

--- egcs-1.1.2/gcc/cp/Make-lang.orig	Mon Jun  7 17:01:00 1999
+++ egcs-1.1.2/gcc/cp/Make-lang	Thu Jun 17 11:30:32 1999
@@ -221,6 +221,12 @@
 	    chmod a+x $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
 	    rm -f $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
 	    $(LN) $(bindir)/$(GXX_CROSS_NAME)$(exeext) $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
+	    if [ -d $(tooldir)/bin/. ] ; then \
+	      rm -f $(tooldir)/bin/$(GXX_INSTALL_NAME)$(exeext); \
+	      $(INSTALL_PROGRAM) g++-cross$(exeext) $(tooldir)/bin/$(GXX_INSTALL_NAME)$(exeext); \
+	      rm -f $(tooldir)/bin/$(CXX_INSTALL_NAME)$(exeext); \
+	      $(LN) $(tooldir)/bin/$(GXX_INSTALL_NAME)$(exeext) $(tooldir)/bin/$(CXX_INSTALL_NAME)$(exeext); \
+	    else true; fi; \
 	  else \
 	    rm -f $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
 	    $(INSTALL_PROGRAM) g++$(exeext) $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \


More information about the Gcc-patches mailing list