This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH to top level: don't use dirname in configure
- To: law at cygnus dot com
- Subject: Re: PATCH to top level: don't use dirname in configure
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 23 Jul 2000 23:32:47 -0300
- Cc: Eli Zaretskii <eliz at is dot elta dot co dot il>, 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
- Organization: GCC Team, Red Hat
- References: <12548.964368714@upchuck>
On Jul 23, 2000, Jeffrey A Law <law@cygnus.com> wrote:
> ## this sed command emulates the dirname command
> dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
Autoconf CVS has recently gained a portable implementation of dirname:
# _AC_SHELL_DIRNAME(PATHNAME)
# ---------------------------
# Simulate running `dirname(1)' on PATHNAME, not all systems have it.
# This macro must be usable from inside ` `.
#
# Paul Eggert answers:
# Question: Under UN*X, should `//1' give `/'?
#
# No, under some older flavors of Unix, leading // is a special path
# name: it refers to a "super-root" and is used to access other
# machines' files. Leading ///, ////, etc. are equivalent to /; but
# leading // is special. I think this tradition started with Apollo
# Domain/OS, an OS that is still in use on some older hosts.
#
# POSIX.2 allows but does not require the special treatment for //.
# It says that the behavior of dirname on path names of the form
# //([^/]+/*)? is implementation defined. In these cases, GNU dirname
# returns /, but it's more portable to return // as this works even on
# those older flavors of Unix.
#
# I have heard rumors that this special treatment of // may be dropped
# in future versions of POSIX, but for now it's still the standard.
define([_AC_SHELL_DIRNAME],
[expr X$1 : 'X\(.*[[^/]]\)//*[[^/][^/]]*/*$' \| \
X$1 : 'X\(//\)[[^/]]' \| \
X$1 : 'X\(//\)$' \| \
X$1 : 'X\(/\)' \| \
. : '\(.\)'])
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me