This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.
On Fri, 26 Feb 1999, you wrote:
>> Thanks for pointing this. There are other places as well. The problem is
>> the following: Cygwin gcc needs to support '\' for a variety of reasons,
>> but we would like it to produce only '/' in (eg., in the pre-processed
>> output or in the dependency output). The way dir separator is handled in
>> GCC makes this a bit awkward to handle.
>
>DJGPP has a similiar problem. DJGPP still defines DIR_SEPARATOR
>to '\\'. But in the patches made in the DJGPP port of egcs,
>DIR_SEPARATOR_1 is defined as '/' and instances of
>DIR_SEPARATOR are changed to DIR_SEPARATOR_1. So
>essentially, backslashes are being converted to slashes. So the
>DJGPP port of egcs has patches that handle the problem, but probably
>not in a way acceptable to the egcs maintainers.
>
Defining only DIR_SEPARATOR to '\\' in M$-DOS or Windows based systems
has some nasty problems. Therefore I introduced for DJGPP one new
macro DIR_SEPARATOR_1 which is by default equal to DIR_SEPARATOR:
#ifndef DIR_SEPARATOR_1
#define DIR_SEPARATOR_1 DIR_SEPARATOR
#endif
in cccp.c and some other places.
DIR_SEPARATOR_1 was used instead of DIR_SEPARATOR in output of
dependencies and when generating output when such options as
gcc -print-file-name=... is used. So it was possible to ensure that:
- gcc fully support '\\' as directory separator when needed, but
'/' is used in output of compiler.
- this feature should be explicitly enabled. The default
dehaviour is unchanged. So nothing should be broken
Bad news about that is that I haven't sent patches for that and even worse:
haven't sent papers to FSF. So I only sent description of idea I used.
>> Any suggestions on how to handle it is more than welcome.
>
>I was going to propose a patch that for DJGPP, DIR_SEPARATOR be
>changed to '/' and define a new macro DIR_SEPARATOR_2 to '\\'. Then
>in gcc.c and in a few other places, instances of DIR_SEPARATOR_2
>would be changed to DIR_SEPARATOR. The patches would
>essentially a be rewrite of the DJGPP patches I mentioned. I don't see
>why the DIR_SEPARATOR_2 idea wouldn't also work for
>cygwin/mingw32 too.
Andris