make-w32
[Top][All Lists]
Advanced

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

Re: FWD: HAVE_CASE_INSENSITIVE_FS


From: Hartmut Becker
Subject: Re: FWD: HAVE_CASE_INSENSITIVE_FS
Date: Fri, 08 Jan 2010 13:15:38 +0100
User-agent: Mozilla/5.0 (X11; U; OpenVMS Digital_Personal_WorkStation_; en-US; rv:1.5) Gecko/20040116

The problems are a "rebuild problem" and a "suffixes problem".

The "rebuild problem" shows on VMS with 3.81.90 without my recent patch; it does not show with 3.81: A newer source file is not found because of a case mismatch. My patch is VMS specific but I think the problem is in all HAVE_CASE_INSENSITIVE_FS code. My change downcases the file names, but the idea in 3.81.90 is to do case independent string compares. So in theory downcasing shouldn't be necessary.

The "suffixes problem" shows on VMS with 3.81 and newer versions. I think there was a bug in the VMS code. I detected it after I sent my patches for the rebuild problem. It seems, if I fix the VMS bug 3.81 should work, but not 3.81.90 and any newer version. I also think that if the suffix problem was not in other (non-VMS) HAVE_CASE_INSENSITIVE_FS code, it will show in 3.81.90 and any newer version. It seems to be an effect of case independent string compares. I didn't take the time to verify all of this.

Anyway, to show the problems I took a CVS snapshot and replaced dir.c with the previous version, the one without my changes to fix the "rebuild problem".See the appended logs and comments (>>>).

On the other hand, I agree, downcasing the shown action line will be OK for VMS, but not for other HAVE_CASE_INSENSITIVE_FS code.

Eli Zaretskii wrote:
From: Paul Smith <address@hidden>
Cc: address@hidden, address@hidden
Date: Thu, 31 Dec 2009 16:08:29 -0500

The patches Hartmut sent in I've already applied to CVS, a month or so
ago.  Any extra bits he mentions here (changes to strcmp etc. to make
things work) have not had patches sent along yet (he's just described
the changes).  Maybe he can forward the changes he made as a patch.


So if the bulk of the changes were already applied, what are the
remaining problems, exactly?

The rebuild problem

$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for VMS
$ 

$ make 
copy config.h-vms config.h
cc /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for
_file=alloc_var_expand_for_file") /include=([],[.glob])/prefix=(all,except=(glob
,globfree))/standard=relaxed/warn=(disable=questcompare)/obj=commands.obj comman
ds.c
cc /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for
_file=alloc_var_expand_for_file") /include=([],[.glob])/prefix=(all,except=(glob
,globfree))/standard=relaxed/warn=(disable=questcompare)/obj=job.obj job.c
cc /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for
_file=alloc_var_expand_for_file") /include=([],[.glob])/prefix=(all,except=(glob
,globfree))/standard=relaxed/warn=(disable=questcompare)/obj=dir.obj dir.c

    name = vmsify (name,1);
...................^
%CC-W-NOTCONSTQUAL, In this statement, the referenced type of the pointer value 
"name" is const, but the referenced type of the target of this assignment is 
not.
at line number 437 in file USER5:[beckerh.TMP.MAKE]dir.c;1
    
      r = vmsstat_dir (name, &st);
.......................^
%CC-W-NOTCONSTQUAL, In this statement, the referenced type of the pointer value 
"name" is const, but the referenced type of the target of this assignment is 
not.
at line number 458 in file USER5:[beckerh.TMP.MAKE]dir.c;1

  filename = vmsify (filename,0);
.....................^
%CC-W-NOTCONSTQUAL, In this statement, the referenced type of the pointer value 
"filename" is const, but the referenced type of the target of this assignment is
not.
at line number 610 in file USER5:[beckerh.TMP.MAKE]dir.c;1
   
  filename = vmsify (p, 1);
  .....................^
%CC-W-NOTCONSTQUAL, In this statement, the referenced type of the pointer value 
"p" is const, but the referenced type of the target of this assignment is not.
at line number 958 in file USER5:[beckerh.TMP.MAKE]dir.c;1
cc /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for
_file=alloc_var_expand_for_file") /include=([],[.glob])/prefix=(all,except=(glob
,globfree))/standard=relaxed/warn=(disable=questcompare)/obj=file.obj file.c

>>> The compiler warnings are fixed with my change.
>>> Some of the shown actions are remove, here, until:

cc /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for
_file=alloc_var_expand_for_file") /include=([],[.glob])/prefix=(all,except=(glob
,globfree))/standard=relaxed/warn=(disable=questcompare)/obj=[.glob]glob.obj [.g
lob]glob.c
cc /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for
_file=alloc_var_expand_for_file") /include=([],[.glob])/prefix=(all,except=(glob
,globfree))/standard=relaxed/warn=(disable=questcompare)/obj=[.glob]fnmatch.obj 
[.glob]fnmatch.c
link/exe=make.exe commands.obj,job.obj,dir.obj,file.obj,misc.obj,hash.obj,main.o
bj,read.obj,remake.obj,rule.obj,implicit.obj,default.obj,variable.obj,expand.obj
,function.obj,strcache.obj,vpath.obj,version.obj,ar.obj,arscan.obj,signame.obj,r
emote-stub.obj,vmsfunctions.obj,vmsify.obj,getopt.obj,getopt1.obj,[.glob]glob.ob
j,[.glob]fnmatch.obj
%ILINK-W-COMPWARN, compilation warnings
        module: DIR 
        file: USER5:[beckerh.TMP.MAKE]DIR.OBJ;1 
$

>>> The linker warning reflects the compiler warning.

$ rename make.exe new_make
$ new_make -v
GNU Make 3.81.90-y
Built for VMS
Copyright (C) 2009  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$

>>> The GNU make version with -y is mine.

$ rena dir.c ;

>>> This rename is like a 'touch'.

$ make -n
cc /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for
_file=alloc_var_expand_for_file") /include=([],[.glob])/prefix=(all,except=(glob
,globfree))/standard=relaxed/warn=(disable=questcompare)/obj=dir.obj dir.c
link/exe=make.exe commands.obj,job.obj,dir.obj,file.obj,misc.obj,hash.obj,main.o
bj,read.obj,remake.obj,rule.obj,implicit.obj,default.obj,variable.obj,expand.obj
,function.obj,strcache.obj,vpath.obj,version.obj,ar.obj,arscan.obj,signame.obj,r
emote-stub.obj,vmsfunctions.obj,vmsify.obj,getopt.obj,getopt1.obj,[.glob]glob.ob
j,[.glob]fnmatch.obj
$

>>> 3.81 sees the changed dir.c and actions are "compile dir.c and link".

$ new_make -n
link/exe=make.exe COMMANDS.OBJ,JOB.OBJ,DIR.OBJ,FILE.OBJ,misc.obj,HASH.OBJ,MAIN.O
BJ,read.obj,remake.obj,rule.obj,IMPLICIT.OBJ,DEFAULT.OBJ,variable.obj,EXPAND.OBJ
,FUNCTION.OBJ,strcache.obj,vpath.obj,version.obj,AR.OBJ,ARSCAN.OBJ,signame.obj,r
emote-stub.obj,vmsfunctions.obj,vmsify.obj,GETOPT.OBJ,GETOPT1.OBJ,[.glob]glob.ob
j,[.glob]fnmatch.obj
$

>>> The new make doesn't see the change and only links (because I renamed 
>>> make.exe).

$ dir misc.obj

Directory USER5:[beckerh.TMP.MAKE]

MISC.OBJ;1          

Total of 1 file.
$ 

>>> The action line prints a lowercase "misc.obj", although in the directory is 
>>> an uppercase
"MISC.OBJ".
>>> The object names are in mixed cases with no obvious pattern: actually, in 
>>> the directory all
object files are in uppercase and in the makefile all object files are in 
lowercase.

>>> My change to fix this are in conditional code (at the end of the diff
output, at the beginning are the changes to fix the compiler warnings): 

*** dir.c-1.68  Thu Jan  7 23:08:42 2010
--- dir.c-1.69  Thu Jan  7 23:08:24 2010
***************
*** 23,29 ****
  # include <dirent.h>
  # define NAMLEN(dirent) strlen((dirent)->d_name)
  # ifdef VMS
! char *vmsify (char *name, int type);
  # endif
  #else
  # define dirent direct
--- 23,30 ----
  # include <dirent.h>
  # define NAMLEN(dirent) strlen((dirent)->d_name)
  # ifdef VMS
! /* its prototype is in vmsdir.h, which is not needed for HAVE_DIRENT_H */
! const char *vmsify (const char *name, int type);
  # endif
  #else
  # define dirent direct
***************
*** 145,151 ****
  #ifdef VMS
  
  static int
! vms_hash (char *name)
  {
    int h = 0;
    int g;
--- 146,152 ----
  #ifdef VMS
  
  static int
! vms_hash (const char *name)
  {
    int h = 0;
    int g;
***************
*** 171,177 ****
  
  /* fake stat entry for a directory */
  static int
! vmsstat_dir (char *name, struct stat *st)
  {
    char *s;
    int h;
--- 172,178 ----
  
  /* fake stat entry for a directory */
  static int
! vmsstat_dir (const char *name, struct stat *st)
  {
    char *s;
    int h;
***************
*** 184,189 ****
--- 185,191 ----
    s = strchr (name, ':');       /* find device */
    if (s)
      {
+       /* to keep the compiler happy we said "const char *name", now we cheat 
*/
        *s++ = 0;
        st->st_dev = (char *)vms_hash (name);
        h = vms_hash (s);
***************
*** 192,199 ****
    else
      {
        st->st_dev = 0;
!       s = name;
!       h = vms_hash (s);
      }
  
    st->st_ino[0] = h & 0xff;
--- 194,200 ----
    else
      {
        st->st_dev = 0;
!       h = vms_hash (name);
      }
  
    st->st_ino[0] = h & 0xff;
***************
*** 449,455 ****
--- 450,460 ----
  
        p = name + strlen (name);
        dir = xmalloc (sizeof (struct directory));
+ #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+       dir->name = strcache_add_len (downcase(name), p - name);
+ #else
        dir->name = strcache_add_len (name, p - name);
+ #endif
        hash_insert_at (&directories, dir, dir_slot);
        /* The directory is not in the name hash table.
           Find its device and inode numbers, and look it up by them.  */
***************
*** 706,712 ****
--- 711,721 ----
  #endif
          {
            df = xmalloc (sizeof (struct dirfile));
+ #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+           df->name = strcache_add_len (downcase(d->d_name), len);
+ #else
            df->name = strcache_add_len (d->d_name, len);
+ #endif
            df->length = len;
            df->impossible = 0;
            hash_insert_at (&dir->dirfiles, df, dirfile_slot);
***************
*** 880,886 ****
--- 889,899 ----
  
    new = xmalloc (sizeof (struct dirfile));
    new->length = strlen (filename);
+ #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+   new->name = strcache_add_len (downcase(filename), new->length);
+ #else
    new->name = strcache_add_len (filename, new->length);
+ #endif
    new->impossible = 1;
    hash_insert (&dir->contents->dirfiles, new);
  }


The .SUFFIXES problem

address@hidden:~/tmp$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i486-pc-linux-gnu
address@hidden:~/tmp$ cat Makefile 
.SUFFIXES:
.SUFFIXES: .no .yes
.yes.no:
        echo $@: $<
all: which.no
address@hidden:~/tmp$ make -n
echo which.no: which.yes
address@hidden:~/tmp$ cat M
.suffixes:
.suffixes: .no .yes
.yes.no:
        echo $@: $<
all: which.no
address@hidden:~/tmp$ make -nf M
make: *** No rule to make target `which.no', needed by `all'.  Stop.
address@hidden:~/tmp$ 

$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for VMS
$

$ type makefile.vms
.SUFFIXES:
.SUFFIXES: .no .yes
.yes.no:
        write sys$$output "$@: $<
all: which.no
$
$ make -n
write sys$output "which.no: which.yes
$ 

$ type m.          
.suffixes:
.suffixes: .no .yes
.yes.no:
        write sys$$output "$@: $<
all: which.no
$
$ make -nf m
write sys$output "which.no: which.yes
$ 

reply via email to

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