make install prefix=XXX to different prefix gives errors using gcc-4_1-branch

Asfand Yar Qazi email@asfandyar.cjb.net
Sat Feb 25 23:47:00 GMT 2006


Brian Dessent wrote:
> Asfand Yar Qazi wrote:
> 
> 
>>So do I, but installing to a different location to where the package was
>>configured for is a feature that the GCC build system supports.  I've used
>>specifying a different prefix= argument to make to what I supplied in
>>configure many times, so therefore this is a bug.
> 
> 
> But the correct way to do this is not to override "prefix", but to
> specify DESTDIR.  But note this should only be used for e.g. making a
> binary package.  It probably would fail in strange ways if you actually
> tried to use the resulting binaries in their DESTDIR location, instead
> of just tarring them up or whatever.
> 
> /path/to/configure --prefix=/desired/prefix
> make
> make install DESTDIR=/tmp/foobar
> 
> Brian
> 
> 


Ah.....

Actually, I'm writing an installation script that automatically 
downloads/compiles/installs gcc-4.1 from SVN.  And the same location 
(/usr/local/gcc) is also holding or is going to hold other versions of gcc 
(4.0.2, 2.95.3) and I want them all to co-exist as gcc-2.95.3, g++-4.1.0, etc. 
  I rename the files from the DESTDIR/bin/XXX to /usr/local/gcc/bin/XXX-4.1.0 
etc., and do the same with the man pages so they can co-exist with other 
versions (so I know which compiler takes which flags, etc.)  I'd rather not do 
a straight make install and then rename/delete in the target directory - too 
messy. I'd rather just copy across the files I need.

I didn't know about the make install DESTDIR=XXX - I've been using make 
install prefix=XXX for AGES.  Ah well, you live and learn.

Thanks



More information about the Gcc-help mailing list