Patchwork Bug 54030 - make install does not honor --program-prefix/--program-suffix for 'gcc' (AVR build)

login
register
mail settings
Submitter Sylvain Leroux
Date July 19, 2012, 12:37 p.m.
Message ID <5007FF6E.1000601@chicoree.fr>
Download mbox | patch
Permalink /patch/171947/
State New
Headers show

Comments

Sylvain Leroux - July 19, 2012, 12:37 p.m.
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
Mike Stump - July 19, 2012, 5:02 p.m.
On Jul 19, 2012, at 5:37 AM, Sylvain Leroux wrote:
> 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).

Looks nice to me...

Patch

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)