This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH to top level: don't use dirname in configure
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: PATCH to top level: don't use dirname in configure
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 23 Jul 2000 10:11:54 -0600
- cc: msokolov at ivan dot Harhan dot ORG (Michael Sokolov), binutils at sources dot redhat dot com, gcc-patches at gcc dot gnu dot org, gdb-patches at sources dot redhat dot com
- Reply-To: law at cygnus dot com
In message <200007220919.FAA12005@indy.delorie.com>you write:
> > Date: Fri, 21 Jul 00 17:29:14 CDT
> > From: msokolov@ivan.Harhan.ORG (Michael Sokolov)
> >
> > ! topsrcdir=`cd \`echo ${progname} | sed 's:/configure$::'\`; pwd`
>
> This assumes that (a) $(progname) always expands to "configure", and
> (b) that the last delimiter is '/'. I don't know whether the first
> assumption is true on each supported system, but the second might be
> wrong on DOS/Windows where a backslash might be used instead.
I believe we can use something like this to deal with the first problem:
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
The second problem exists in many places in the various configure & install
scripts and probably should be attacked and fixed en-masse.
Michael -- can you verify the sed command I provided above does the right
thing for you?
Also I'd like to have a comment which references dirname (like the one above)
to make these things easier to find (either when updating them to handle
DOS filesystems in the future, or when we need to find a suitable sed command
to emulate dirname elsewhere).
Thanks,
jeff