autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DOS path


From: Tim Van Holder
Subject: Re: DOS path
Date: 14 Feb 2002 13:31:06 +0100

On Thu, 2002-02-14 at 11:18, John Poltorak wrote:
> On Thu, Feb 14, 2002 at 08:53:58AM +0100, Tim Van Holder wrote:
> > On Thu, 2002-02-14 at 00:46, Paul Eggert wrote:
> > > > From: John Poltorak <address@hidden>
> > > > Date: Wed, 13 Feb 2002 20:21:20 +0000
> > > > 
> > > > What is the recommended way of treating a DOS path such as? :-
> > > > 
> > > > c:\def\ghij;k:\lm;
> > > > 
> > > > 
> > > > Should some attempt be made to convert '\' to '/' before running 
> > > > autoconf 
> > > > or configure,
> > > 
> > > That's what I'd do, yes.
> > > 
> > > In fact, I'd go further and insist on a PATH that conforms to POSIX,
> > > and uses ":" as a separator.  
> 
> ':' can't be used as a path seperator because it is used to designate 
> drive letters.

Which is why DJGPP and cygwin don't use DOS drivespecs.
Cygwin turns "c:\bin;d:\dos" into "/cygdrive/c/bin:/cygdrive/d/dos".
DJGPP turns it into "/dev/c/bin:/dev/d/dos".

The C library then turns that back if any access are made; and DJGPP's
bash undoes the change when running non-DJGPP programs.
And the entire change depends on a single envvar: PATH_SEPARATOR.  If
set to ';' a normal does path is used (though backslashes do get flipped
to avoid having escape sequences expanded), if it's ':' the above
/dev/ naming scheme is used.

> > > My understanding is that the better DOS
> > > development environments support that.  (Use one of those.  :-)
> 
> Are any of these 'better DOS development environments' available for OS/2?

DJGPP is, I think; unfortunately, it's limited to plain DOS mode (i.e.
8.3 filenames) under OS/2.  And I'm still in the process of testing to
see if autoconf behaves gracefully under 8+3 conditions.

> > I wouldn't go that far; autoconf currently supports ';' as pathsep
> > just fine.  And in "most" places, I think it also handles a \ as dirsep.
> > 
> > However, there will probably be places where a path is (accidentally)
> > echoed or passed unquoted (e.g. subdir configuration is one of those,
> > IIRC), causing the backslashes to be expanded as escaped characters.
> 
> I have just discovered that KSH interprets '\b' as a backspace, so when 
> attempting to convert c:\usr\bin, the result comes out as c:/usin. I'm 
> trying to work out the best way of dealing with this.

try something like

  PATH=`echo $PATH |tr '\\\\' '/'`

should work fine; if your echo is broken and expands escapes by default,
there's probably an option to inhibit it (seems like that's 'echo -E'
for ksh).

> > So while it _shouldn't_ be a problem (and any such problems should still
> > be posted here; if we can trivially support this, I believe we should),
> > I would indeed recommend flipping PATH slashes for autoconf (e.g. in
> > config.site).
> 
> I didn't think autoconf itself used config.site...

I didn't think autoconf itself had a problem; it's a perl script that
runs m4, so any issues are most likely a bug in the Perl/M4 ports and/or
the libc used (in the case of system() calls).
Any special handling would normally only be needed in configure scripts
produced by autoconf, not in autoconf itself.  So config.site is the
right place to do that.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]