From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Oliva To: law@cygnus.com Cc: Eli Zaretskii , 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 19:32:00 -0000 Message-id: References: <12548.964368714@upchuck> X-SW-Source: 2000-07/msg00430.html On Jul 23, 2000, Jeffrey A Law 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