Bug 5634 - ../configure --prefix=~/... doesn't work
../configure --prefix=~/... doesn't work
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: other
3.1
: P3 normal
: ---
Assigned To: Ben Elliston
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-08 04:06 UTC by tom
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tom 2002-02-08 04:06:01 UTC
Configuring with --prefix=~/somewhere --program-suffix=something gives a built version which does not install properly.

Specifically, "make install" fails with an error in installing libiberty.a, and leaves directories called "~" lying around.

Release:
gcc-3.1-{20011231, 20020204} at least

Environment:
SuSE 7.3; bash 2.05 as shipped by SuSE

How-To-Repeat:
make two copies of the gcc distribution, configure one with --prefix=~/foo and one with --prefix=/home/twomack/foo, build both; the first won't install, the second will.
Comment 1 phil 2003-02-17 23:23:56 UTC
From: Phil Edwards <phil@jaj.com>
To: bje@gcc.gnu.org, gcc-bugs@gcc.gnu.org, tom@womack.net,
   gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: bootstrap/5634: ../configure --prefix=~/... doesn't work
Date: Mon, 17 Feb 2003 23:23:56 -0500

 On Tue, Feb 18, 2003 at 04:12:02AM -0000, bje@gcc.gnu.org wrote:
 >     This is due to an inconsistent interaction with your shell, viz:
 >     
 >       $ echo prefix=~/install
 >       prefix=/home/bje/install
 >       $ echo --prefix=~/install
 >       --prefix=~/install
 >     
 >     Note that the ~ is expanded correctly in the first, but not the second.
 > It is unreasonable to expect all underlying GCC configury to handle ~
 > as a special case.  At the very least, this should be documented in the
 > installation documentation--do you agree?
 
 FYI, bash understands ~ as the first character in sub-words, such as this.
 But csh and tcsh only understand ~ as the first character in a main word,
 i.e., after whitespace.
 
 This isn't specific to us, so I wouldn't bother documenting it.  Anybody who
 uses a csh-family shell is going to run into these weird features eventually.
 If you do feel like documenting it, I suggest providing a link to a
 "here's an introduction to csh" page somewhere.
 
 
 Phil
 
 -- 
 I would therefore like to posit that computing's central challenge, viz. "How
 not to make a mess of it," has /not/ been met.
                                                  - Edsger Dijkstra, 1930-2002
Comment 2 Ben Elliston 2003-02-18 03:09:53 UTC
Responsible-Changed-From-To: unassigned->bje
Responsible-Changed-Why: Got it.
Comment 3 Ben Elliston 2003-02-18 04:12:02 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: This is due to an inconsistent interaction with your shell, viz:
    
      $ echo prefix=~/install
      prefix=/home/bje/install
      $ echo --prefix=~/install
      --prefix=~/install
    
    Note that the ~ is expanded correctly in the first, but not the second.  It is unreasonable to expect all underlying GCC configury to handle ~ as a special case.  At the very least, this should be documented in the installation documentation--do you agree?
    
    I tend to use --prefix=$HOME/install with success.
Comment 4 Ben Elliston 2003-02-18 04:51:31 UTC
State-Changed-From-To: analyzed->feedback
State-Changed-Why: Patch to install.texi submitted to gcc-patches.
Comment 5 Ben Elliston 2003-02-21 03:12:17 UTC
From: bje@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: other/5634
Date: 21 Feb 2003 03:12:17 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	bje@gcc.gnu.org	2003-02-21 03:12:17
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/doc        : install.texi 
 
 Log message:
 	2003-02-21  Ben Elliston  <bje@redhat.com>
 	
 	PR other/5634
 	* doc/install.texi (Configuration): Explain using $HOME instead of
 	the ~ metacharacter when referring to home directories.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.16803&r2=1.16804
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/install.texi.diff?cvsroot=gcc&r1=1.173&r2=1.174
 

Comment 6 Ben Elliston 2003-02-21 05:19:40 UTC
From: bje@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: other/5634
Date: 21 Feb 2003 05:19:40 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	bje@gcc.gnu.org	2003-02-21 05:19:40
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/doc        : install.texi 
 
 Log message:
 	2003-02-21  Ben Elliston  <bje@redhat.com>
 	
 	PR other/5634
 	* doc/install.texi (Configuration): Explain using $HOME instead of
 	the ~ metacharacter when referring to home directories.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.209&r2=1.16114.2.210
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/install.texi.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.151.2.19&r2=1.151.2.20
 
Comment 7 Ben Elliston 2003-02-22 23:02:57 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: The installation documentation now explicitly describes this gotcha.  I wonder what needs to be done to generate the online docs given the modified install.texi?