From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Eli Zaretskii Cc: msokolov@ivan.Harhan.ORG (Michael Sokolov), binutils@sources.redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com Subject: Re: PATCH to top level: don't use dirname in configure Date: Sun, 23 Jul 2000 09:11:00 -0000 Message-id: <12548.964368714@upchuck> References: <200007220919.FAA12005@indy.delorie.com> X-SW-Source: 2000-07/msg00237.html 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