Makefile: update defaults for modern Cygwin
PATCH 1/1 Makefile: update defaults for modern Cygwin
Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5 is no longer actively supported by the Cygwin mailing lists, we might as well update the defaults to cater to those new features.
NO_TRUSTABLE_FILEMODE is only necessary on FAT drives; the Cygwin community recommends NTFS drives, but there is still too much use for FAT to switch the default. Likewise, UNRELIABLE_FSTAT is probably file-system specific, but worth keeping unchanged.
This commit does not change the default for NO_MMAP, although definitive proof of whether this option is necessary is lacking.
--- Makefile | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-)
Makefile +12 -10
@@ -34,7 +34,7 @@ all:: # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. # # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks -# d_type in struct dirent (latest Cygwin -- will be fixed soonish). +# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7). # # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) # do not support the 'size specifiers' introduced by C99, namely ll, hh,
@@ -109,7 +109,7 @@ all:: # Define NO_PTHREADS if you do not have or do not want to use Pthreads. # # Define NO_PREAD if you have a problem with pread() system call (e.g. -# cygwin.dll before v1.5.22). +# cygwin1.dll before v1.5.22). # # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is # generally faster on your platform than accessing the working directory.
@@ -831,22 +831,24 @@ ifeq ($(uname_S),SunOS) BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H endif ifeq ($(uname_O),Cygwin) - NO_D_TYPE_IN_DIRENT = YesPlease - NO_D_INO_IN_DIRENT = YesPlease - NO_STRCASESTR = YesPlease - NO_MEMMEM = YesPlease - NO_MKSTEMPS = YesPlease - NO_SYMLINK_HEAD = YesPlease + ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7) + NO_D_TYPE_IN_DIRENT = YesPlease + NO_D_INO_IN_DIRENT = YesPlease + NO_STRCASESTR = YesPlease + NO_MEMMEM = YesPlease + NO_MKSTEMPS = YesPlease + NO_SYMLINK_HEAD = YesPlease + NO_IPV6 = YesPlease + OLD_ICONV = UnfortunatelyYes + endif NEEDS_LIBICONV = YesPlease NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes NO_TRUSTABLE_FILEMODE = UnfortunatelyYes - OLD_ICONV = UnfortunatelyYes NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease # There are conflicting reports about this. # On some boxes NO_MMAP is needed, and not so elsewhere. # Try commenting this out if you suspect MMAP is more efficient NO_MMAP = YesPlease - NO_IPV6 = YesPlease X = .exe COMPAT_OBJS += compat/cygwin.o UNRELIABLE_FSTAT = UnfortunatelyYes
Signature · 1 line
1.6.6.1
Quoted 9 lines · Eric Blake
Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5 is no longer actively supported by the Cygwin mailing lists, we might as well update the defaults to cater to those new features.
NO_TRUSTABLE_FILEMODEis only necessary on FAT drives; the Cygwin community recommends NTFS drives, but there is still too much use for FAT to switch the default. Likewise,UNRELIABLE_FSTATis probably file-system specific, but worth keeping unchanged.
Quoted 4 lines
This commit does not change the default for
NO_MMAP, although definitive proof of whether this option is necessary is lacking.Signed-off-by Eric Blake <[email protected]>
Thanks; as I lack Cygwin environment to test this myself, I'll apply this directly on 'master' and see if anybody screams ;-)
Makefile ifeq ($(uname_S),SunOS) · line 834
Quoted 1 line
Makefile +1
-0+ ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)
Do we need to update this part when Cygwin 1.8 is released? Replacing this with "ifeq(... ,1 5)" may not be an improvement either, unless we are sure that nobody is using 1.4 or older, but I wonder if somebody else have better ideas?
Quoted 2 lines · Junio C Hamano
Thanks; as I lack Cygwin environment to test this myself, I'll apply this directly on 'master' and see if anybody screams ;-)
Thanks.
Quoted 4 lines
Makefile ifeq ($(uname_S),SunOS) · line 834
Quoted 2 lines
Makefile +1
-0+ ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7)Do we need to update this part when Cygwin 1.8 is released?
Odd numbers are public cygwin releases (1.5, 1.7), even numbers are Red Hat releases (1.6, 1.8), so cygwin 1.8 already does exist for Red Hat licensed customers. It will probably be years before cygwin 1.9/1.10 exists, at which point 1.5/1.6 will be such a distant memory that we could just delete this block altogether at that time.
Quoted 4 lines
Replacing
this with "ifeq(... ,1 5)" may not be an improvement either, unless we are sure that nobody is using 1.4 or older, but I wonder if somebody else have better ideas?
Nothing short of using $(shell) and doing some actual computation on the string in $(uname_R). But that's not too hard, if people think it's worth it; speak up if you want me to rework it along those lines, otherwise I'll assume that things are good enough as-is.
Signature · 2 lines
Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Quoted 11 lines · Eric Blake
Quoted 4 lines · Junio C Hamano
Replacing
this with "ifeq(... ,1 5)" may not be an improvement either, unless we are sure that nobody is using 1.4 or older, but I wonder if somebody else have better ideas?Nothing short of using $(shell) and doing some actual computation on the string in $(uname_R). But that's not too hard, if people think it's worth it; speak up if you want me to rework it along those lines, otherwise I'll assume that things are good enough as-is.
Red Hat internal people might want to be able to use 1.8 when it comes out. Maybe something like this would do the trick? I don’t know whether Cygwin 1.6 has the fixes 1.7 does, so in my ignorance I lumped it with 1.5.
What you sent is probably good enough already; just trying to avoid future work.
-- %< --
Subject: Makefile: future-proof Cygwin version check
Tweak the condition that detects old Cygwin versions to not include versions such as 1.8, 1.11, and 2.1.
---
Makefile +1 -1
@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS) BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H endif ifeq ($(uname_O),Cygwin) - ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7) + ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4) NO_D_TYPE_IN_DIRENT = YesPlease NO_D_INO_IN_DIRENT = YesPlease NO_STRCASESTR = YesPlease
Quoted 4 lines · Jonathan Nieder
Red Hat internal people might want to be able to use 1.8 when it comes out. Maybe something like this would do the trick? I don’t know whether Cygwin 1.6 has the fixes 1.7 does, so in my ignorance I lumped it with 1.5.
Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the last old version is correct.
Makefile ifeq ($(uname_S),SunOS) · line 834
Quoted 6 lines
Makefile +1
-1@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS) BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H endif ifeq ($(uname_O),Cygwin) - ifneq ($(wordlist 1, 2, $(subst ., ,$(uname_R))),1 7) + ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4)
It would be nice to use fewer processes, since forking is so expensive on cygwin:
ifeq ($(shell case '$(uname_R)' in 1.[1-6].*) echo old;; esac),old)
But does that work to have unbalanced ) in a makefile $(shell)? On the other hand, this is already in a chunk guarded by $(uname_S) being cygwin, and we know that cygwin shells understand:
ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
even though it is not portable to other shells, like Solaris /bin/sh.
Signature · 2 lines
Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
Quoted 2 lines · Eric Blake
Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the last old version is correct.
Thanks for explaining.
Quoted 1 line
ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
Looks good to me.
While I have your attention, do you know of a simple way to test Cygwin programs under Linux? setup.exe does not work well under wine, so I am asking mostly in the hope that there is a .tar.gz or .zip binary distribution somewhere I could play with.
Thanks,
Jonathan
Quoted 10 lines · Jonathan Nieder
Quoted 2 lines · Eric Blake
Cygwin 1.6 is on par with 1.5 feature-wise, so your cutoff of 1.6 as the last old version is correct.
Thanks for explaining.
Quoted 1 line
ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
Looks good to me.
Junio mentioned he had already queued your first version of the patch; are you going to re-submit it with this tweak?
Quoted 5 lines
While I have your attention, do you know of a simple way to test Cygwin programs under Linux? setup.exe does not work well under wine, so I am asking mostly in the hope that there is a .tar.gz or .zip binary distribution somewhere I could play with.
Sadly, the fact that wine is not yet able to run setup.exe is evidence that wine is still lacking some emulation abilities, and while I am aware that the situation is trying to be improved, I am not actively participating in that effort. For now, I am only aware of the ability to run cygwin on native windows boxes (including virtual machines). In fact, I'm currently using a 240-day evaluation license of Windows Sever 2008 inside a VM to experiment with cygwin on my Linux box, without having spent any extra money.
Signature · 2 lines
Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
PATCH 1/1 Makefile: avoid a fork in Cygwin version check
From: Eric Blake <[email protected]>
It is nice to use fewer processes, since forking is so expensive on cygwin. So use a case statement instead of expr.
But does that work to have unbalanced ) in a makefile $(shell)? On the other hand, this is already in a chunk guarded by $(uname_S) being cygwin, and we know that cygwin shells understand:
case '$(uname_R)' in (1.[1-6].*) echo old;; esac
even though it is not portable to other shells, like NetBSD ash.
---
Quoted 3 lines · Eric Blake
Quoted 3 lines
Quoted 1 line · Eric Blake
ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
[...]
Quoted 2 lines
Junio mentioned he had already queued your first version of the patch; are you going to re-submit it with this tweak?
Since the patch to future-proof the version check has already hit master, here’s the change as an independent patch against master.
Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS) BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H endif ifeq ($(uname_O),Cygwin) - ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4) + ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old) NO_D_TYPE_IN_DIRENT = YesPlease NO_D_INO_IN_DIRENT = YesPlease NO_STRCASESTR = YesPlease
Signature · 1 line
1.7.0.3
Re: [PATCH] Makefile: avoid a fork in Cygwin version check
Makefile ifeq ($(uname_S),SunOS) · line 834
Quoted 10 lines · Jonathan Nieder
Makefile +1
-1@@ -831,7 +831,7 @@ ifeq ($(uname_S),SunOS) BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H endif ifeq ($(uname_O),Cygwin) - ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4) + ifeq ($(shell case '$(uname_R)' in (1.[1-6].*) echo old;; esac),old)
Even less forks:
ifneq ($(filter 1.1.% 1.2.% 1.3.% 1.4.% 1.5.% 1.6.%,$(uname_R)),)
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Thanks, will queue. By the way, please spell scissors as 8< or >8 not with a per-cent at least for now.
PATCH 1/1 Teach mailinfo %< as an alternative scissors mark
Handle perforations found “in the wild” more robustly by recognizing “%<” as an alternative scissors mark.
This feature is only meant to support old habits. Discourage new use of the percent-based version by only documenting the 8< symbol so new users’ perforations can still be recognized by old versions of Git.
---
Quoted 2 lines · Junio C Hamano
Thanks, will queue. By the way, please spell scissors as 8< or >8 not with a per-cent at least for now.
Thanks for pointing it out. I will from now on.
Searching for “cut here” on groups.google.com revealed several examples like this one:
______________________%<__cut here ______________>%_____________
[ed: dashes converted to underscores to avoid confusing am]
So I guess I’m the only one using the small-fingered scissors. Maybe this patch could help support old habits.
builtin/mailinfo.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
builtin/mailinfo.c +2 -1
@@ -746,7 +746,8 @@ static int is_scissors_line(const struct strbuf *line)continue ; }if (i +1 < len && - (!memcmp (buf + i,">8" ,2 ) || !memcmp (buf + i,"8<" ,2 ))) { + (!memcmp (buf + i,">8" ,2 ) || !memcmp (buf + i,"8<" ,2 ) || + !memcmp (buf + i,">%" ,2 ) || !memcmp (buf + i,"%<" ,2 ))) { in_perforation =1 ; perforation +=2 ; scissors +=2 ;
Signature · 1 line
1.7.0.3