make-w32
[Top][All Lists]
Advanced

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

Re: Fix for HAVE_DOS_PATHS build on cygwin


From: Eli Zaretskii
Subject: Re: Fix for HAVE_DOS_PATHS build on cygwin
Date: Fri, 18 Aug 2006 20:29:22 +0300

> Date: Thu, 17 Aug 2006 10:23:35 -0400
> From: Bill Hoffman <address@hidden>
> 
> At 11:40 PM 8/16/2006, Christopher Faylor wrote:
> 
> >I don't understand why isn't this just using the UNIX-ish settings for
> >Cygwin.  The settings should, at the very least, be the same as the
> >UNIX-sh case.
> 
> Because there was a bug where sh_chars_sh was being directly referenced if
> HAVE_DOS_PATHS was on.

No, Chris is right here, Bill: the Cygwin port should pick up the
regular Unix-ish section; the only thing we need to change is to add a
small HAVE_DOS_PATHS gork _inside_ the Unix-ish section.  This is what
I did in the patch that I promised to publish shortly.

> diff -p make381orig/make-3.81/config.h.in make-3.81/config.h.in
> *** make381orig/make-3.81/config.h.in   Sat Apr  1 01:40:00 2006
> --- make-3.81/config.h.in       Wed Aug 16 16:31:10 2006
> ***************
> *** 75,80 ****
> --- 75,84 ----
> 
>   /* Use platform specific coding */
>   #undef HAVE_DOS_PATHS
> + #ifdef __CYGWIN__
> + #define HAVE_DOS_PATHS 1
> + #endif
> +

We cannot patch config.h.in, it's a generated file.

> diff -p make381orig/make-3.81/job.c make-3.81/job.c
> *** make381orig/make-3.81/job.c Sun Mar 19 22:03:04 2006
> --- make-3.81/job.c     Thu Aug 17 10:06:24 2006
> *************** construct_command_argv_internal (char *l
> *** 2521,2527 ****
>   #endif
>                     if (p[1] != '\\' && p[1] != '\''
>                         && !isspace ((unsigned char)p[1])
> !                       && strchr (sh_chars_sh, p[1]) == 0)
>                       /* back up one notch, to copy the backslash */
>                       --p;
>   #endif  /* HAVE_DOS_PATHS */
> --- 2521,2527 ----
>   #endif
>                     if (p[1] != '\\' && p[1] != '\''
>                         && !isspace ((unsigned char)p[1])
> !                       && strchr (sh_chars, p[1]) == 0)
>                       /* back up one notch, to copy the backslash */
>                       --p;
>   #endif  /* HAVE_DOS_PATHS */

Chris is right here as well: the original code uses sh_chars_sh on
purpose, and this comment explains why:

       /* Only remove backslashes before characters special to Unixy
          shells. ....

That is, even if the shell is NOT sh.exe (in which case sh_chars does
NOT reference sh_chars_sh[]), we want to remove a backslash if the
character after it appears in sh_chars_sh[].

So this part of the patch is unnecessary.

> diff -p make381orig/make-3.81/make.h make-3.81/make.h
> *** make381orig/make-3.81/make.h        Wed Feb 15 18:54:43 2006
> --- make-3.81/make.h    Thu Aug 17 10:10:39 2006
> *************** extern int strcmpi (const char *,const c
> *** 347,353 ****
>   #define S_(msg1,msg2,num)   ngettext (msg1,msg2,num)
> 
>   /* Handle other OSs.  */
> ! #if defined(HAVE_DOS_PATHS)
>   # define PATH_SEPARATOR_CHAR ';'
>   #elif defined(VMS)
>   # define PATH_SEPARATOR_CHAR ','
> --- 347,353 ----
>   #define S_(msg1,msg2,num)   ngettext (msg1,msg2,num)
> 
>   /* Handle other OSs.  */
> ! #if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__)
>   # define PATH_SEPARATOR_CHAR ';'
>   #elif defined(VMS)
>   # define PATH_SEPARATOR_CHAR ','

I think it's cleaner to do this as Chris suggested, so I will rework
this part and publish it together with the other changes in a short
while.

> Can someone help with the correct way in configure.in to change,
> the following in configure.in to set HAVE_DOS_PATHS to 1 when on cygwin?
> 
> # If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
> if test "$PATH_SEPARATOR" = ';'; then
>   AC_DEFINE(HAVE_DOS_PATHS, 1,
>             [Define this if your system requires backslashes or drive specs 
> in pathnames.])
> fi

I will try to come up with a suitable test.




reply via email to

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