Re: Windows patches for the next release
Eli Zaretskii <[email protected]> Tue, 01 Oct 2013 19:52:02 +0300
| Newsgroups | gmane.comp.gnu.make.windows |
|---|---|
| Message-ID | <[email protected]> |
> From: Paul Smith <[email protected]> > Cc: [email protected], [email protected], [email protected] > Date: Tue, 01 Oct 2013 01:08:32 -0400 > > On Mon, 2013-09-30 at 18:15 +0300, Eli Zaretskii wrote: > > I suggest another RC, I think the changes since the last one are > > non-trivial. > > OK, I created a new RC, available now on make-alpha. Thanks. It still builds fine on Windows using MinGW GCC. > I don't personally plan to make any more changes, so as soon as you feel > you're happy with the Windows support I will release. Here's the patch for $abspath that should fix the Cygwin build. Would Cygwin people please test it, and in particular see if the related failures in the test suite are gone? I don't have a Cygwin environment to even compile with Cygwin. I'd especially appreciate if Chris could at least eyeball the patch. Thanks in advance. Btw, Paul: I see that the sources don't consistently use STOP_SET where characters are tested for being directory separators; sometimes they actually test for both slashes and backslashes. Should we fix that throughout the sources? ======================================================================= --- function.c~0 2013-09-30 07:12:36.000000000 +0300 +++ function.c 2013-10-01 19:48:45.472000000 +0300 @@ -1949,8 +1949,12 @@ func_not (char *o, char **argv, char *fu #ifdef HAVE_DOS_PATHS -#define IS_ABSOLUTE(n) (n[0] && n[1] == ':') -#define ROOT_LEN 3 +# ifdef __CYGWIN__ +# define IS_ABSOLUTE(n) ((n[0] && n[1] == ':') || STOP_SET (n[0], MAP_PATHSEP)) +# else +# define IS_ABSOLUTE(n) (n[0] && n[1] == ':') +# endif +# define ROOT_LEN 3 #else #define IS_ABSOLUTE(n) (n[0] == '/') #define ROOT_LEN 1 @@ -2001,13 +2005,17 @@ abspath (const char *name, char *apath) } else { +#ifdef __CYGWIN__ + if (STOP_SET (name[0], MAP_PATHSEP)) + root_len = 1; +#endif strncpy (apath, name, root_len); apath[root_len] = '\0'; dest = apath + root_len; /* Get past the root, since we already copied it. */ name += root_len; #ifdef HAVE_DOS_PATHS - if (! STOP_SET (apath[2], MAP_PATHSEP)) + if (! STOP_SET (apath[root_len - 1], MAP_PATHSEP)) { /* Convert d:foo into d:./foo and increase root_len. */ apath[2] = '.'; @@ -2018,7 +2026,7 @@ abspath (const char *name, char *apath) name--; } else - apath[2] = '/'; /* make sure it's a forward slash */ + apath[root_len - 1] = '/'; /* make sure it's a forward slash */ #endif }