public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH to top level: don't use dirname in configure
@ 2000-07-21 15:31 Michael Sokolov
  2000-07-22  2:20 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Sokolov @ 2000-07-21 15:31 UTC (permalink / raw)
  To: binutils, gcc-patches, gdb-patches

Hi there,

Below is a patch to the top level of the tree (both src and gcc repos) for the
Cygnus configure script used there. It uses dirname, which 4.3BSD doesn't have.
This patch changes it to the obvious equivalent that doesn't use dirname. (This
is a patch to configure, not configure.in etc., because this is the Cygnus
configure script and the bug is in the static part that's the same whereever
the script is used.)

--
Michael Sokolov		Harhan Engineering Laboratory
Public Service Agent	International Free Computing Task Force
			International Engineering and Science Task Force
			615 N GOOD LATIMER EXPY STE #4
			DALLAS TX 75204-5852 USA

Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)

2000-07-21  Michael Sokolov  <msokolov@ivan.Harhan.ORG>

	* configure (topsrcdir): Don't use dirname.

Index: configure
===================================================================
RCS file: /cvs/src/src/configure,v
retrieving revision 1.9
diff -c -3 -p -r1.9 configure
*** configure	2000/05/21 16:57:14	1.9
--- configure	2000/07/21 22:21:22
*************** fi
*** 518,524 ****
  
  configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
  moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
! topsrcdir=`cd \`dirname ${progname}\`; pwd`
  
  
  # this is a hack.  sun4 must always be a valid host alias or this will fail.
--- 518,524 ----
  
  configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
  moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
! topsrcdir=`cd \`echo ${progname} | sed 's:/configure$::'\`; pwd`
  
  
  # this is a hack.  sun4 must always be a valid host alias or this will fail.

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: PATCH to top level: don't use dirname in configure
@ 2000-07-22  8:44 Michael Sokolov
  2000-07-23  4:01 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Sokolov @ 2000-07-22  8:44 UTC (permalink / raw)
  To: binutils, gcc-patches, gdb-patches

Eli Zaretskii <eliz@delorie.com> wrote:

> 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.

Both of these assumptions are already being made extensively by the rest of the
very same Cygnus configure script. The use of dirname there was actually out of
line with respect to the rest of the script, and my patch makes it the same as
the rest of the script.

> In contrast, `dirname' (when it exists) will always DTRT, because it
                          ^^^^^^^^^^^^^^
> is tailored to the host system.

That's where the problem lies. As Alexandre Oliva <aoliva@redhat.com> wrote,

: Unfortunately, `dirname' is too far from being portable.  We must not
: depend on its existence.

GCC, Binutils, and GDB must be usable as add-ons to existing UNIX systems. At
least one of these systems, 4.3BSD, doesn't have dirname. Therefore, the
current top-level configure behaviour is unacceptable for GCC, Binutils, and
GDB.

My patch fixes an existing problem that must be fixed, and it cannot introduce
new problems that didn't exist before (as it does the same thing the rest of
the script does), therefore, it should be checked in.

--
Michael Sokolov		Harhan Engineering Laboratory
Public Service Agent	International Free Computing Task Force
			International Engineering and Science Task Force
			615 N GOOD LATIMER EXPY STE #4
			DALLAS TX 75204-5852 USA

Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: PATCH to top level: don't use dirname in configure
@ 2000-07-23  9:44 Michael Sokolov
  2000-07-23 10:43 ` Jeffrey A Law
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Sokolov @ 2000-07-23  9:44 UTC (permalink / raw)
  To: binutils, gcc-patches, gdb-patches

Jeffrey A Law <law@cygnus.com> wrote:

> ## this sed command emulates the dirname command
> dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
>
> [...]
>
> Michael -- can you verify the sed command I provided above does the right
> thing for you?

Yes, it does.

So would you like a patch like the one below?

--
Michael Sokolov		Harhan Engineering Laboratory
Public Service Agent	International Free Computing Task Force
			International Engineering and Science Task Force
			615 N GOOD LATIMER EXPY STE #4
			DALLAS TX 75204-5852 USA

Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)

2000-07-23  Michael Sokolov  <msokolov@ivan.Harhan.ORG>

	* configure (topsrcdir): Don't use dirname.

Index: configure
===================================================================
RCS file: /cvs/src/src/configure,v
retrieving revision 1.10
diff -c -r1.10 configure
*** configure	2000/07/22 08:20:10	1.10
--- configure	2000/07/23 16:37:44
***************
*** 518,524 ****
  
  configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
  moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
! topsrcdir=`cd \`dirname ${progname}\`; pwd`
  
  
  # this is a hack.  sun4 must always be a valid host alias or this will fail.
--- 518,525 ----
  
  configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
  moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
! ## the sed command below emulates the dirname command
! topsrcdir=`cd \`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'\`; pwd`
  
  
  # this is a hack.  sun4 must always be a valid host alias or this will fail.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2000-07-23 19:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-21 15:31 PATCH to top level: don't use dirname in configure Michael Sokolov
2000-07-22  2:20 ` Eli Zaretskii
2000-07-22  2:33   ` Alexandre Oliva
2000-07-23  9:11   ` Jeffrey A Law
2000-07-23 19:32     ` Alexandre Oliva
2000-07-22  8:44 Michael Sokolov
2000-07-23  4:01 ` Eli Zaretskii
2000-07-23  9:44 Michael Sokolov
2000-07-23 10:43 ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).