[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FW: Win32 File Name Compares and Normalization
From: |
Rob Tulloh |
Subject: |
Re: FW: Win32 File Name Compares and Normalization |
Date: |
Mon, 10 Sep 2001 12:01:38 -0500 |
>From the README.W32 that is my distribution:
> Pathnames and Case insensitivity:
>
> Unlike Unix, Windows 95/NT systems are case insensitive but case
> preserving. For example if you tell the file system to create a
> file named "Target", it will preserve the case. Subsequent access to
> the file with other case permutations will succeed (i.e. opening a
> file named "target" or "TARGET" will open the file "Target").
>
> By default, GNU make retains its case sensitivity when comparing target
> names and existing files or directories. It can be configured, however,
> into a case preserving and case insensitive mode by adding a define
> for HAVE_CASE_INSENSITIVE_FS to config.h.W32.
>
> For example, the following makefile will create a file named Target
> in the directory subdir which will subsequently be used to satisfy
> the dependency of SUBDIR/DepTarget on SubDir/TARGET. Without
> HAVE_CASE_INSENSITIVE_FS configured, the dependency link will not be made:
>
> subdir/Target:
> touch $@
>
> SUBDIR/DepTarget: SubDir/TARGET
> cp $^ $@
>
> Reliance on this behavior also eliminates the ability of gmake to use
> case in comparison of matching rules. For example, it is not possible
> to set up a C++ rule using %.C : that is different than a C rule using
> %.c :. GNU make will consider these to be the same rule and will issue
> a warning.
>
I hope this is still in the README.W32 file we ship with GNU make!
Rob
Matthew Von-Maszewski wrote:
> ... argh! last line of the config.h, missed it. I will recompile and
> respond this afternoon ...
>
> -----Original Message-----
> From: Rob Tulloh [mailto:address@hidden
> Sent: Monday, September 10, 2001 12:37 PM
> To: Matthew Von-Maszewski
> Cc: address@hidden
> Subject: Re: FW: Win32 File Name Compares and Normalization
>
> I thought GNU make already had a compile-time feature to
> enable case insensitivity. Did you try this and find it didn't work
> for you?
>
> There are users on both sides of the fence so any
> work to enable this should be put under a feature test macro
> that can be turned on or off.
>
> My $.02,
>
> Rob
>
> Matthew Von-Maszewski wrote:
>
> > Per Paul Smith, I am forwarding this email to this group for comments ...
> >
> > -----Original Message-----
> > From: Matthew Von-Maszewski [mailto:address@hidden
> > Sent: Monday, September 10, 2001 12:05 PM
> > To: address@hidden
> > Subject: Win32 File Name Compares and Normalization
> >
> > Greetings,
> >
> > I have been doing extensive work with GNU make and Microsoft's compiler.
> > This includes creating a dependency generator similar the gcc's .d files.
> > It has become obvious that a couple of the make's functions need to become
> > case insensitive when on a Win 32 platform. Microsoft's file names are
> > internally considered to be case insensitive for its file operations and
> > matching.
> >
> > I have listed the changes below that I found sufficient to create
> normalized
> > filenames (all lowercase) and to remove case sensitive compares (this
> needs
> > a cleaner implementation).
> >
> > [My dependency generator depends upon a preprocessor dump from Microsoft's
> > compiler. Depending upon the command line options, sometimes the
> > preprocessor normalizes all file names to lower case (e.g. /ZI option).
> > Other times case is left as found in the file system. Lovely.]
> >
> > All changes are against the version 3.79.1 download.
> >
> > Would you please consider this change request?
> >
> > Thank you,
> > Matthew
> >
> > Index: glob/fnmatch.c
> > ===================================================================
> > RCS file: /home/cvsroot/gnumake/glob/fnmatch.c,v
> > retrieving revision 1.1.1.1
> > retrieving revision 1.2
> > diff -c -r1.1.1.1 -r1.2
> > *** glob/fnmatch.c 2001/09/10 15:33:48 1.1.1.1
> > --- glob/fnmatch.c 2001/09/10 15:37:35 1.2
> > ***************
> > *** 168,174 ****
> > # ifdef _LIBC
> > # define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
> > # else
> > ! # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) :
> > (c))
> > # endif
> >
> > while ((c = *p++) != '\0')
> > --- 168,176 ----
> > # ifdef _LIBC
> > # define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
> > # else
> > ! /*# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c)
> :
> > (c)
> > )*/
> > ! /* mev */
> > ! # define FOLD(c) ( ISUPPER (c) ? tolower (c) : (c))
> > # endif
> >
> > Index: w32/pathstuff.c
> > ===================================================================
> > RCS file: /home/cvsroot/gnumake/w32/pathstuff.c,v
> > retrieving revision 1.1.1.1
> > retrieving revision 1.2
> > diff -c -r1.1.1.1 -r1.2
> > *** w32/pathstuff.c 2001/09/10 15:33:48 1.1.1.1
> > --- w32/pathstuff.c 2001/09/10 15:37:36 1.2
> > ***************
> > *** 80,85 ****
> > --- 80,87 ----
> > if (*p == '\\')
> > *p = '/';
> >
> > + /* mev */
> > + strlwr(w32_path);
> > return w32_path;
> > }
> >
> > cvs server: Diffing w32/compat
> > Index: w32/compat/dirent.c
> > ===================================================================
> > RCS file: /home/cvsroot/gnumake/w32/compat/dirent.c,v
> > retrieving revision 1.1.1.1
> > retrieving revision 1.2
> > diff -c -r1.1.1.1 -r1.2
> > *** w32/compat/dirent.c 2001/09/10 15:33:48 1.1.1.1
> > --- w32/compat/dirent.c 2001/09/10 15:37:36 1.2
> > ***************
> > *** 116,122 ****
> > /* fill in struct dirent values */
> > pDir->dir_sdReturn.d_ino = -1;
> > strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
> > !
> > return &pDir->dir_sdReturn;
> > }
> >
> > --- 116,123 ----
> > /* fill in struct dirent values */
> > pDir->dir_sdReturn.d_ino = -1;
> > strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
> > ! /* mev */
> > ! strlwr(pDir->dir_sdReturn.d_name);
> > return &pDir->dir_sdReturn;
> > }
> >
> > ======================
> > Matthew Von-Maszewski
> > address@hidden
> > 508-870-0118
> >
> > _______________________________________________
> > Make-w32 mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/make-w32
tulloh.vcf
Description: Card for Rob Tulloh