From patchwork Thu Jul 19 12:37:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Bug 54030 - make install does not honor --program-prefix/--program-suffix for 'gcc' (AVR build) Date: Thu, 19 Jul 2012 02:37:02 -0000 From: Sylvain Leroux X-Patchwork-Id: 171947 Message-Id: <5007FF6E.1000601@chicoree.fr> To: gcc-patches@gcc.gnu.org Cc: "neroden@gcc.gnu.org" <"Nathanael Nerode"> Hi, I cc Nathanael Nerode since according to MAINTENERS he one of the people in charge of Makefile.in. I filed a bug against make install which does not honor --program-prefix/--program-suffix for the driver 'gcc' while building for target AVR (maybe others too). In a particular case (--program-prefix='avr-' --program-suffix='-4.7.1'), gcc is not installed at all in $(DESTDIR)$(bindir). http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54030 By taking a closer look at the output of 'make install' it appears that gcc is in fact installed with the requested name, but removed just afterward: -------8<---------- rm -f /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1 /usr/bin/install -c xgcc /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1 (install) rm -f /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1 (delete ) -------8<---------- I fixed the problem by swapping the two corresponding lines in the target 'install-driver' of the file ${GCCSRC}gcc/Makefile.in: $(target_noncanonical)-gcc-$(version)$(exeext) ) -if [ -f gcc-cross$(exeext) ] ; then \ With that patch, gcc is installed both with its canonical name (avr-gcc-4.7.1) and with the requested program -prefix/-suffix like all other binaries. - Sylvain Index: gcc/Makefile.in =================================================================== --- gcc/Makefile.in (revision 189649) +++ gcc/Makefile.in (working copy) @@ -4651,8 +4651,8 @@ # and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc. install-driver: installdirs xgcc$(exeext) -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) + -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext) -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) - -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext) -( cd $(DESTDIR)$(bindir) && \ $(LN) $(GCC_INSTALL_NAME)$(exeext)