git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #26021 from corngood/cygwin-wip

Cygwin fixes

commitb686fd157062c9b738393c13b8c59f5685462fd2 authorJohn Ericson <Ericson2314@yahoo.com> dateMon 26 Jun 2017, 15:04 (9 years ago) parent358470763a1a2a
33 files changed+729−3702
lib/systems/inspect.nix+10−5 lib/systems/parse.nix+9−10 pkgs/applications/networking/browsers/w3m/cygwin.patch−1710 pkgs/applications/networking/browsers/w3m/default.nix+1−2 pkgs/build-support/cc-wrapper/default.nix+6 pkgs/build-support/setup-hooks/win-dll-link.sh+1−1 pkgs/development/interpreters/python/cpython/2.7/default.nix+7−5 pkgs/development/libraries/gdbm/default.nix+15−2 pkgs/development/libraries/gettext/default.nix+5−24 pkgs/development/libraries/glib/default.nix+2−2 pkgs/development/libraries/libiconv/default.nix+1−11 pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patch−269 pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patch−102 pkgs/development/libraries/libxslt/default.nix+7−1 pkgs/development/libraries/ncurses/default.nix+1−3 pkgs/development/libraries/openssl/1.0.1-cygwin64.patch−136 pkgs/development/libraries/openssl/default.nix−1 pkgs/development/libraries/zlib/default.nix+2 pkgs/development/libraries/zlib/disable-cygwin-widechar.patch+13 pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch+5−5 pkgs/development/tools/misc/help2man/default.nix+4−3 pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch+13 pkgs/development/tools/misc/pkgconfig/default.nix+1−1 pkgs/os-specific/linux/procps-ng/default.nix+1−1 pkgs/servers/gpm/default.nix+1−1 pkgs/shells/bash/4.4.nix+9−3 pkgs/shells/bash/cygwin-bash-4.3.33-1.src.patch−1393 pkgs/shells/bash/cygwin-bash-4.4.11-2.src.patch+607 pkgs/stdenv/cygwin/rebase-i686.sh+3−3 pkgs/stdenv/cygwin/rebase-x86_64.sh+3−3 pkgs/stdenv/native/default.nix+1−1 pkgs/tools/compression/gzip/default.nix−4 pkgs/top-level/perl-packages.nix+1
lib/systems/inspect.nix+10−5
@@ -1,8 +1,9 @@
11with import ./parse.nix;
22with import ../attrsets.nix;
3+with import ../lists.nix;
34
45rec {
5− patterns = {
6+ patterns = rec {
67 "32bit" = { cpu = { bits = 32; }; };
78 "64bit" = { cpu = { bits = 64; }; };
89 i686 = { cpu = cpuTypes.i686; };
@@ -13,8 +14,8 @@ rec {
1314 BigEndian = { cpu = { significantByte = significantBytes.bigEndian; }; };
1415 LittleEndian = { cpu = { significantByte = significantBytes.littleEndian; }; };
1516
16− Unix = { kernel = { families = { inherit (kernelFamilies) unix; }; }; };
1717 BSD = { kernel = { families = { inherit (kernelFamilies) bsd; }; }; };
18+ Unix = [ BSD Linux SunOS Hurd Cygwin ];
1819
1920 Darwin = { kernel = kernels.darwin; };
2021 Linux = { kernel = kernels.linux; };
@@ -27,11 +28,15 @@ rec {
2728 Cygwin = { kernel = kernels.windows; abi = abis.cygnus; };
2829 MinGW = { kernel = kernels.windows; abi = abis.gnu; };
2930
30− Arm32 = recursiveUpdate patterns.Arm patterns."32bit";
31− Arm64 = recursiveUpdate patterns.Arm patterns."64bit";
31+ Arm32 = recursiveUpdate Arm patterns."32bit";
32+ Arm64 = recursiveUpdate Arm patterns."64bit";
3233 };
3334
35+ matchAnyAttrs = patterns:
36+ if builtins.isList patterns then attrs: any (pattern: matchAttrs pattern attrs) patterns
37+ else matchAttrs patterns;
38+
3439 predicates = mapAttrs'
35− (name: value: nameValuePair ("is" + name) (matchAttrs value))
40+ (name: value: nameValuePair ("is" + name) (matchAnyAttrs value))
3641 patterns;
3742}
lib/systems/parse.nix+9−10
@@ -68,21 +68,20 @@ rec {
6868 isKernelFamily = isType "kernel-family";
6969 kernelFamilies = setTypes "kernel-family" {
7070 bsd = {};
71− unix = {};
7271 };
7372
7473 isKernel = x: isType "kernel" x;
7574 kernels = with execFormats; with kernelFamilies; setTypesAssert "kernel"
7675 (x: isExecFormat x.execFormat && all isKernelFamily (attrValues x.families))
7776 {
78− darwin = { execFormat = macho; families = { inherit unix; }; };
79− freebsd = { execFormat = elf; families = { inherit unix bsd; }; };
80− hurd = { execFormat = elf; families = { inherit unix; }; };
81− linux = { execFormat = elf; families = { inherit unix; }; };
82− netbsd = { execFormat = elf; families = { inherit unix bsd; }; };
83− none = { execFormat = unknown; families = { inherit unix; }; };
84− openbsd = { execFormat = elf; families = { inherit unix bsd; }; };
85− solaris = { execFormat = elf; families = { inherit unix; }; };
77+ darwin = { execFormat = macho; families = { }; };
78+ freebsd = { execFormat = elf; families = { inherit bsd; }; };
79+ hurd = { execFormat = elf; families = { }; };
80+ linux = { execFormat = elf; families = { }; };
81+ netbsd = { execFormat = elf; families = { inherit bsd; }; };
82+ none = { execFormat = unknown; families = { }; };
83+ openbsd = { execFormat = elf; families = { inherit bsd; }; };
84+ solaris = { execFormat = elf; families = { }; };
8685 windows = { execFormat = pe; families = { }; };
8786 } // { # aliases
8887 # TODO(@Ericson2314): Handle these Darwin version suffixes more generally.
@@ -164,7 +163,7 @@ rec {
164163 mkSystemFromString = s: mkSystemFromSkeleton (mkSkeletonFromList (lib.splitString "-" s));
165164
166165 doubleFromSystem = { cpu, vendor, kernel, abi, ... }:
167− if vendor == kernels.windows && abi == abis.cygnus
166+ if abi == abis.cygnus
168167 then "${cpu.name}-cygwin"
169168 else "${cpu.name}-${kernel.name}";
170169
pkgs/applications/networking/browsers/w3m/cygwin.patchdeleted−1710
@@ -1,1710 +0,0 @@
1−diff -ur w3m-0.5.3/config.guess new/w3m-0.5.3/config.guess
2−--- w3m-0.5.3/config.guess 2004-08-04 13:32:27.000000000 -0400
3−+++ w3m-0.5.3/config.guess 2013-04-28 18:43:59.480227700 -0400
4−@@ -1,13 +1,14 @@
5− #! /bin/sh
6− # Attempt to guess a canonical system name.
7− # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
8−-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
9−+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
10−+# 2011, 2012, 2013 Free Software Foundation, Inc.
11−
12−-timestamp='2004-03-12'
13−+timestamp='2012-12-29'
14−
15− # This file is free software; you can redistribute it and/or modify it
16− # under the terms of the GNU General Public License as published by
17−-# the Free Software Foundation; either version 2 of the License, or
18−+# the Free Software Foundation; either version 3 of the License, or
19− # (at your option) any later version.
20− #
21− # This program is distributed in the hope that it will be useful, but
22−@@ -16,24 +17,22 @@
23− # General Public License for more details.
24− #
25− # You should have received a copy of the GNU General Public License
26−-# along with this program; if not, write to the Free Software
27−-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28−+# along with this program; if not, see <http://www.gnu.org/licenses/>.
29− #
30− # As a special exception to the GNU General Public License, if you
31− # distribute this file as part of a program that contains a
32− # configuration script generated by Autoconf, you may include it under
33−-# the same distribution terms that you use for the rest of that program.
34−-
35−-# Originally written by Per Bothner <per@bothner.com>.
36−-# Please send patches to <config-patches@gnu.org>. Submit a context
37−-# diff and a properly formatted ChangeLog entry.
38−+# the same distribution terms that you use for the rest of that
39−+# program. This Exception is an additional permission under section 7
40−+# of the GNU General Public License, version 3 ("GPLv3").
41−+#
42−+# Originally written by Per Bothner.
43− #
44−-# This script attempts to guess a canonical system name similar to
45−-# config.sub. If it succeeds, it prints the system name on stdout, and
46−-# exits with 0. Otherwise, it exits with 1.
47−+# You can get the latest version of this script from:
48−+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
49− #
50−-# The plan is that this can be called by configure scripts if you
51−-# don't specify an explicit build system type.
52−+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
53−+
54−
55− me=`echo "$0" | sed -e 's,.*/,,'`
56−
57−@@ -53,8 +52,9 @@
58− GNU config.guess ($timestamp)
59−
60− Originally written by Per Bothner.
61−-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
62−-Free Software Foundation, Inc.
63−+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
64−+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
65−+2012, 2013 Free Software Foundation, Inc.
66−
67− This is free software; see the source for copying conditions. There is NO
68− warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
69−@@ -66,11 +66,11 @@
70− while test $# -gt 0 ; do
71− case $1 in
72− --time-stamp | --time* | -t )
73−- echo "$timestamp" ; exit 0 ;;
74−+ echo "$timestamp" ; exit ;;
75− --version | -v )
76−- echo "$version" ; exit 0 ;;
77−+ echo "$version" ; exit ;;
78− --help | --h* | -h )
79−- echo "$usage"; exit 0 ;;
80−+ echo "$usage"; exit ;;
81− -- ) # Stop option processing
82− shift; break ;;
83− - ) # Use stdin as input.
84−@@ -104,7 +104,7 @@
85− trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
86− trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
87− : ${TMPDIR=/tmp} ;
88−- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
89−+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
90− { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
91− { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
92− { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
93−@@ -123,7 +123,7 @@
94− ;;
95− ,,*) CC_FOR_BUILD=$CC ;;
96− ,*,*) CC_FOR_BUILD=$HOST_CC ;;
97−-esac ;'
98−+esac ; set_cc_for_build= ;'
99−
100− # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
101− # (ghazi@noc.rutgers.edu 1994-08-24)
102−@@ -141,7 +141,7 @@
103− case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
104− *:NetBSD:*:*)
105− # NetBSD (nbsd) targets should (where applicable) match one or
106−- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
107−+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
108− # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
109− # switched to ELF, *-*-netbsd* would select the old
110− # object file format. This provides both forward
111−@@ -158,6 +158,7 @@
112− arm*) machine=arm-unknown ;;
113− sh3el) machine=shl-unknown ;;
114− sh3eb) machine=sh-unknown ;;
115−+ sh5el) machine=sh5le-unknown ;;
116− *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
117− esac
118− # The Operating System including object format, if it has switched
119−@@ -166,7 +167,7 @@
120− arm*|i386|m68k|ns32k|sh3*|sparc|vax)
121− eval $set_cc_for_build
122− if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
123−- | grep __ELF__ >/dev/null
124−+ | grep -q __ELF__
125− then
126− # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
127− # Return netbsd for either. FIX?
128−@@ -176,7 +177,7 @@
129− fi
130− ;;
131− *)
132−- os=netbsd
133−+ os=netbsd
134− ;;
135− esac
136− # The OS release
137−@@ -196,71 +197,34 @@
138− # contains redundant information, the shorter form:
139− # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
140− echo "${machine}-${os}${release}"
141−- exit 0 ;;
142−- amd64:OpenBSD:*:*)
143−- echo x86_64-unknown-openbsd${UNAME_RELEASE}
144−- exit 0 ;;
145−- amiga:OpenBSD:*:*)
146−- echo m68k-unknown-openbsd${UNAME_RELEASE}
147−- exit 0 ;;
148−- arc:OpenBSD:*:*)
149−- echo mipsel-unknown-openbsd${UNAME_RELEASE}
150−- exit 0 ;;
151−- cats:OpenBSD:*:*)
152−- echo arm-unknown-openbsd${UNAME_RELEASE}
153−- exit 0 ;;
154−- hp300:OpenBSD:*:*)
155−- echo m68k-unknown-openbsd${UNAME_RELEASE}
156−- exit 0 ;;
157−- mac68k:OpenBSD:*:*)
158−- echo m68k-unknown-openbsd${UNAME_RELEASE}
159−- exit 0 ;;
160−- macppc:OpenBSD:*:*)
161−- echo powerpc-unknown-openbsd${UNAME_RELEASE}
162−- exit 0 ;;
163−- mvme68k:OpenBSD:*:*)
164−- echo m68k-unknown-openbsd${UNAME_RELEASE}
165−- exit 0 ;;
166−- mvme88k:OpenBSD:*:*)
167−- echo m88k-unknown-openbsd${UNAME_RELEASE}
168−- exit 0 ;;
169−- mvmeppc:OpenBSD:*:*)
170−- echo powerpc-unknown-openbsd${UNAME_RELEASE}
171−- exit 0 ;;
172−- pegasos:OpenBSD:*:*)
173−- echo powerpc-unknown-openbsd${UNAME_RELEASE}
174−- exit 0 ;;
175−- pmax:OpenBSD:*:*)
176−- echo mipsel-unknown-openbsd${UNAME_RELEASE}
177−- exit 0 ;;
178−- sgi:OpenBSD:*:*)
179−- echo mipseb-unknown-openbsd${UNAME_RELEASE}
180−- exit 0 ;;
181−- sun3:OpenBSD:*:*)
182−- echo m68k-unknown-openbsd${UNAME_RELEASE}
183−- exit 0 ;;
184−- wgrisc:OpenBSD:*:*)
185−- echo mipsel-unknown-openbsd${UNAME_RELEASE}
186−- exit 0 ;;
187−+ exit ;;
188−+ *:Bitrig:*:*)
189−+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
190−+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
191−+ exit ;;
192− *:OpenBSD:*:*)
193−- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
194−- exit 0 ;;
195−+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
196−+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
197−+ exit ;;
198− *:ekkoBSD:*:*)
199− echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
200−- exit 0 ;;
201−+ exit ;;
202−+ *:SolidBSD:*:*)
203−+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
204−+ exit ;;
205− macppc:MirBSD:*:*)
206−- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
207−- exit 0 ;;
208−+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
209−+ exit ;;
210− *:MirBSD:*:*)
211− echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
212−- exit 0 ;;
213−+ exit ;;
214− alpha:OSF1:*:*)
215− case $UNAME_RELEASE in
216− *4.0)
217− UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
218− ;;
219− *5.*)
220−- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
221−+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
222− ;;
223− esac
224− # According to Compaq, /usr/sbin/psrinfo has been available on
225−@@ -306,40 +270,46 @@
226− # A Xn.n version is an unreleased experimental baselevel.
227− # 1.2 uses "1.2" for uname -r.
228− echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
229−- exit 0 ;;
230−- Alpha*:OpenVMS:*:*)
231−- echo alpha-hp-vms
232−- exit 0 ;;
233−+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
234−+ exitcode=$?
235−+ trap '' 0
236−+ exit $exitcode ;;
237− Alpha\ *:Windows_NT*:*)
238− # How do we know it's Interix rather than the generic POSIX subsystem?
239− # Should we change UNAME_MACHINE based on the output of uname instead
240− # of the specific Alpha model?
241− echo alpha-pc-interix
242−- exit 0 ;;
243−+ exit ;;
244− 21064:Windows_NT:50:3)
245− echo alpha-dec-winnt3.5
246−- exit 0 ;;
247−+ exit ;;
248− Amiga*:UNIX_System_V:4.0:*)
249− echo m68k-unknown-sysv4
250−- exit 0;;
251−+ exit ;;
252− *:[Aa]miga[Oo][Ss]:*:*)
253− echo ${UNAME_MACHINE}-unknown-amigaos
254−- exit 0 ;;
255−+ exit ;;
256− *:[Mm]orph[Oo][Ss]:*:*)
257− echo ${UNAME_MACHINE}-unknown-morphos
258−- exit 0 ;;
259−+ exit ;;
260− *:OS/390:*:*)
261− echo i370-ibm-openedition
262−- exit 0 ;;
263−+ exit ;;
264−+ *:z/VM:*:*)
265−+ echo s390-ibm-zvmoe
266−+ exit ;;
267− *:OS400:*:*)
268−- echo powerpc-ibm-os400
269−- exit 0 ;;
270−+ echo powerpc-ibm-os400
271−+ exit ;;
272− arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
273− echo arm-acorn-riscix${UNAME_RELEASE}
274−- exit 0;;
275−+ exit ;;
276−+ arm*:riscos:*:*|arm*:RISCOS:*:*)
277−+ echo arm-unknown-riscos
278−+ exit ;;
279− SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
280− echo hppa1.1-hitachi-hiuxmpp
281−- exit 0;;
282−+ exit ;;
283− Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
284− # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
285− if test "`(/bin/universe) 2>/dev/null`" = att ; then
286−@@ -347,32 +317,51 @@
287− else
288− echo pyramid-pyramid-bsd
289− fi
290−- exit 0 ;;
291−+ exit ;;
292− NILE*:*:*:dcosx)
293− echo pyramid-pyramid-svr4
294−- exit 0 ;;
295−+ exit ;;
296− DRS?6000:unix:4.0:6*)
297− echo sparc-icl-nx6
298−- exit 0 ;;
299−- DRS?6000:UNIX_SV:4.2*:7*)
300−+ exit ;;
301−+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
302− case `/usr/bin/uname -p` in
303−- sparc) echo sparc-icl-nx7 && exit 0 ;;
304−+ sparc) echo sparc-icl-nx7; exit ;;
305− esac ;;
306−+ s390x:SunOS:*:*)
307−+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
308−+ exit ;;
309− sun4H:SunOS:5.*:*)
310− echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
311−- exit 0 ;;
312−+ exit ;;
313− sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
314− echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
315−- exit 0 ;;
316−- i86pc:SunOS:5.*:*)
317−- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
318−- exit 0 ;;
319−+ exit ;;
320−+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
321−+ echo i386-pc-auroraux${UNAME_RELEASE}
322−+ exit ;;
323−+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
324−+ eval $set_cc_for_build
325−+ SUN_ARCH="i386"
326−+ # If there is a compiler, see if it is configured for 64-bit objects.
327−+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
328−+ # This test works for both compilers.
329−+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
330−+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
331−+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
332−+ grep IS_64BIT_ARCH >/dev/null
333−+ then
334−+ SUN_ARCH="x86_64"
335−+ fi
336−+ fi
337−+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
338−+ exit ;;
339− sun4*:SunOS:6*:*)
340− # According to config.sub, this is the proper way to canonicalize
341− # SunOS6. Hard to guess exactly what SunOS6 will be like, but
342− # it's likely to be more like Solaris than SunOS4.
343− echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
344−- exit 0 ;;
345−+ exit ;;
346− sun4*:SunOS:*:*)
347− case "`/usr/bin/arch -k`" in
348− Series*|S4*)
349−@@ -381,10 +370,10 @@
350− esac
351− # Japanese Language versions have a version number like `4.1.3-JL'.
352− echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
353−- exit 0 ;;
354−+ exit ;;
355− sun3*:SunOS:*:*)
356− echo m68k-sun-sunos${UNAME_RELEASE}
357−- exit 0 ;;
358−+ exit ;;
359− sun*:*:4.2BSD:*)
360− UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
361− test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
362−@@ -396,10 +385,10 @@
363− echo sparc-sun-sunos${UNAME_RELEASE}
364− ;;
365− esac
366−- exit 0 ;;
367−+ exit ;;
368− aushp:SunOS:*:*)
369− echo sparc-auspex-sunos${UNAME_RELEASE}
370−- exit 0 ;;
371−+ exit ;;
372− # The situation for MiNT is a little confusing. The machine name
373− # can be virtually everything (everything which is not
374− # "atarist" or "atariste" at least should have a processor
375−@@ -409,41 +398,41 @@
376− # MiNT. But MiNT is downward compatible to TOS, so this should
377− # be no problem.
378− atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
379−- echo m68k-atari-mint${UNAME_RELEASE}
380−- exit 0 ;;
381−+ echo m68k-atari-mint${UNAME_RELEASE}
382−+ exit ;;
383− atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
384− echo m68k-atari-mint${UNAME_RELEASE}
385−- exit 0 ;;
386−+ exit ;;
387− *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
388−- echo m68k-atari-mint${UNAME_RELEASE}
389−- exit 0 ;;
390−+ echo m68k-atari-mint${UNAME_RELEASE}
391−+ exit ;;
392− milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
393−- echo m68k-milan-mint${UNAME_RELEASE}
394−- exit 0 ;;
395−+ echo m68k-milan-mint${UNAME_RELEASE}
396−+ exit ;;
397− hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
398−- echo m68k-hades-mint${UNAME_RELEASE}
399−- exit 0 ;;
400−+ echo m68k-hades-mint${UNAME_RELEASE}
401−+ exit ;;
402− *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
403−- echo m68k-unknown-mint${UNAME_RELEASE}
404−- exit 0 ;;
405−+ echo m68k-unknown-mint${UNAME_RELEASE}
406−+ exit ;;
407− m68k:machten:*:*)
408− echo m68k-apple-machten${UNAME_RELEASE}
409−- exit 0 ;;
410−+ exit ;;
411− powerpc:machten:*:*)
412− echo powerpc-apple-machten${UNAME_RELEASE}
413−- exit 0 ;;
414−+ exit ;;
415− RISC*:Mach:*:*)
416− echo mips-dec-mach_bsd4.3
417−- exit 0 ;;
418−+ exit ;;
419− RISC*:ULTRIX:*:*)
420− echo mips-dec-ultrix${UNAME_RELEASE}
421−- exit 0 ;;
422−+ exit ;;
423− VAX*:ULTRIX*:*:*)
424− echo vax-dec-ultrix${UNAME_RELEASE}
425−- exit 0 ;;
426−+ exit ;;
427− 2020:CLIX:*:* | 2430:CLIX:*:*)
428− echo clipper-intergraph-clix${UNAME_RELEASE}
429−- exit 0 ;;
430−+ exit ;;
431− mips:*:*:UMIPS | mips:*:*:RISCos)
432− eval $set_cc_for_build
433− sed 's/^ //' << EOF >$dummy.c
434−@@ -467,35 +456,36 @@
435− exit (-1);
436− }
437− EOF
438−- $CC_FOR_BUILD -o $dummy $dummy.c \
439−- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
440−- && exit 0
441−+ $CC_FOR_BUILD -o $dummy $dummy.c &&
442−+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
443−+ SYSTEM_NAME=`$dummy $dummyarg` &&
444−+ { echo "$SYSTEM_NAME"; exit; }
445− echo mips-mips-riscos${UNAME_RELEASE}
446−- exit 0 ;;
447−+ exit ;;
448− Motorola:PowerMAX_OS:*:*)
449− echo powerpc-motorola-powermax
450−- exit 0 ;;
451−+ exit ;;
452− Motorola:*:4.3:PL8-*)
453− echo powerpc-harris-powermax
454−- exit 0 ;;
455−+ exit ;;
456− Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
457− echo powerpc-harris-powermax
458−- exit 0 ;;
459−+ exit ;;
460− Night_Hawk:Power_UNIX:*:*)
461− echo powerpc-harris-powerunix
462−- exit 0 ;;
463−+ exit ;;
464− m88k:CX/UX:7*:*)
465− echo m88k-harris-cxux7
466−- exit 0 ;;
467−+ exit ;;
468− m88k:*:4*:R4*)
469− echo m88k-motorola-sysv4
470−- exit 0 ;;
471−+ exit ;;
472− m88k:*:3*:R3*)
473− echo m88k-motorola-sysv3
474−- exit 0 ;;
475−+ exit ;;
476− AViiON:dgux:*:*)
477−- # DG/UX returns AViiON for all architectures
478−- UNAME_PROCESSOR=`/usr/bin/uname -p`
479−+ # DG/UX returns AViiON for all architectures
480−+ UNAME_PROCESSOR=`/usr/bin/uname -p`
481− if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
482− then
483− if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
484−@@ -508,29 +498,29 @@
485− else
486− echo i586-dg-dgux${UNAME_RELEASE}
487− fi
488−- exit 0 ;;
489−+ exit ;;
490− M88*:DolphinOS:*:*) # DolphinOS (SVR3)
491− echo m88k-dolphin-sysv3
492−- exit 0 ;;
493−+ exit ;;
494− M88*:*:R3*:*)
495− # Delta 88k system running SVR3
496− echo m88k-motorola-sysv3
497−- exit 0 ;;
498−+ exit ;;
499− XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
500− echo m88k-tektronix-sysv3
501−- exit 0 ;;
502−+ exit ;;
503− Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
504− echo m68k-tektronix-bsd
505−- exit 0 ;;
506−+ exit ;;
507− *:IRIX*:*:*)
508− echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
509−- exit 0 ;;
510−+ exit ;;
511− ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
512−- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
513−- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
514−+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
515−+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
516− i*86:AIX:*:*)
517− echo i386-ibm-aix
518−- exit 0 ;;
519−+ exit ;;
520− ia64:AIX:*:*)
521− if [ -x /usr/bin/oslevel ] ; then
522− IBM_REV=`/usr/bin/oslevel`
523−@@ -538,7 +528,7 @@
524− IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
525− fi
526− echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
527−- exit 0 ;;
528−+ exit ;;
529− *:AIX:2:3)
530− if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
531− eval $set_cc_for_build
532−@@ -553,15 +543,19 @@
533− exit(0);
534− }
535− EOF
536−- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
537−- echo rs6000-ibm-aix3.2.5
538−+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
539−+ then
540−+ echo "$SYSTEM_NAME"
541−+ else
542−+ echo rs6000-ibm-aix3.2.5
543−+ fi
544− elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
545− echo rs6000-ibm-aix3.2.4
546− else
547− echo rs6000-ibm-aix3.2
548− fi
549−- exit 0 ;;
550−- *:AIX:*:[45])
551−+ exit ;;
552−+ *:AIX:*:[4567])
553− IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
554− if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
555− IBM_ARCH=rs6000
556−@@ -574,28 +568,28 @@
557− IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
558− fi
559− echo ${IBM_ARCH}-ibm-aix${IBM_REV}
560−- exit 0 ;;
561−+ exit ;;
562− *:AIX:*:*)
563− echo rs6000-ibm-aix
564−- exit 0 ;;
565−+ exit ;;
566− ibmrt:4.4BSD:*|romp-ibm:BSD:*)
567− echo romp-ibm-bsd4.4
568−- exit 0 ;;
569−+ exit ;;
570− ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
571− echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
572−- exit 0 ;; # report: romp-ibm BSD 4.3
573−+ exit ;; # report: romp-ibm BSD 4.3
574− *:BOSX:*:*)
575− echo rs6000-bull-bosx
576−- exit 0 ;;
577−+ exit ;;
578− DPX/2?00:B.O.S.:*:*)
579− echo m68k-bull-sysv3
580−- exit 0 ;;
581−+ exit ;;
582− 9000/[34]??:4.3bsd:1.*:*)
583− echo m68k-hp-bsd
584−- exit 0 ;;
585−+ exit ;;
586− hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
587− echo m68k-hp-bsd4.4
588−- exit 0 ;;
589−+ exit ;;
590− 9000/[34678]??:HP-UX:*:*)
591− HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
592− case "${UNAME_MACHINE}" in
593−@@ -604,52 +598,52 @@
594− 9000/[678][0-9][0-9])
595− if [ -x /usr/bin/getconf ]; then
596− sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
597−- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
598−- case "${sc_cpu_version}" in
599−- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
600−- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
601−- 532) # CPU_PA_RISC2_0
602−- case "${sc_kernel_bits}" in
603−- 32) HP_ARCH="hppa2.0n" ;;
604−- 64) HP_ARCH="hppa2.0w" ;;
605−+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
606−+ case "${sc_cpu_version}" in
607−+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
608−+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
609−+ 532) # CPU_PA_RISC2_0
610−+ case "${sc_kernel_bits}" in
611−+ 32) HP_ARCH="hppa2.0n" ;;
612−+ 64) HP_ARCH="hppa2.0w" ;;
613− '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
614−- esac ;;
615−- esac
616−+ esac ;;
617−+ esac
618− fi
619− if [ "${HP_ARCH}" = "" ]; then
620− eval $set_cc_for_build
621−- sed 's/^ //' << EOF >$dummy.c
622−+ sed 's/^ //' << EOF >$dummy.c
623−
624−- #define _HPUX_SOURCE
625−- #include <stdlib.h>
626−- #include <unistd.h>
627−-
628−- int main ()
629−- {
630−- #if defined(_SC_KERNEL_BITS)
631−- long bits = sysconf(_SC_KERNEL_BITS);
632−- #endif
633−- long cpu = sysconf (_SC_CPU_VERSION);
634−-
635−- switch (cpu)
636−- {
637−- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
638−- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
639−- case CPU_PA_RISC2_0:
640−- #if defined(_SC_KERNEL_BITS)
641−- switch (bits)
642−- {
643−- case 64: puts ("hppa2.0w"); break;
644−- case 32: puts ("hppa2.0n"); break;
645−- default: puts ("hppa2.0"); break;
646−- } break;
647−- #else /* !defined(_SC_KERNEL_BITS) */
648−- puts ("hppa2.0"); break;
649−- #endif
650−- default: puts ("hppa1.0"); break;
651−- }
652−- exit (0);
653−- }
654−+ #define _HPUX_SOURCE
655−+ #include <stdlib.h>
656−+ #include <unistd.h>
657−+
658−+ int main ()
659−+ {
660−+ #if defined(_SC_KERNEL_BITS)
661−+ long bits = sysconf(_SC_KERNEL_BITS);
662−+ #endif
663−+ long cpu = sysconf (_SC_CPU_VERSION);
664−+
665−+ switch (cpu)
666−+ {
667−+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
668−+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
669−+ case CPU_PA_RISC2_0:
670−+ #if defined(_SC_KERNEL_BITS)
671−+ switch (bits)
672−+ {
673−+ case 64: puts ("hppa2.0w"); break;
674−+ case 32: puts ("hppa2.0n"); break;
675−+ default: puts ("hppa2.0"); break;
676−+ } break;
677−+ #else /* !defined(_SC_KERNEL_BITS) */
678−+ puts ("hppa2.0"); break;
679−+ #endif
680−+ default: puts ("hppa1.0"); break;
681−+ }
682−+ exit (0);
683−+ }
684− EOF
685− (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
686− test -z "$HP_ARCH" && HP_ARCH=hppa
687−@@ -657,9 +651,19 @@
688− esac
689− if [ ${HP_ARCH} = "hppa2.0w" ]
690− then
691−- # avoid double evaluation of $set_cc_for_build
692−- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
693−- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
694−+ eval $set_cc_for_build
695−+
696−+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
697−+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
698−+ # generating 64-bit code. GNU and HP use different nomenclature:
699−+ #
700−+ # $ CC_FOR_BUILD=cc ./config.guess
701−+ # => hppa2.0w-hp-hpux11.23
702−+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
703−+ # => hppa64-hp-hpux11.23
704−+
705−+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
706−+ grep -q __LP64__
707− then
708− HP_ARCH="hppa2.0w"
709− else
710−@@ -667,11 +671,11 @@
711− fi
712− fi
713− echo ${HP_ARCH}-hp-hpux${HPUX_REV}
714−- exit 0 ;;
715−+ exit ;;
716− ia64:HP-UX:*:*)
717− HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
718− echo ia64-hp-hpux${HPUX_REV}
719−- exit 0 ;;
720−+ exit ;;
721− 3050*:HI-UX:*:*)
722− eval $set_cc_for_build
723− sed 's/^ //' << EOF >$dummy.c
724−@@ -699,224 +703,269 @@
725− exit (0);
726− }
727− EOF
728−- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
729−+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
730−+ { echo "$SYSTEM_NAME"; exit; }
731− echo unknown-hitachi-hiuxwe2
732−- exit 0 ;;
733−+ exit ;;
734− 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
735− echo hppa1.1-hp-bsd
736−- exit 0 ;;
737−+ exit ;;
738− 9000/8??:4.3bsd:*:*)
739− echo hppa1.0-hp-bsd
740−- exit 0 ;;
741−+ exit ;;
742− *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
743− echo hppa1.0-hp-mpeix
744−- exit 0 ;;
745−+ exit ;;
746− hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
747− echo hppa1.1-hp-osf
748−- exit 0 ;;
749−+ exit ;;
750− hp8??:OSF1:*:*)
751− echo hppa1.0-hp-osf
752−- exit 0 ;;
753−+ exit ;;
754− i*86:OSF1:*:*)
755− if [ -x /usr/sbin/sysversion ] ; then
756− echo ${UNAME_MACHINE}-unknown-osf1mk
757− else
758− echo ${UNAME_MACHINE}-unknown-osf1
759− fi
760−- exit 0 ;;
761−+ exit ;;
762− parisc*:Lites*:*:*)
763− echo hppa1.1-hp-lites
764−- exit 0 ;;
765−+ exit ;;
766− C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
767− echo c1-convex-bsd
768−- exit 0 ;;
769−+ exit ;;
770− C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
771− if getsysinfo -f scalar_acc
772− then echo c32-convex-bsd
773− else echo c2-convex-bsd
774− fi
775−- exit 0 ;;
776−+ exit ;;
777− C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
778− echo c34-convex-bsd
779−- exit 0 ;;
780−+ exit ;;
781− C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
782− echo c38-convex-bsd
783−- exit 0 ;;
784−+ exit ;;
785− C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
786− echo c4-convex-bsd
787−- exit 0 ;;
788−+ exit ;;
789− CRAY*Y-MP:*:*:*)
790− echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
791−- exit 0 ;;
792−+ exit ;;
793− CRAY*[A-Z]90:*:*:*)
794− echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
795− | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
796− -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
797− -e 's/\.[^.]*$/.X/'
798−- exit 0 ;;
799−+ exit ;;
800− CRAY*TS:*:*:*)
801− echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
802−- exit 0 ;;
803−+ exit ;;
804− CRAY*T3E:*:*:*)
805− echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
806−- exit 0 ;;
807−+ exit ;;
808− CRAY*SV1:*:*:*)
809− echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
810−- exit 0 ;;
811−+ exit ;;
812− *:UNICOS/mp:*:*)
813−- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
814−- exit 0 ;;
815−+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
816−+ exit ;;
817− F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
818− FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
819−- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
820−- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
821−- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
822−- exit 0 ;;
823−+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
824−+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
825−+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
826−+ exit ;;
827− 5000:UNIX_System_V:4.*:*)
828−- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
829−- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
830−- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
831−- exit 0 ;;
832−+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
833−+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
834−+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
835−+ exit ;;
836− i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
837− echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
838−- exit 0 ;;
839−+ exit ;;
840− sparc*:BSD/OS:*:*)
841− echo sparc-unknown-bsdi${UNAME_RELEASE}
842−- exit 0 ;;
843−+ exit ;;
844− *:BSD/OS:*:*)
845− echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
846−- exit 0 ;;
847−+ exit ;;
848− *:FreeBSD:*:*)
849−- # Determine whether the default compiler uses glibc.
850−- eval $set_cc_for_build
851−- sed 's/^ //' << EOF >$dummy.c
852−- #include <features.h>
853−- #if __GLIBC__ >= 2
854−- LIBC=gnu
855−- #else
856−- LIBC=
857−- #endif
858−-EOF
859−- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
860−- # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
861−- # FreeBSD's kernel, but not the complete OS.
862−- case ${LIBC} in gnu) kernel_only='k' ;; esac
863−- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
864−- exit 0 ;;
865−+ UNAME_PROCESSOR=`/usr/bin/uname -p`
866−+ case ${UNAME_PROCESSOR} in
867−+ amd64)
868−+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
869−+ *)
870−+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
871−+ esac
872−+ exit ;;
873− i*:CYGWIN*:*)
874− echo ${UNAME_MACHINE}-pc-cygwin
875−- exit 0 ;;
876−- i*:MINGW*:*)
877−+ exit ;;
878−+ *:MINGW64*:*)
879−+ echo ${UNAME_MACHINE}-pc-mingw64
880−+ exit ;;
881−+ *:MINGW*:*)
882− echo ${UNAME_MACHINE}-pc-mingw32
883−- exit 0 ;;
884−+ exit ;;
885−+ i*:MSYS*:*)
886−+ echo ${UNAME_MACHINE}-pc-msys
887−+ exit ;;
888−+ i*:windows32*:*)
889−+ # uname -m includes "-pc" on this system.
890−+ echo ${UNAME_MACHINE}-mingw32
891−+ exit ;;
892− i*:PW*:*)
893− echo ${UNAME_MACHINE}-pc-pw32
894−- exit 0 ;;
895−- x86:Interix*:[34]*)
896−- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
897−- exit 0 ;;
898−+ exit ;;
899−+ *:Interix*:*)
900−+ case ${UNAME_MACHINE} in
901−+ x86)
902−+ echo i586-pc-interix${UNAME_RELEASE}
903−+ exit ;;
904−+ authenticamd | genuineintel | EM64T)
905−+ echo x86_64-unknown-interix${UNAME_RELEASE}
906−+ exit ;;
907−+ IA64)
908−+ echo ia64-unknown-interix${UNAME_RELEASE}
909−+ exit ;;
910−+ esac ;;
911− [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
912− echo i${UNAME_MACHINE}-pc-mks
913−- exit 0 ;;
914−+ exit ;;
915−+ 8664:Windows_NT:*)
916−+ echo x86_64-pc-mks
917−+ exit ;;
918− i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
919− # How do we know it's Interix rather than the generic POSIX subsystem?
920− # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
921− # UNAME_MACHINE based on the output of uname instead of i386?
922− echo i586-pc-interix
923−- exit 0 ;;
924−+ exit ;;
925− i*:UWIN*:*)
926− echo ${UNAME_MACHINE}-pc-uwin
927−- exit 0 ;;
928−+ exit ;;
929−+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
930−+ echo x86_64-unknown-cygwin
931−+ exit ;;
932− p*:CYGWIN*:*)
933− echo powerpcle-unknown-cygwin
934−- exit 0 ;;
935−+ exit ;;
936− prep*:SunOS:5.*:*)
937− echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
938−- exit 0 ;;
939−+ exit ;;
940− *:GNU:*:*)
941− # the GNU system
942− echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
943−- exit 0 ;;
944−+ exit ;;
945− *:GNU/*:*:*)
946− # other systems with GNU libc and userland
947− echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
948−- exit 0 ;;
949−+ exit ;;
950− i*86:Minix:*:*)
951− echo ${UNAME_MACHINE}-pc-minix
952−- exit 0 ;;
953−+ exit ;;
954−+ aarch64:Linux:*:*)
955−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
956−+ exit ;;
957−+ aarch64_be:Linux:*:*)
958−+ UNAME_MACHINE=aarch64_be
959−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
960−+ exit ;;
961−+ alpha:Linux:*:*)
962−+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
963−+ EV5) UNAME_MACHINE=alphaev5 ;;
964−+ EV56) UNAME_MACHINE=alphaev56 ;;
965−+ PCA56) UNAME_MACHINE=alphapca56 ;;
966−+ PCA57) UNAME_MACHINE=alphapca56 ;;
967−+ EV6) UNAME_MACHINE=alphaev6 ;;
968−+ EV67) UNAME_MACHINE=alphaev67 ;;
969−+ EV68*) UNAME_MACHINE=alphaev68 ;;
970−+ esac
971−+ objdump --private-headers /bin/sh | grep -q ld.so.1
972−+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
973−+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
974−+ exit ;;
975− arm*:Linux:*:*)
976−+ eval $set_cc_for_build
977−+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
978−+ | grep -q __ARM_EABI__
979−+ then
980−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
981−+ else
982−+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
983−+ | grep -q __ARM_PCS_VFP
984−+ then
985−+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
986−+ else
987−+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
988−+ fi
989−+ fi
990−+ exit ;;
991−+ avr32*:Linux:*:*)
992− echo ${UNAME_MACHINE}-unknown-linux-gnu
993−- exit 0 ;;
994−+ exit ;;
995− cris:Linux:*:*)
996−- echo cris-axis-linux-gnu
997−- exit 0 ;;
998−- ia64:Linux:*:*)
999−- echo ${UNAME_MACHINE}-unknown-linux-gnu
1000−- exit 0 ;;
1001−- m32r*:Linux:*:*)
1002−+ echo ${UNAME_MACHINE}-axis-linux-gnu
1003−+ exit ;;
1004−+ crisv32:Linux:*:*)
1005−+ echo ${UNAME_MACHINE}-axis-linux-gnu
1006−+ exit ;;
1007−+ frv:Linux:*:*)
1008− echo ${UNAME_MACHINE}-unknown-linux-gnu
1009−- exit 0 ;;
1010−- m68*:Linux:*:*)
1011−+ exit ;;
1012−+ hexagon:Linux:*:*)
1013− echo ${UNAME_MACHINE}-unknown-linux-gnu
1014−- exit 0 ;;
1015−- mips:Linux:*:*)
1016−+ exit ;;
1017−+ i*86:Linux:*:*)
1018−+ LIBC=gnu
1019− eval $set_cc_for_build
1020− sed 's/^ //' << EOF >$dummy.c
1021−- #undef CPU
1022−- #undef mips
1023−- #undef mipsel
1024−- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1025−- CPU=mipsel
1026−- #else
1027−- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1028−- CPU=mips
1029−- #else
1030−- CPU=
1031−- #endif
1032−+ #ifdef __dietlibc__
1033−+ LIBC=dietlibc
1034− #endif
1035− EOF
1036−- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
1037−- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
1038−- ;;
1039−- mips64:Linux:*:*)
1040−+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
1041−+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1042−+ exit ;;
1043−+ ia64:Linux:*:*)
1044−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1045−+ exit ;;
1046−+ m32r*:Linux:*:*)
1047−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1048−+ exit ;;
1049−+ m68*:Linux:*:*)
1050−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1051−+ exit ;;
1052−+ mips:Linux:*:* | mips64:Linux:*:*)
1053− eval $set_cc_for_build
1054− sed 's/^ //' << EOF >$dummy.c
1055− #undef CPU
1056−- #undef mips64
1057−- #undef mips64el
1058−+ #undef ${UNAME_MACHINE}
1059−+ #undef ${UNAME_MACHINE}el
1060− #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1061−- CPU=mips64el
1062−+ CPU=${UNAME_MACHINE}el
1063− #else
1064− #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1065−- CPU=mips64
1066−+ CPU=${UNAME_MACHINE}
1067− #else
1068− CPU=
1069− #endif
1070− #endif
1071− EOF
1072−- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
1073−- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
1074−+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
1075−+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
1076− ;;
1077−- ppc:Linux:*:*)
1078−- echo powerpc-unknown-linux-gnu
1079−- exit 0 ;;
1080−- ppc64:Linux:*:*)
1081−- echo powerpc64-unknown-linux-gnu
1082−- exit 0 ;;
1083−- alpha:Linux:*:*)
1084−- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
1085−- EV5) UNAME_MACHINE=alphaev5 ;;
1086−- EV56) UNAME_MACHINE=alphaev56 ;;
1087−- PCA56) UNAME_MACHINE=alphapca56 ;;
1088−- PCA57) UNAME_MACHINE=alphapca56 ;;
1089−- EV6) UNAME_MACHINE=alphaev6 ;;
1090−- EV67) UNAME_MACHINE=alphaev67 ;;
1091−- EV68*) UNAME_MACHINE=alphaev68 ;;
1092−- esac
1093−- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
1094−- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
1095−- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
1096−- exit 0 ;;
1097−+ or32:Linux:*:*)
1098−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1099−+ exit ;;
1100−+ padre:Linux:*:*)
1101−+ echo sparc-unknown-linux-gnu
1102−+ exit ;;
1103−+ parisc64:Linux:*:* | hppa64:Linux:*:*)
1104−+ echo hppa64-unknown-linux-gnu
1105−+ exit ;;
1106− parisc:Linux:*:* | hppa:Linux:*:*)
1107− # Look for CPU level
1108− case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1109−@@ -924,115 +973,71 @@
1110− PA8*) echo hppa2.0-unknown-linux-gnu ;;
1111− *) echo hppa-unknown-linux-gnu ;;
1112− esac
1113−- exit 0 ;;
1114−- parisc64:Linux:*:* | hppa64:Linux:*:*)
1115−- echo hppa64-unknown-linux-gnu
1116−- exit 0 ;;
1117−+ exit ;;
1118−+ ppc64:Linux:*:*)
1119−+ echo powerpc64-unknown-linux-gnu
1120−+ exit ;;
1121−+ ppc:Linux:*:*)
1122−+ echo powerpc-unknown-linux-gnu
1123−+ exit ;;
1124− s390:Linux:*:* | s390x:Linux:*:*)
1125− echo ${UNAME_MACHINE}-ibm-linux
1126−- exit 0 ;;
1127−+ exit ;;
1128− sh64*:Linux:*:*)
1129−- echo ${UNAME_MACHINE}-unknown-linux-gnu
1130−- exit 0 ;;
1131−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1132−+ exit ;;
1133− sh*:Linux:*:*)
1134− echo ${UNAME_MACHINE}-unknown-linux-gnu
1135−- exit 0 ;;
1136−+ exit ;;
1137− sparc:Linux:*:* | sparc64:Linux:*:*)
1138− echo ${UNAME_MACHINE}-unknown-linux-gnu
1139−- exit 0 ;;
1140−+ exit ;;
1141−+ tile*:Linux:*:*)
1142−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1143−+ exit ;;
1144−+ vax:Linux:*:*)
1145−+ echo ${UNAME_MACHINE}-dec-linux-gnu
1146−+ exit ;;
1147− x86_64:Linux:*:*)
1148−- echo x86_64-unknown-linux-gnu
1149−- exit 0 ;;
1150−- i*86:Linux:*:*)
1151−- # The BFD linker knows what the default object file format is, so
1152−- # first see if it will tell us. cd to the root directory to prevent
1153−- # problems with other programs or directories called `ld' in the path.
1154−- # Set LC_ALL=C to ensure ld outputs messages in English.
1155−- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
1156−- | sed -ne '/supported targets:/!d
1157−- s/[ ][ ]*/ /g
1158−- s/.*supported targets: *//
1159−- s/ .*//
1160−- p'`
1161−- case "$ld_supported_targets" in
1162−- elf32-i386)
1163−- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
1164−- ;;
1165−- a.out-i386-linux)
1166−- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
1167−- exit 0 ;;
1168−- coff-i386)
1169−- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
1170−- exit 0 ;;
1171−- "")
1172−- # Either a pre-BFD a.out linker (linux-gnuoldld) or
1173−- # one that does not give us useful --help.
1174−- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
1175−- exit 0 ;;
1176−- esac
1177−- # Determine whether the default compiler is a.out or elf
1178−- eval $set_cc_for_build
1179−- sed 's/^ //' << EOF >$dummy.c
1180−- #include <features.h>
1181−- #ifdef __ELF__
1182−- # ifdef __GLIBC__
1183−- # if __GLIBC__ >= 2
1184−- LIBC=gnu
1185−- # else
1186−- LIBC=gnulibc1
1187−- # endif
1188−- # else
1189−- LIBC=gnulibc1
1190−- # endif
1191−- #else
1192−- #ifdef __INTEL_COMPILER
1193−- LIBC=gnu
1194−- #else
1195−- LIBC=gnuaout
1196−- #endif
1197−- #endif
1198−- #ifdef __dietlibc__
1199−- LIBC=dietlibc
1200−- #endif
1201−-EOF
1202−- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
1203−- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
1204−- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
1205−- ;;
1206−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1207−+ exit ;;
1208−+ xtensa*:Linux:*:*)
1209−+ echo ${UNAME_MACHINE}-unknown-linux-gnu
1210−+ exit ;;
1211− i*86:DYNIX/ptx:4*:*)
1212− # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1213− # earlier versions are messed up and put the nodename in both
1214− # sysname and nodename.
1215− echo i386-sequent-sysv4
1216−- exit 0 ;;
1217−+ exit ;;
1218− i*86:UNIX_SV:4.2MP:2.*)
1219−- # Unixware is an offshoot of SVR4, but it has its own version
1220−- # number series starting with 2...
1221−- # I am not positive that other SVR4 systems won't match this,
1222−+ # Unixware is an offshoot of SVR4, but it has its own version
1223−+ # number series starting with 2...
1224−+ # I am not positive that other SVR4 systems won't match this,
1225− # I just have to hope. -- rms.
1226−- # Use sysv4.2uw... so that sysv4* matches it.
1227−+ # Use sysv4.2uw... so that sysv4* matches it.
1228− echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1229−- exit 0 ;;
1230−+ exit ;;
1231− i*86:OS/2:*:*)
1232− # If we were able to find `uname', then EMX Unix compatibility
1233− # is probably installed.
1234− echo ${UNAME_MACHINE}-pc-os2-emx
1235−- exit 0 ;;
1236−+ exit ;;
1237− i*86:XTS-300:*:STOP)
1238− echo ${UNAME_MACHINE}-unknown-stop
1239−- exit 0 ;;
1240−+ exit ;;
1241− i*86:atheos:*:*)
1242− echo ${UNAME_MACHINE}-unknown-atheos
1243−- exit 0 ;;
1244−- i*86:syllable:*:*)
1245−+ exit ;;
1246−+ i*86:syllable:*:*)
1247− echo ${UNAME_MACHINE}-pc-syllable
1248−- exit 0 ;;
1249−- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1250−+ exit ;;
1251−+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1252− echo i386-unknown-lynxos${UNAME_RELEASE}
1253−- exit 0 ;;
1254−+ exit ;;
1255− i*86:*DOS:*:*)
1256− echo ${UNAME_MACHINE}-pc-msdosdjgpp
1257−- exit 0 ;;
1258−+ exit ;;
1259− i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1260− UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1261− if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1262−@@ -1040,15 +1045,16 @@
1263− else
1264− echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1265− fi
1266−- exit 0 ;;
1267−- i*86:*:5:[78]*)
1268−+ exit ;;
1269−+ i*86:*:5:[678]*)
1270−+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
1271− case `/bin/uname -X | grep "^Machine"` in
1272− *486*) UNAME_MACHINE=i486 ;;
1273− *Pentium) UNAME_MACHINE=i586 ;;
1274− *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1275− esac
1276− echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1277−- exit 0 ;;
1278−+ exit ;;
1279− i*86:*:3.2:*)
1280− if test -f /usr/options/cb.name; then
1281− UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1282−@@ -1066,73 +1072,86 @@
1283− else
1284− echo ${UNAME_MACHINE}-pc-sysv32
1285− fi
1286−- exit 0 ;;
1287−+ exit ;;
1288− pc:*:*:*)
1289− # Left here for compatibility:
1290−- # uname -m prints for DJGPP always 'pc', but it prints nothing about
1291−- # the processor, so we play safe by assuming i386.
1292−- echo i386-pc-msdosdjgpp
1293−- exit 0 ;;
1294−+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
1295−+ # the processor, so we play safe by assuming i586.
1296−+ # Note: whatever this is, it MUST be the same as what config.sub
1297−+ # prints for the "djgpp" host, or else GDB configury will decide that
1298−+ # this is a cross-build.
1299−+ echo i586-pc-msdosdjgpp
1300−+ exit ;;
1301− Intel:Mach:3*:*)
1302− echo i386-pc-mach3
1303−- exit 0 ;;
1304−+ exit ;;
1305− paragon:*:*:*)
1306− echo i860-intel-osf1
1307−- exit 0 ;;
1308−+ exit ;;
1309− i860:*:4.*:*) # i860-SVR4
1310− if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1311− echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1312− else # Add other i860-SVR4 vendors below as they are discovered.
1313− echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1314− fi
1315−- exit 0 ;;
1316−+ exit ;;
1317− mini*:CTIX:SYS*5:*)
1318− # "miniframe"
1319− echo m68010-convergent-sysv
1320−- exit 0 ;;
1321−+ exit ;;
1322− mc68k:UNIX:SYSTEM5:3.51m)
1323− echo m68k-convergent-sysv
1324−- exit 0 ;;
1325−+ exit ;;
1326− M680?0:D-NIX:5.3:*)
1327− echo m68k-diab-dnix
1328−- exit 0 ;;
1329−- M68*:*:R3V[567]*:*)
1330−- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1331−- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
1332−+ exit ;;
1333−+ M68*:*:R3V[5678]*:*)
1334−+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1335−+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1336− OS_REL=''
1337− test -r /etc/.relid \
1338− && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1339− /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1340−- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
1341−+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1342− /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1343−- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1344−+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1345− 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1346−- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1347−- && echo i486-ncr-sysv4 && exit 0 ;;
1348−+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1349−+ && { echo i486-ncr-sysv4; exit; } ;;
1350−+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1351−+ OS_REL='.3'
1352−+ test -r /etc/.relid \
1353−+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1354−+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1355−+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1356−+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1357−+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1358−+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1359−+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1360− m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1361− echo m68k-unknown-lynxos${UNAME_RELEASE}
1362−- exit 0 ;;
1363−+ exit ;;
1364− mc68030:UNIX_System_V:4.*:*)
1365− echo m68k-atari-sysv4
1366−- exit 0 ;;
1367−+ exit ;;
1368− TSUNAMI:LynxOS:2.*:*)
1369− echo sparc-unknown-lynxos${UNAME_RELEASE}
1370−- exit 0 ;;
1371−+ exit ;;
1372− rs6000:LynxOS:2.*:*)
1373− echo rs6000-unknown-lynxos${UNAME_RELEASE}
1374−- exit 0 ;;
1375−- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1376−+ exit ;;
1377−+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1378− echo powerpc-unknown-lynxos${UNAME_RELEASE}
1379−- exit 0 ;;
1380−+ exit ;;
1381− SM[BE]S:UNIX_SV:*:*)
1382− echo mips-dde-sysv${UNAME_RELEASE}
1383−- exit 0 ;;
1384−+ exit ;;
1385− RM*:ReliantUNIX-*:*:*)
1386− echo mips-sni-sysv4
1387−- exit 0 ;;
1388−+ exit ;;
1389− RM*:SINIX-*:*:*)
1390− echo mips-sni-sysv4
1391−- exit 0 ;;
1392−+ exit ;;
1393− *:SINIX-*:*:*)
1394− if uname -p 2>/dev/null >/dev/null ; then
1395− UNAME_MACHINE=`(uname -p) 2>/dev/null`
1396−@@ -1140,68 +1159,97 @@
1397− else
1398− echo ns32k-sni-sysv
1399− fi
1400−- exit 0 ;;
1401−- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1402−- # says <Richard.M.Bartel@ccMail.Census.GOV>
1403−- echo i586-unisys-sysv4
1404−- exit 0 ;;
1405−+ exit ;;
1406−+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1407−+ # says <Richard.M.Bartel@ccMail.Census.GOV>
1408−+ echo i586-unisys-sysv4
1409−+ exit ;;
1410− *:UNIX_System_V:4*:FTX*)
1411− # From Gerald Hewes <hewes@openmarket.com>.
1412− # How about differentiating between stratus architectures? -djm
1413− echo hppa1.1-stratus-sysv4
1414−- exit 0 ;;
1415−+ exit ;;
1416− *:*:*:FTX*)
1417− # From seanf@swdc.stratus.com.
1418− echo i860-stratus-sysv4
1419−- exit 0 ;;
1420−+ exit ;;
1421−+ i*86:VOS:*:*)
1422−+ # From Paul.Green@stratus.com.
1423−+ echo ${UNAME_MACHINE}-stratus-vos
1424−+ exit ;;
1425− *:VOS:*:*)
1426− # From Paul.Green@stratus.com.
1427− echo hppa1.1-stratus-vos
1428−- exit 0 ;;
1429−+ exit ;;
1430− mc68*:A/UX:*:*)
1431− echo m68k-apple-aux${UNAME_RELEASE}
1432−- exit 0 ;;
1433−+ exit ;;
1434− news*:NEWS-OS:6*:*)
1435− echo mips-sony-newsos6
1436−- exit 0 ;;
1437−+ exit ;;
1438− R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1439− if [ -d /usr/nec ]; then
1440−- echo mips-nec-sysv${UNAME_RELEASE}
1441−+ echo mips-nec-sysv${UNAME_RELEASE}
1442− else
1443−- echo mips-unknown-sysv${UNAME_RELEASE}
1444−+ echo mips-unknown-sysv${UNAME_RELEASE}
1445− fi
1446−- exit 0 ;;
1447−+ exit ;;
1448− BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1449− echo powerpc-be-beos
1450−- exit 0 ;;
1451−+ exit ;;
1452− BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1453− echo powerpc-apple-beos
1454−- exit 0 ;;
1455−+ exit ;;
1456− BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1457− echo i586-pc-beos
1458−- exit 0 ;;
1459−+ exit ;;
1460−+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1461−+ echo i586-pc-haiku
1462−+ exit ;;
1463−+ x86_64:Haiku:*:*)
1464−+ echo x86_64-unknown-haiku
1465−+ exit ;;
1466− SX-4:SUPER-UX:*:*)
1467− echo sx4-nec-superux${UNAME_RELEASE}
1468−- exit 0 ;;
1469−+ exit ;;
1470− SX-5:SUPER-UX:*:*)
1471− echo sx5-nec-superux${UNAME_RELEASE}
1472−- exit 0 ;;
1473−+ exit ;;
1474− SX-6:SUPER-UX:*:*)
1475− echo sx6-nec-superux${UNAME_RELEASE}
1476−- exit 0 ;;
1477−+ exit ;;
1478−+ SX-7:SUPER-UX:*:*)
1479−+ echo sx7-nec-superux${UNAME_RELEASE}
1480−+ exit ;;
1481−+ SX-8:SUPER-UX:*:*)
1482−+ echo sx8-nec-superux${UNAME_RELEASE}
1483−+ exit ;;
1484−+ SX-8R:SUPER-UX:*:*)
1485−+ echo sx8r-nec-superux${UNAME_RELEASE}
1486−+ exit ;;
1487− Power*:Rhapsody:*:*)
1488− echo powerpc-apple-rhapsody${UNAME_RELEASE}
1489−- exit 0 ;;
1490−+ exit ;;
1491− *:Rhapsody:*:*)
1492− echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1493−- exit 0 ;;
1494−+ exit ;;
1495− *:Darwin:*:*)
1496−- case `uname -p` in
1497−- *86) UNAME_PROCESSOR=i686 ;;
1498−- powerpc) UNAME_PROCESSOR=powerpc ;;
1499−+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1500−+ case $UNAME_PROCESSOR in
1501−+ i386)
1502−+ eval $set_cc_for_build
1503−+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1504−+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1505−+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1506−+ grep IS_64BIT_ARCH >/dev/null
1507−+ then
1508−+ UNAME_PROCESSOR="x86_64"
1509−+ fi
1510−+ fi ;;
1511−+ unknown) UNAME_PROCESSOR=powerpc ;;
1512− esac
1513− echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1514−- exit 0 ;;
1515−+ exit ;;
1516− *:procnto*:*:* | *:QNX:[0123456789]*:*)
1517− UNAME_PROCESSOR=`uname -p`
1518− if test "$UNAME_PROCESSOR" = "x86"; then
1519−@@ -1209,22 +1257,28 @@
1520− UNAME_MACHINE=pc
1521− fi
1522− echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1523−- exit 0 ;;
1524−+ exit ;;
1525− *:QNX:*:4*)
1526− echo i386-pc-qnx
1527−- exit 0 ;;
1528−+ exit ;;
1529−+ NEO-?:NONSTOP_KERNEL:*:*)
1530−+ echo neo-tandem-nsk${UNAME_RELEASE}
1531−+ exit ;;
1532−+ NSE-*:NONSTOP_KERNEL:*:*)
1533−+ echo nse-tandem-nsk${UNAME_RELEASE}
1534−+ exit ;;
1535− NSR-?:NONSTOP_KERNEL:*:*)
1536− echo nsr-tandem-nsk${UNAME_RELEASE}
1537−- exit 0 ;;
1538−+ exit ;;
1539− *:NonStop-UX:*:*)
1540− echo mips-compaq-nonstopux
1541−- exit 0 ;;
1542−+ exit ;;
1543− BS2000:POSIX*:*:*)
1544− echo bs2000-siemens-sysv
1545−- exit 0 ;;
1546−+ exit ;;
1547− DS/*:UNIX_System_V:*:*)
1548− echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1549−- exit 0 ;;
1550−+ exit ;;
1551− *:Plan9:*:*)
1552− # "uname -m" is not consistent, so use $cputype instead. 386
1553− # is converted to i386 for consistency with other x86
1554−@@ -1235,36 +1289,55 @@
1555− UNAME_MACHINE="$cputype"
1556− fi
1557− echo ${UNAME_MACHINE}-unknown-plan9
1558−- exit 0 ;;
1559−+ exit ;;
1560− *:TOPS-10:*:*)
1561− echo pdp10-unknown-tops10
1562−- exit 0 ;;
1563−+ exit ;;
1564− *:TENEX:*:*)
1565− echo pdp10-unknown-tenex
1566−- exit 0 ;;
1567−+ exit ;;
1568− KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1569− echo pdp10-dec-tops20
1570−- exit 0 ;;
1571−+ exit ;;
1572− XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1573− echo pdp10-xkl-tops20
1574−- exit 0 ;;
1575−+ exit ;;
1576− *:TOPS-20:*:*)
1577− echo pdp10-unknown-tops20
1578−- exit 0 ;;
1579−+ exit ;;
1580− *:ITS:*:*)
1581− echo pdp10-unknown-its
1582−- exit 0 ;;
1583−+ exit ;;
1584− SEI:*:*:SEIUX)
1585−- echo mips-sei-seiux${UNAME_RELEASE}
1586−- exit 0 ;;
1587−+ echo mips-sei-seiux${UNAME_RELEASE}
1588−+ exit ;;
1589− *:DragonFly:*:*)
1590− echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1591−- exit 0 ;;
1592−+ exit ;;
1593−+ *:*VMS:*:*)
1594−+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
1595−+ case "${UNAME_MACHINE}" in
1596−+ A*) echo alpha-dec-vms ; exit ;;
1597−+ I*) echo ia64-dec-vms ; exit ;;
1598−+ V*) echo vax-dec-vms ; exit ;;
1599−+ esac ;;
1600−+ *:XENIX:*:SysV)
1601−+ echo i386-pc-xenix
1602−+ exit ;;
1603−+ i*86:skyos:*:*)
1604−+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1605−+ exit ;;
1606−+ i*86:rdos:*:*)
1607−+ echo ${UNAME_MACHINE}-pc-rdos
1608−+ exit ;;
1609−+ i*86:AROS:*:*)
1610−+ echo ${UNAME_MACHINE}-pc-aros
1611−+ exit ;;
1612−+ x86_64:VMkernel:*:*)
1613−+ echo ${UNAME_MACHINE}-unknown-esx
1614−+ exit ;;
1615− esac
1616−
1617−-#echo '(No uname command or uname output not recognized.)' 1>&2
1618−-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1619−-
1620− eval $set_cc_for_build
1621− cat >$dummy.c <<EOF
1622− #ifdef _SEQUENT_
1623−@@ -1282,16 +1355,16 @@
1624− #include <sys/param.h>
1625− printf ("m68k-sony-newsos%s\n",
1626− #ifdef NEWSOS4
1627−- "4"
1628−+ "4"
1629− #else
1630−- ""
1631−+ ""
1632− #endif
1633−- ); exit (0);
1634−+ ); exit (0);
1635− #endif
1636− #endif
1637−
1638− #if defined (__arm) && defined (__acorn) && defined (__unix)
1639−- printf ("arm-acorn-riscix"); exit (0);
1640−+ printf ("arm-acorn-riscix\n"); exit (0);
1641− #endif
1642−
1643− #if defined (hp300) && !defined (hpux)
1644−@@ -1380,11 +1453,12 @@
1645− }
1646− EOF
1647−
1648−-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1649−+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1650−+ { echo "$SYSTEM_NAME"; exit; }
1651−
1652− # Apollos put the system type in the environment.
1653−
1654−-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1655−+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1656−
1657− # Convex versions that predate uname can use getsysinfo(1)
1658−
1659−@@ -1393,22 +1467,22 @@
1660− case `getsysinfo -f cpu_type` in
1661− c1*)
1662− echo c1-convex-bsd
1663−- exit 0 ;;
1664−+ exit ;;
1665− c2*)
1666− if getsysinfo -f scalar_acc
1667− then echo c32-convex-bsd
1668− else echo c2-convex-bsd
1669− fi
1670−- exit 0 ;;
1671−+ exit ;;
1672− c34*)
1673− echo c34-convex-bsd
1674−- exit 0 ;;
1675−+ exit ;;
1676− c38*)
1677− echo c38-convex-bsd
1678−- exit 0 ;;
1679−+ exit ;;
1680− c4*)
1681− echo c4-convex-bsd
1682−- exit 0 ;;
1683−+ exit ;;
1684− esac
1685− fi
1686−
1687−@@ -1419,7 +1493,9 @@
1688− the operating system you are using. It is advised that you
1689− download the most up to date version of the config scripts from
1690−
1691−- ftp://ftp.gnu.org/pub/gnu/config/
1692−+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1693−+and
1694−+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1695−
1696− If the version you run ($0) is already up to date, please
1697− send the following data and any information you think might be
1698−diff -ur w3m-0.5.3/main.c new/w3m-0.5.3/main.c
1699−--- w3m-0.5.3/main.c 2011-01-04 04:42:19.000000000 -0500
1700−+++ w3m-0.5.3/main.c 2013-04-28 18:42:08.408034100 -0400
1701−@@ -789,7 +789,8 @@
1702− }
1703−
1704− #ifdef USE_BINMODE_STREAM
1705−- setmode(fileno(stdout), O_BINARY);
1706−+ /* Seems to only be needed for old versions of Cygwin */
1707−+ /***setmode(fileno(stdout), O_BINARY);***/
1708− #endif
1709− if (!w3m_dump && !w3m_backend) {
1710− fmInit();
pkgs/applications/networking/browsers/w3m/default.nix+1−2
@@ -38,8 +38,7 @@ stdenv.mkDerivation rec {
3838 url = "https://aur.archlinux.org/cgit/aur.git/plain/https.patch?h=w3m-mouse&id=5b5f0fbb59f674575e87dd368fed834641c35f03";
3939 sha256 = "08skvaha1hjyapsh8zw5dgfy433mw2hk7qy9yy9avn8rjqj7kjxk";
4040 })
41− ] ++ optional (graphicsSupport && !x11Support) [ ./no-x11.patch ]
42− ++ optional stdenv.isCygwin ./cygwin.patch;
41+ ] ++ optional (graphicsSupport && !x11Support) [ ./no-x11.patch ];
4342
4443 buildInputs = [ pkgconfig ncurses boehmgc gettext zlib ]
4544 ++ optional sslSupport openssl
pkgs/build-support/cc-wrapper/default.nix+6
@@ -359,7 +359,13 @@ stdenv.mkDerivation {
359359 if [[ "$($ldPath/${prefix}ld -z relro 2>&1 || true)" =~ un(recognized|known)\ option ]]; then
360360 hardening_unsupported_flags+=" relro"
361361 fi
362+ ''
363+
364+ + optionalString hostPlatform.isCygwin ''
365+ hardening_unsupported_flags+=" pic"
366+ ''
362367
368+ + ''
363369 substituteAll ${preWrap ./add-flags.sh} $out/nix-support/add-flags.sh
364370 substituteAll ${preWrap ./add-hardening.sh} $out/nix-support/add-hardening.sh
365371 cp -p ${preWrap ./utils.sh} $out/nix-support/utils.sh
pkgs/build-support/setup-hooks/win-dll-link.sh+1−1
@@ -35,7 +35,7 @@ _linkDLLs() {
3535 local dllPath2
3636 for dllPath2 in "$dllPath" "$(dirname $(readlink "$dllPath" || echo "$dllPath"))"/*.dll; do
3737 if [ -e ./"$(basename "$dllPath2")" ]; then continue; fi
38− ln -sr "$dllPath2" .
38+ CYGWIN+=\ winsymlinks:nativestrict ln -sr "$dllPath2" .
3939 linkCount=$(($linkCount+1))
4040 done
4141 done
pkgs/development/interpreters/python/cpython/2.7/default.nix+7−5
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl
1+{ stdenv, hostPlatform, fetchurl
22, bzip2
33, gdbm
44, fetchpatch
@@ -69,7 +69,7 @@ let
6969
7070 ./glibc-2.25-enosys.patch
7171
72− ] ++ optionals stdenv.isCygwin [
72+ ] ++ optionals hostPlatform.isCygwin [
7373 ./2.5.2-ctypes-util-find_library.patch
7474 ./2.5.2-tkinter-x11.patch
7575 ./2.6.2-ssl-threads.patch
@@ -110,7 +110,7 @@ let
110110 "--enable-shared"
111111 "--with-threads"
112112 "--enable-unicode=ucs4"
113− ] ++ optionals stdenv.isCygwin [
113+ ] ++ optionals hostPlatform.isCygwin [
114114 "--with-system-ffi"
115115 "--with-system-expat"
116116 "ac_cv_func_bind_textdomain_codeset=yes"
@@ -118,14 +118,14 @@ let
118118 "--disable-toolbox-glue"
119119 ];
120120
121− postConfigure = if stdenv.isCygwin then ''
121+ postConfigure = if hostPlatform.isCygwin then ''
122122 sed -i Makefile -e 's,PYTHONPATH="$(srcdir),PYTHONPATH="$(abs_srcdir),'
123123 '' else null;
124124
125125 buildInputs =
126126 optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
127127 [ bzip2 openssl zlib ]
128− ++ optionals stdenv.isCygwin [ expat libffi ]
128+ ++ optionals hostPlatform.isCygwin [ expat libffi ]
129129 ++ [ db gdbm ncurses sqlite readline ]
130130 ++ optionals x11Support [ tcl tk xlibsWrapper libX11 ]
131131 ++ optionals stdenv.isDarwin [ CF configd ];
@@ -190,6 +190,8 @@ in stdenv.mkDerivation {
190190 find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i -
191191 find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i -
192192 find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i -
193+ '' + optionalString hostPlatform.isCygwin ''
194+ cp libpython2.7.dll.a $out/lib
193195 '';
194196
195197 passthru = let
pkgs/development/libraries/gdbm/default.nix+15−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl }:
1+{ stdenv, lib, buildPlatform, fetchurl }:
22
33stdenv.mkDerivation rec {
44 name = "gdbm-1.13";
@@ -10,9 +10,22 @@ stdenv.mkDerivation rec {
1010
1111 doCheck = true;
1212
13+ # Linking static stubs on cygwin requires correct ordering.
14+ # Consider upstreaming this.
15+
16+ # Disable dbmfetch03.at test because it depends on unlink()
17+ # failing on a link in a chmod -w directory, which cygwin
18+ # apparently allows.
19+ postPatch = lib.optionalString buildPlatform.isCygwin ''
20+ substituteInPlace tests/Makefile.in --replace \
21+ '_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la' \
22+ '_LDADD = ../compat/libgdbm_compat.la ../src/libgdbm.la'
23+ substituteInPlace tests/testsuite.at --replace \
24+ 'm4_include([dbmfetch03.at])' ""
25+ '';
1326 configureFlags = [ "--enable-libgdbm-compat" ];
1427
15− meta = with stdenv.lib; {
28+ meta = with lib; {
1629 description = "GNU dbm key/value database library";
1730
1831 longDescription =
pkgs/development/libraries/gettext/default.nix+5−24
@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchurl, libiconv, xz }:
1+{ stdenv, lib, hostPlatform, fetchurl, libiconv, xz }:
22
33stdenv.mkDerivation rec {
44 name = "gettext-${version}";
@@ -18,15 +18,6 @@ stdenv.mkDerivation rec {
1818 LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else "";
1919
2020 configureFlags = [ "--disable-csharp" "--with-xz" ]
21− ++ lib.optionals stdenv.isCygwin [
22− "--disable-java"
23− "--disable-native-java"
24− # Share the cache among the various `configure' runs.
25− "--config-cache"
26− "--with-included-gettext"
27− "--with-included-glib"
28− "--with-included-libcroco"
29− ]
3021 # avoid retaining reference to CF during stdenv bootstrap
3122 ++ lib.optionals stdenv.isDarwin [
3223 "gt_cv_func_CFPreferencesCopyAppValue=no"
@@ -38,6 +29,9 @@ stdenv.mkDerivation rec {
3829 substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
3930 substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
4031 substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
32+ '' + lib.optionalString hostPlatform.isCygwin ''
33+ sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
34+ sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
4135 '';
4236
4337 # On cross building, gettext supposes that the wchar.h from libc
@@ -49,11 +43,9 @@ stdenv.mkDerivation rec {
4943 echo gl_cv_func_wcwidth_works=yes > cachefile
5044 configureFlags="$configureFlags --cache-file=`pwd`/cachefile"
5145 fi
52− '' + lib.optionalString stdenv.isCygwin ''
53− sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in
5446 '';
5547
56− nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; # HACK, see #10874 (and 14664)
48+ nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux && !hostPlatform.isCygwin) libiconv; # HACK, see #10874 (and 14664)
5749
5850 enableParallelBuilding = true;
5951
@@ -89,14 +81,3 @@ stdenv.mkDerivation rec {
8981// stdenv.lib.optionalAttrs stdenv.isDarwin {
9082 makeFlags = "CFLAGS=-D_FORTIFY_SOURCE=0";
9183}
92−
93−// stdenv.lib.optionalAttrs stdenv.isCygwin {
94− patchPhase =
95− # Make sure `error.c' gets compiled and is part of `libgettextlib.la'.
96− # This fixes:
97− # gettext-0.18.1.1/gettext-tools/src/msgcmp.c:371: undefined reference to `_error_message_count'
98− ''
99− sed -i gettext-tools/gnulib-lib/Makefile.in \
100− -e 's/am_libgettextlib_la_OBJECTS =/am_libgettextlib_la_OBJECTS = error.lo/g'
101− '';
102−}
pkgs/development/libraries/glib/default.nix+2−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, pkgconfig, gettext, perl, python
1+{ stdenv, hostPlatform, fetchurl, pkgconfig, gettext, perl, python
22, libiconv, libintlOrEmpty, zlib, libffi, pcre, libelf
33# use utillinuxMinimal to avoid circular dependency (utillinux, systemd, glib)
44, utillinuxMinimal ? null
@@ -9,7 +9,7 @@
99
1010with stdenv.lib;
1111
12−assert stdenv.isFreeBSD || stdenv.isDarwin || stdenv.cc.isGNU;
12+assert stdenv.isFreeBSD || stdenv.isDarwin || stdenv.cc.isGNU || hostPlatform.isCygwin;
1313assert stdenv.isLinux -> utillinuxMinimal != null;
1414
1515# TODO:
pkgs/development/libraries/libiconv/default.nix+1−11
@@ -11,11 +11,6 @@ stdenv.mkDerivation rec {
1111 sha256 = "0y1ij745r4p48mxq84rax40p10ln7fc7m243p8k8sia519i3dxfc";
1212 };
1313
14− patches = lib.optionals stdenv.isCygwin [
15− ./libiconv-1.14-reloc.patch
16− ./libiconv-1.14-wchar.patch
17− ];
18−
1914 postPatch =
2015 lib.optionalString ((stdenv ? cross && stdenv.cross.libc == "msvcrt") || stdenv.cc.nativeLibc)
2116 ''
@@ -23,12 +18,7 @@ stdenv.mkDerivation rec {
2318 '';
2419
2520 configureFlags =
26− # On Cygwin, Libtool produces a `.dll.a', which is not a "real" DLL
27− # (Windows' linker would need to be used somehow to produce an actual
28− # DLL.) Thus, build the static library too, and this is what Gettext
29− # will actually use.
30− lib.optional stdenv.isCygwin "--enable-static"
31− ++ lib.optional stdenv.isFreeBSD "--with-pic";
21+ lib.optional stdenv.isFreeBSD "--with-pic";
3222
3323 crossAttrs = {
3424 # Disable stripping to avoid "libiconv.a: Archive has no index" (MinGW).
pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patchdeleted−269
@@ -1,269 +0,0 @@
1−--- libiconv-1.14/lib/relocatable.c 2011-08-07 13:48:03.000000000 -0400
2−+++ libiconv-1.14/lib/relocatable.c 2011-10-15 03:14:13.195133600 -0400
3−@@ -2,20 +2,18 @@
4− Copyright (C) 2003-2006, 2008-2011 Free Software Foundation, Inc.
5− Written by Bruno Haible <bruno@clisp.org>, 2003.
6−
7−- This program is free software; you can redistribute it and/or modify it
8−- under the terms of the GNU Library General Public License as published
9−- by the Free Software Foundation; either version 2, or (at your option)
10−- any later version.
11−+ This program is free software: you can redistribute it and/or modify
12−+ it under the terms of the GNU Lesser General Public License as published by
13−+ the Free Software Foundation; either version 2.1 of the License, or
14−+ (at your option) any later version.
15−
16− This program is distributed in the hope that it will be useful,
17− but WITHOUT ANY WARRANTY; without even the implied warranty of
18−- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19−- Library General Public License for more details.
20−+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21−+ GNU Lesser General Public License for more details.
22−
23−- You should have received a copy of the GNU Library General Public
24−- License along with this program; if not, write to the Free Software
25−- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
26−- USA. */
27−+ You should have received a copy of the GNU Lesser General Public License
28−+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
29−
30−
31− /* Tell glibc's <stdio.h> to provide a prototype for getline().
32−@@ -87,6 +85,19 @@
33− # define FILE_SYSTEM_PREFIX_LEN(P) 0
34− #endif
35−
36−+/* Whether to enable the more costly support for relocatable libraries.
37−+ It allows libraries to be have been installed with a different original
38−+ prefix than the program. But it is quite costly, especially on Cygwin
39−+ platforms, see below. Therefore we enable it by default only on native
40−+ Win32 platforms. */
41−+#ifndef ENABLE_COSTLY_RELOCATABLE
42−+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
43−+# define ENABLE_COSTLY_RELOCATABLE 1
44−+# else
45−+# define ENABLE_COSTLY_RELOCATABLE 0
46−+# endif
47−+#endif
48−+
49− /* Original installation prefix. */
50− static char *orig_prefix;
51− static size_t orig_prefix_len;
52−@@ -156,7 +167,7 @@
53− #endif
54− }
55−
56−-#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
57−+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
58−
59− /* Convenience function:
60− Computes the current installation prefix, based on the original
61−@@ -286,7 +297,7 @@
62−
63− #endif /* !IN_LIBRARY || PIC */
64−
65−-#if defined PIC && defined INSTALLDIR
66−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
67−
68− /* Full pathname of shared library, or NULL. */
69− static char *shared_library_fullname;
70−@@ -332,7 +343,9 @@
71− #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
72− /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
73− function.
74−- Cygwin >= 1.5 has /proc/self/maps and the getline() function too. */
75−+ Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
76−+ But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
77−+ Cygwin 1.7. */
78− FILE *fp;
79−
80− /* Open the current process' maps file. It describes one VMA per line. */
81−@@ -405,7 +418,7 @@
82− const char *
83− relocate (const char *pathname)
84− {
85−-#if defined PIC && defined INSTALLDIR
86−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
87− static int initialized;
88−
89− /* Initialization code for a shared library. */
90−--- libiconv-1.14/libcharset/lib/relocatable.c 2011-08-07 13:48:03.000000000 -0400
91−+++ libiconv-1.14/libcharset/lib/relocatable.c 2011-10-15 03:14:27.878133600 -0400
92−@@ -2,20 +2,18 @@
93− Copyright (C) 2003-2006, 2008-2011 Free Software Foundation, Inc.
94− Written by Bruno Haible <bruno@clisp.org>, 2003.
95−
96−- This program is free software; you can redistribute it and/or modify it
97−- under the terms of the GNU Library General Public License as published
98−- by the Free Software Foundation; either version 2, or (at your option)
99−- any later version.
100−+ This program is free software: you can redistribute it and/or modify
101−+ it under the terms of the GNU Lesser General Public License as published by
102−+ the Free Software Foundation; either version 2.1 of the License, or
103−+ (at your option) any later version.
104−
105− This program is distributed in the hope that it will be useful,
106− but WITHOUT ANY WARRANTY; without even the implied warranty of
107−- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
108−- Library General Public License for more details.
109−+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110−+ GNU Lesser General Public License for more details.
111−
112−- You should have received a copy of the GNU Library General Public
113−- License along with this program; if not, write to the Free Software
114−- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
115−- USA. */
116−+ You should have received a copy of the GNU Lesser General Public License
117−+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
118−
119−
120− /* Tell glibc's <stdio.h> to provide a prototype for getline().
121−@@ -87,6 +85,19 @@
122− # define FILE_SYSTEM_PREFIX_LEN(P) 0
123− #endif
124−
125−+/* Whether to enable the more costly support for relocatable libraries.
126−+ It allows libraries to be have been installed with a different original
127−+ prefix than the program. But it is quite costly, especially on Cygwin
128−+ platforms, see below. Therefore we enable it by default only on native
129−+ Win32 platforms. */
130−+#ifndef ENABLE_COSTLY_RELOCATABLE
131−+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
132−+# define ENABLE_COSTLY_RELOCATABLE 1
133−+# else
134−+# define ENABLE_COSTLY_RELOCATABLE 0
135−+# endif
136−+#endif
137−+
138− /* Original installation prefix. */
139− static char *orig_prefix;
140− static size_t orig_prefix_len;
141−@@ -156,7 +167,7 @@
142− #endif
143− }
144−
145−-#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
146−+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
147−
148− /* Convenience function:
149− Computes the current installation prefix, based on the original
150−@@ -286,7 +297,7 @@
151−
152− #endif /* !IN_LIBRARY || PIC */
153−
154−-#if defined PIC && defined INSTALLDIR
155−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
156−
157− /* Full pathname of shared library, or NULL. */
158− static char *shared_library_fullname;
159−@@ -332,7 +343,9 @@
160− #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
161− /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
162− function.
163−- Cygwin >= 1.5 has /proc/self/maps and the getline() function too. */
164−+ Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
165−+ But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
166−+ Cygwin 1.7. */
167− FILE *fp;
168−
169− /* Open the current process' maps file. It describes one VMA per line. */
170−@@ -405,7 +418,7 @@
171− const char *
172− relocate (const char *pathname)
173− {
174−-#if defined PIC && defined INSTALLDIR
175−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
176− static int initialized;
177−
178− /* Initialization code for a shared library. */
179−--- libiconv-1.14/srclib/relocatable.c 2011-08-07 09:42:06.000000000 -0400
180−+++ libiconv-1.14/srclib/relocatable.c 2011-10-15 03:14:37.739133600 -0400
181−@@ -3,16 +3,16 @@
182− Written by Bruno Haible <bruno@clisp.org>, 2003.
183−
184− This program is free software: you can redistribute it and/or modify
185−- it under the terms of the GNU General Public License as published by
186−- the Free Software Foundation; either version 3 of the License, or
187−+ it under the terms of the GNU Lesser General Public License as published by
188−+ the Free Software Foundation; either version 2.1 of the License, or
189− (at your option) any later version.
190−
191− This program is distributed in the hope that it will be useful,
192− but WITHOUT ANY WARRANTY; without even the implied warranty of
193− MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
194−- GNU General Public License for more details.
195−+ GNU Lesser General Public License for more details.
196−
197−- You should have received a copy of the GNU General Public License
198−+ You should have received a copy of the GNU Lesser General Public License
199− along with this program. If not, see <http://www.gnu.org/licenses/>. */
200−
201−
202−@@ -85,6 +85,19 @@
203− # define FILE_SYSTEM_PREFIX_LEN(P) 0
204− #endif
205−
206−+/* Whether to enable the more costly support for relocatable libraries.
207−+ It allows libraries to be have been installed with a different original
208−+ prefix than the program. But it is quite costly, especially on Cygwin
209−+ platforms, see below. Therefore we enable it by default only on native
210−+ Win32 platforms. */
211−+#ifndef ENABLE_COSTLY_RELOCATABLE
212−+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
213−+# define ENABLE_COSTLY_RELOCATABLE 1
214−+# else
215−+# define ENABLE_COSTLY_RELOCATABLE 0
216−+# endif
217−+#endif
218−+
219− /* Original installation prefix. */
220− static char *orig_prefix;
221− static size_t orig_prefix_len;
222−@@ -154,7 +167,7 @@
223− #endif
224− }
225−
226−-#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
227−+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
228−
229− /* Convenience function:
230− Computes the current installation prefix, based on the original
231−@@ -284,7 +297,7 @@
232−
233− #endif /* !IN_LIBRARY || PIC */
234−
235−-#if defined PIC && defined INSTALLDIR
236−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
237−
238− /* Full pathname of shared library, or NULL. */
239− static char *shared_library_fullname;
240−@@ -330,7 +343,9 @@
241− #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
242− /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
243− function.
244−- Cygwin >= 1.5 has /proc/self/maps and the getline() function too. */
245−+ Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
246−+ But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
247−+ Cygwin 1.7. */
248− FILE *fp;
249−
250− /* Open the current process' maps file. It describes one VMA per line. */
251−@@ -403,7 +418,7 @@
252− const char *
253− relocate (const char *pathname)
254− {
255−-#if defined PIC && defined INSTALLDIR
256−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
257− static int initialized;
258−
259− /* Initialization code for a shared library. */
260−--- libiconv-1.14/srcm4/gnulib-comp.m4 2011-08-07 09:42:12.000000000 -0400
261−+++ libiconv-1.14/srcm4/gnulib-comp.m4 2011-08-30 02:40:45.597317000 -0400
262−@@ -164,6 +164,7 @@ gl_UNISTD_MODULE_INDICATOR([readlink])
263− gl_RELOCATABLE([$gl_source_base])
264− if test $RELOCATABLE = yes; then
265− AC_LIBOBJ([progreloc])
266−+ AC_LIBOBJ([relocatable])
267− fi
268− gl_FUNC_READLINK_SEPARATE
269− gl_CANONICALIZE_LGPL_SEPARATE
pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patchdeleted−102
@@ -1,102 +0,0 @@
1−--- libiconv-1.14/libcharset/lib/localcharset.c 2011-02-28 17:43:35.000000000 -0500
2−+++ libiconv-1.14/libcharset/lib/localcharset.c 2011-08-28 00:16:57.238000000 -0400
3−@@ -54,10 +54,6 @@
4− # include <locale.h>
5− # endif
6− # endif
7−-# ifdef __CYGWIN__
8−-# define WIN32_LEAN_AND_MEAN
9−-# include <windows.h>
10−-# endif
11− #elif defined WIN32_NATIVE
12− # define WIN32_LEAN_AND_MEAN
13− # include <windows.h>
14−@@ -124,7 +120,7 @@
15− cp = charset_aliases;
16− if (cp == NULL)
17− {
18−-#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
19−+#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE)
20− const char *dir;
21− const char *base = "charset.alias";
22− char *file_name;
23−@@ -309,7 +305,7 @@
24− "DECKOREAN" "\0" "EUC-KR" "\0";
25− # endif
26−
27−-# if defined WIN32_NATIVE || defined __CYGWIN__
28−+# if defined WIN32_NATIVE
29− /* To avoid the troubles of installing a separate file in the same
30− directory as the DLL and of retrieving the DLL's directory at
31− runtime, simply inline the aliases here. */
32−@@ -365,64 +361,12 @@
33−
34− # if HAVE_LANGINFO_CODESET
35−
36−- /* Most systems support nl_langinfo (CODESET) nowadays. */
37−- codeset = nl_langinfo (CODESET);
38−-
39−-# ifdef __CYGWIN__
40−- /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
41−- returns "US-ASCII". Return the suffix of the locale name from the
42−- environment variables (if present) or the codepage as a number. */
43−- if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
44−- {
45−- const char *locale;
46−- static char buf[2 + 10 + 1];
47−-
48−- locale = getenv ("LC_ALL");
49−- if (locale == NULL || locale[0] == '\0')
50−- {
51−- locale = getenv ("LC_CTYPE");
52−- if (locale == NULL || locale[0] == '\0')
53−- locale = getenv ("LANG");
54−- }
55−- if (locale != NULL && locale[0] != '\0')
56−- {
57−- /* If the locale name contains an encoding after the dot, return
58−- it. */
59−- const char *dot = strchr (locale, '.');
60−-
61−- if (dot != NULL)
62−- {
63−- const char *modifier;
64−-
65−- dot++;
66−- /* Look for the possible @... trailer and remove it, if any. */
67−- modifier = strchr (dot, '@');
68−- if (modifier == NULL)
69−- return dot;
70−- if (modifier - dot < sizeof (buf))
71−- {
72−- memcpy (buf, dot, modifier - dot);
73−- buf [modifier - dot] = '\0';
74−- return buf;
75−- }
76−- }
77−- }
78−-
79−- /* Woe32 has a function returning the locale's codepage as a number:
80−- GetACP(). This encoding is used by Cygwin, unless the user has set
81−- the environment variable CYGWIN=codepage:oem (which very few people
82−- do).
83−- Output directed to console windows needs to be converted (to
84−- GetOEMCP() if the console is using a raster font, or to
85−- GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
86−- this conversion transparently (see winsup/cygwin/fhandler_console.cc),
87−- converting to GetConsoleOutputCP(). This leads to correct results,
88−- except when SetConsoleOutputCP has been called and a raster font is
89−- in use. */
90−- sprintf (buf, "CP%u", GetACP ());
91−- codeset = buf;
92−- }
93−-# endif
94−+ /* Most systems support nl_langinfo (CODESET) nowadays.
95−+ POSIX allows that the returned pointer may point to a static area that
96−+ may be overwritten by subsequent calls to setlocale or nl_langinfo. */
97−+ static char codeset_buf[64];
98−+ codeset_buf[0] = '\0';
99−+ codeset = strncat (codeset_buf, nl_langinfo (CODESET), sizeof (codeset_buf));
100−
101− # else
102−
pkgs/development/libraries/libxslt/default.nix+7−1
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python2
1+{ stdenv, hostPlatform, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python2
22, cryptoSupport ? false
33, pythonSupport ? (! stdenv ? cross)
44}:
@@ -18,6 +18,12 @@ stdenv.mkDerivation rec {
1818
1919 patches = stdenv.lib.optional stdenv.isSunOS ./patch-ah.patch;
2020
21+ # fixes: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified
22+ postPatch = optionalString hostPlatform.isCygwin ''
23+ substituteInPlace tests/plugins/Makefile.in \
24+ --replace 'la_LDFLAGS =' 'la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS)'
25+ '';
26+
2127 outputs = [ "bin" "dev" "out" "doc" ] ++ stdenv.lib.optional pythonSupport "py";
2228
2329 buildInputs = [ libxml2.dev ] ++ stdenv.lib.optionals pythonSupport [ libxml2.py python2 ];
pkgs/development/libraries/ncurses/default.nix+1−3
@@ -61,8 +61,6 @@ stdenv.mkDerivation rec {
6161 -e '/CPPFLAGS="$CPPFLAGS/s/ -D_XOPEN_SOURCE_EXTENDED//' \
6262 configure
6363 CFLAGS=-D_XOPEN_SOURCE_EXTENDED
64− '' + lib.optionalString stdenv.isCygwin ''
65− sed -i -e 's,LIB_SUFFIX="t,LIB_SUFFIX=",' configure
6664 '';
6765
6866 enableParallelBuilding = true;
@@ -122,7 +120,7 @@ stdenv.mkDerivation rec {
122120 moveToOutput "bin/tset" "$out"
123121 '';
124122
125− preFixup = ''
123+ preFixup = lib.optionalString (!hostPlatform.isCygwin) ''
126124 rm "$out"/lib/*.a
127125 '';
128126
pkgs/development/libraries/openssl/1.0.1-cygwin64.patchdeleted−136
@@ -1,136 +0,0 @@
1−--- openssl-1.0.1e/config 2014-10-23 15:53:23.436600000 +0200
2−+++ openssl-1.0.1e/config 2014-10-23 15:55:33.837000000 +0200
3−@@ -832,6 +832,7 @@
4− # these are all covered by the catchall below
5− # *-dgux) OUT="dgux" ;;
6− mips-sony-newsos4) OUT="newsos4-gcc" ;;
7−+ x86_64-*-cygwin) OUT="Cygwin-x86_64" ;;
8− *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;;
9− *-*-cygwin) OUT="Cygwin" ;;
10− t3e-cray-unicosmk) OUT="cray-t3e" ;;
11−--- openssl-1.0.1e/Configure 2013-02-17 17:06:18.682058900 -0600
12−+++ openssl-1.0.1e/Configure 2013-02-17 16:38:08.000000000 -0600
13−@@ -550,6 +550,7 @@ my %table=(
14− "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
15− "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:coff:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
16− "debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
17−+"Cygwin-x86_64", "gcc:-DTERMIOS -DL_ENDIAN -O3 -Wall:::CYGWIN32::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:mingw64:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a",
18−
19− # NetWare from David Ward (dsward@novell.com)
20− # requires either MetroWerks NLM development tools, or gcc / nlmconv
21−@@ -1128,7 +1129,7 @@ foreach (sort @experimental)
22−
23− my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
24−
25−-$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target =~ /^mingw/);
26−+$exe_ext=".exe" if ($target =~ /^Cygwin/ || $target eq "DJGPP" || $target =~ /^mingw/);
27− $exe_ext=".nlm" if ($target =~ /netware/);
28− $exe_ext=".pm" if ($target =~ /vos/);
29− $openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
30−--- openssl-1.0.1e/Makefile.org 2013-02-11 09:26:04.000000000 -0600
31−+++ openssl-1.0.1e/Makefile.org 2013-02-17 16:38:08.000000000 -0600
32−@@ -326,9 +326,9 @@ clean-shared:
33− done; \
34− fi; \
35− ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
36−- if [ "$(PLATFORM)" = "Cygwin" ]; then \
37−+ case "$(PLATFORM)" in Cygwin*) \
38− ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
39−- fi; \
40−+ esac; \
41− done
42−
43− link-shared:
44−@@ -571,11 +571,7 @@ install_sw:
45− do \
46− if [ -f "$$i" -o -f "$$i.a" ]; then \
47− ( echo installing $$i; \
48−- if [ "$(PLATFORM)" != "Cygwin" ]; then \
49−- cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
50−- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
51−- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
52−- else \
53−+ case "$(PLATFORM)" in Cygwin*) \
54− c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
55− cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
56− chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
57−@@ -583,7 +579,12 @@ install_sw:
58− cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
59− chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
60− mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
61−- fi ); \
62−+ ;; \
63−+ *) \
64−+ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
65−+ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
66−+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
67−+ esac ); \
68− if expr $(PLATFORM) : 'mingw' > /dev/null; then \
69− ( case $$i in \
70− *crypto*) i=libeay32.dll;; \
71−@@ -643,9 +644,9 @@ install_docs:
72− @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
73− here="`pwd`"; \
74− filecase=; \
75−- if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
76−+ case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
77− filecase=-i; \
78−- fi; \
79−+ esac; \
80− set -e; for i in doc/apps/*.pod; do \
81− fn=`basename $$i .pod`; \
82− sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
83−--- openssl-1.0.1e/engines/ccgost/Makefile 2013-02-11 09:26:04.000000000 -0600
84−+++ openssl-1.0.1e/engines/ccgost/Makefile 2013-02-17 17:05:47.759290200 -0600
85−@@ -45,7 +45,11 @@ install:
86− set -e; \
87− echo installing $(LIBNAME); \
88− pfx=lib; \
89−- if [ "$(PLATFORM)" != "Cygwin" ]; then \
90−+ case "$(PLATFORM)" in Cygwin*) \
91−+ sfx=".so"; \
92−+ cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
93−+ ;; \
94−+ *) \
95− case "$(CFLAGS)" in \
96− *DSO_BEOS*) sfx=".so";; \
97− *DSO_DLFCN*) sfx=`expr "$(SHLIB_EXT)" : '.*\(\.[a-z][a-z]*\)' \| ".so"`;; \
98−@@ -54,10 +58,7 @@ install:
99− *) sfx=".bad";; \
100− esac; \
101− cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
102−- else \
103−- sfx=".so"; \
104−- cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
105−- fi; \
106−+ esac; \
107− chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
108− mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx; \
109− fi
110−--- openssl-1.0.1i/engines/Makefile 2014-10-23 16:08:19.360200000 +0200
111−+++ openssl-1.0.1i/engines/Makefile 2014-10-23 16:10:54.205800000 +0200
112−@@ -111,7 +111,11 @@
113− for l in $(LIBNAMES); do \
114− ( echo installing $$l; \
115− pfx=lib; \
116−- if [ "$(PLATFORM)" != "Cygwin" ]; then \
117−+ case "$(PLATFORM)" in Cygwin*) \
118−+ sfx=".so"; \
119−+ cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
120−+ ;; \
121−+ *) \
122− case "$(CFLAGS)" in \
123− *DSO_BEOS*) sfx=".so";; \
124− *DSO_DLFCN*) sfx=`expr "$(SHLIB_EXT)" : '.*\(\.[a-z][a-z]*\)' \| ".so"`;; \
125−@@ -120,10 +124,7 @@
126− *) sfx=".bad";; \
127− esac; \
128− cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
129−- else \
130−- sfx=".so"; \
131−- cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
132−- fi; \
133−+ esac; \
134− chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
135− mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
136− done; \
pkgs/development/libraries/openssl/default.nix−1
@@ -22,7 +22,6 @@ let
2222 ++ [ ./nix-ssl-cert-file.patch ]
2323 ++ optional (versionOlder version "1.1.0")
2424 (if stdenv.isDarwin then ./use-etc-ssl-certs-darwin.patch else ./use-etc-ssl-certs.patch)
25− ++ optional stdenv.isCygwin ./1.0.1-cygwin64.patch
2625 ++ optional
2726 (versionOlder version "1.0.2" && (stdenv.isDarwin || (stdenv ? cross && stdenv.cross.libc == "libSystem")))
2827 ./darwin-arch.patch;
pkgs/development/libraries/zlib/default.nix+2
@@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
1717 sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1";
1818 };
1919
20+ patches = stdenv.lib.optional hostPlatform.isCygwin ./disable-cygwin-widechar.patch;
21+
2022 postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
2123 substituteInPlace configure \
2224 --replace '/usr/bin/libtool' 'ar' \
pkgs/development/libraries/zlib/disable-cygwin-widechar.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git a/gzguts.h b/gzguts.h
2+index 990a4d2..6378d46 100644
3+--- a/gzguts.h
4++++ b/gzguts.h
5+@@ -39,7 +39,7 @@
6+ # include <io.h>
7+ #endif
8+
9+-#if defined(_WIN32) || defined(__CYGWIN__)
10++#if defined(_WIN32)
11+ # define WIDECHAR
12+ #endif
13+
pkgs/development/tools/misc/help2man/1.40.4-cygwin-nls.patch+5−5
@@ -16,8 +16,8 @@ that we're trying to help2man).
1616
1717 install_preload: install_dirs preload
1818- $(INSTALL_PROGRAM) $(preload).so $(DESTDIR)$(pkglibdir)
19−+ $(INSTALL_PROGRAM) lib/cygintl-8.dll $(DESTDIR)$(pkglibdir)
20−+ ln -sf cygintl-8.dll $(DESTDIR)$(pkglibdir)/$(preload).so
19++ $(INSTALL_PROGRAM) lib/cygintl-9.dll $(DESTDIR)$(pkglibdir)
20++ ln -sf cygintl-9.dll $(DESTDIR)$(pkglibdir)/$(preload).so
2121
2222 install_l10n: install_dirs msg_l10n man_l10n info_l10n
2323 set -e; \
@@ -27,8 +27,8 @@ that we're trying to help2man).
2727 $(preload).so: $(srcdir)/$(preload).c
2828- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ -fPIC -shared $? $(LIBS)
2929+ mkdir -p lib
30−+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-8.dll -shared $? $(LIBS)
31−+ ln -sf lib/cygintl-8.dll $@
30++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o lib/cygintl-9.dll -shared $? $(LIBS)
31++ ln -sf lib/cygintl-9.dll $@
3232
3333 man: $(target).1
3434 $(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL
@@ -62,7 +62,7 @@ that we're trying to help2man).
6262 return;
6363
6464+#ifdef __CYGWIN__
65−+ if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-8.dll", RTLD_LAZY)))
65++ if (!(RTLD_NEXT = dlopen("/usr/bin/cygintl-9.dll", RTLD_LAZY)))
6666+ die("libintl8 not found");
6767+#endif
6868+
pkgs/development/tools/misc/help2man/default.nix+4−3
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, perl, gettext, LocaleGettext, makeWrapper }:
1+{ stdenv, hostPlatform, fetchurl, perl, gettext, LocaleGettext, makeWrapper }:
22
33stdenv.mkDerivation rec {
44 name = "help2man-1.47.4";
@@ -12,11 +12,12 @@ stdenv.mkDerivation rec {
1212
1313 doCheck = false; # target `check' is missing
1414
15− patches = if stdenv.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
15+ patches = if hostPlatform.isCygwin then [ ./1.40.4-cygwin-nls.patch ] else null;
1616
1717 postInstall =
1818 '' wrapProgram "$out/bin/help2man" \
19− --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)"
19+ --prefix PERL5LIB : "$(echo ${LocaleGettext}/lib/perl*/site_perl)" \
20+ ${stdenv.lib.optionalString hostPlatform.isCygwin "--prefix PATH : ${gettext}/bin"}
2021 '';
2122
2223
pkgs/development/tools/misc/pkgconfig/2.36.3-not-win32.patch+13
@@ -309,3 +309,16 @@
309309 # else
310310
311311 /* On old systems which lack it, use setlocale or getenv. */
312+diff --git a/glib/gtypes.h b/glib/gtypes.h
313+index c18e0bf..816685a 100644
314+--- a/glib/glib/gtypes.h
315++++ b/glib/glib/gtypes.h
316+@@ -462,7 +462,7 @@ G_END_DECLS
317+ * properly get exported in Windows DLLs.
318+ */
319+ #ifndef GLIB_VAR
320+-# ifdef G_PLATFORM_WIN32
321++# ifdef G_OS_WIN32
322+ # ifdef GLIB_STATIC_COMPILATION
323+ # define GLIB_VAR extern
324+ # else /* !GLIB_STATIC_COMPILATION */
pkgs/development/tools/misc/pkgconfig/default.nix+1−1
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
2626 configureFlags = [ "--with-internal-glib" ]
2727 ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ];
2828
29− postInstall = ''rm "$out"/bin/*-pkg-config''; # clean the duplicate file
29+ postInstall = ''rm -f "$out"/bin/*-pkg-config''; # clean the duplicate file
3030
3131 meta = {
3232 description = "A tool that allows packages to find out information about other packages";
pkgs/os-specific/linux/procps-ng/default.nix+1−1
@@ -27,6 +27,6 @@ stdenv.mkDerivation rec {
2727 description = "Utilities that give information about processes using the /proc filesystem";
2828 priority = 10; # less than coreutils, which also provides "kill" and "uptime"
2929 license = lib.licenses.gpl2;
30− platforms = lib.platforms.linux;
30+ platforms = lib.platforms.linux ++ lib.platforms.cygwin;
3131 };
3232}
pkgs/servers/gpm/default.nix+1−1
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
3636 homepage = http://www.nico.schottelius.org/software/gpm/;
3737 description = "A daemon that provides mouse support on the Linux console";
3838 license = licenses.gpl2;
39− platforms = platforms.linux;
39+ platforms = platforms.linux ++ platforms.cygwin;
4040 maintainers = with maintainers; [ eelco wkennington ];
4141 };
4242}
pkgs/shells/bash/4.4.nix+9−3
@@ -23,7 +23,7 @@ let
2323 in
2424 import ./bash-4.4-patches.nix patch;
2525
26− inherit (stdenv.lib) optional optionals;
26+ inherit (stdenv.lib) optional optionals optionalString;
2727in
2828
2929stdenv.mkDerivation rec {
@@ -52,8 +52,9 @@ stdenv.mkDerivation rec {
5252
5353 patchFlags = "-p0";
5454
55− patches = upstreamPatches
56− ++ optional hostPlatform.isCygwin ./cygwin-bash-4.3.33-1.src.patch;
55+ patches = upstreamPatches;
56+
57+ postPatch = optionalString hostPlatform.isCygwin "patch -p2 < ${./cygwin-bash-4.4.11-2.src.patch}";
5758
5859 configureFlags = [
5960 (if interactive then "--with-installed-readline" else "--disable-readline")
@@ -79,6 +80,11 @@ stdenv.mkDerivation rec {
7980 # build `version.h'.
8081 enableParallelBuilding = false;
8182
83+ makeFlags = optional hostPlatform.isCygwin [
84+ "LOCAL_LDFLAGS=-Wl,--export-all,--out-implib,libbash.dll.a"
85+ "SHOBJ_LIBS=-lbash"
86+ ];
87+
8288 postInstall = ''
8389 ln -s bash "$out/bin/sh"
8490 rm $out/lib/bash/Makefile.inc
pkgs/shells/bash/cygwin-bash-4.3.33-1.src.patchdeleted−1393
@@ -1,1393 +0,0 @@
1−--- bashline.c 2015-02-06 17:12:55.823275600 -0700
2−+++ bashline.c 2015-02-06 17:14:11.000103800 -0700
3−@@ -71,6 +71,16 @@
4− # include "pcomplete.h"
5− #endif
6−
7−+#if __CYGWIN__
8−+# ifdef __x86_64__
9−+# define IMP(x) __imp_##x
10−+# else
11−+# define IMP(x) _imp__##x
12−+# endif
13−+#else
14−+# define IMP(x) x
15−+#endif
16−+
17− /* These should agree with the defines for emacs_mode and vi_mode in
18− rldefs.h, even though that's not a public readline header file. */
19− #ifndef EMACS_EDITING_MODE
20−@@ -264,6 +274,11 @@ int no_empty_command_completion;
21− are the only possible matches, even if FIGNORE says to. */
22− int force_fignore = 1;
23−
24−+#if __CYGWIN__
25−+/* If set, shorten "foo.exe" to "foo" when they are the same file. */
26−+int completion_strip_exe;
27−+#endif /* __CYGWIN__ */
28−+
29− /* Perform spelling correction on directory names during word completion */
30− int dircomplete_spelling = 0;
31−
32−@@ -491,11 +506,12 @@ initialize_readline ()
33− kseq[0] = CTRL('J');
34− kseq[1] = '\0';
35− func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
36−- if (func == rl_vi_editing_mode)
37−+ extern rl_command_func_t *IMP(rl_vi_editing_mode);
38−+ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
39− rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
40− kseq[0] = CTRL('M');
41− func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
42−- if (func == rl_vi_editing_mode)
43−+ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
44− rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
45− #if defined (VI_MODE)
46− rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap);
47−@@ -514,7 +530,8 @@ initialize_readline ()
48− kseq[0] = '~';
49− kseq[1] = '\0';
50− func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
51−- if (func == 0 || func == rl_tilde_expand)
52−+ extern rl_command_func_t *IMP(rl_tilde_expand);
53−+ if (func == 0 || func == rl_tilde_expand || func == IMP(rl_tilde_expand))
54− rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap);
55−
56− rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
57−@@ -537,7 +554,8 @@ initialize_readline ()
58− kseq[0] = TAB;
59− kseq[1] = '\0';
60− func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
61−- if (func == 0 || func == rl_tab_insert)
62−+ extern rl_command_func_t *IMP(rl_tab_insert);
63−+ if (func == 0 || func == rl_tab_insert || func == IMP(rl_tab_insert))
64− rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
65−
66− /* Tell the completer that we want a crack first. */
67−@@ -2109,6 +2127,21 @@ globword:
68−
69− if (match && executable_completion ((searching_path ? val : cval), searching_path))
70− {
71−+#if __CYGWIN__
72−+ if (completion_strip_exe)
73−+ {
74−+ size_t val_len = strlen (val);
75−+ char *candidate;
76−+ if (val_len > 4 && !strcasecmp (&val[val_len - 4], ".exe")
77−+ && (candidate = strdup (val)))
78−+ {
79−+ candidate[val_len - 4] = '\0';
80−+ if (same_file (val, candidate, NULL, NULL))
81−+ temp[strlen (temp) - 4] = '\0';
82−+ free (candidate);
83−+ }
84−+ }
85−+#endif
86− if (cval != val)
87− free (cval);
88− free (val);
89−@@ -2844,6 +2877,17 @@ test_for_directory (name)
90− int r;
91−
92− fn = bash_tilde_expand (name, 0);
93−+#if __CYGWIN__
94−+ /* stat("//server") can only be successful as a directory, but takes
95−+ a several-second timeout to fail. It is much faster to assume
96−+ that //server is a valid name than it is to wait for the stat,
97−+ even though it gives false positives on bad names. */
98−+ if (fn[0] == '/' && fn[1] == '/' && ! strchr (&fn[2], '/'))
99−+ {
100−+ free (fn);
101−+ return 1;
102−+ }
103−+#endif /* __CYGWIN__ */
104− r = file_isdir (fn);
105− free (fn);
106−
107−--- builtins/evalstring.c 2015-02-06 17:12:55.682776800 -0700
108−+++ builtins/evalstring.c 2015-02-06 17:14:11.015662800 -0700
109−@@ -195,7 +195,7 @@ parse_and_execute (string, from_file, fl
110− int code, lreset;
111− volatile int should_jump_to_top_level, last_result;
112− COMMAND *volatile command;
113−- volatile sigset_t pe_sigmask;
114−+ sigset_t pe_sigmask;
115−
116− parse_prologue (string, flags, PE_TAG);
117−
118−@@ -451,7 +451,7 @@ parse_string (string, from_file, flags,
119− volatile int should_jump_to_top_level;
120− COMMAND *volatile command, *oglobal;
121− char *ostring;
122−- volatile sigset_t ps_sigmask;
123−+ sigset_t ps_sigmask;
124−
125− parse_prologue (string, flags, PS_TAG);
126−
127−--- builtins/set.def 2013-04-19 05:20:34.000000000 -0600
128−+++ builtins/set.def 2015-02-06 17:14:11.015662800 -0700
129−@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
130− #if defined (READLINE)
131− extern int no_line_editing;
132− #endif /* READLINE */
133−+#if __CYGWIN__
134−+extern int igncr;
135−+static int set_minus_o_option_maybe (int, const char *, int);
136−+# define INTERACTIVE_ONLY ,1
137−+#else /* ! __CYGWIN__ */
138−+# define INTERACTIVE_ONLY
139−+#endif
140−
141− $BUILTIN set
142− $FUNCTION set_builtin
143−@@ -92,6 +99,9 @@ Options:
144− #if defined (HISTORY)
145− history enable command history
146− #endif
147−+#if __CYGWIN__
148−+ igncr on cygwin, ignore \r in line endings
149−+#endif
150− ignoreeof the shell will not exit upon reading EOF
151− interactive-comments
152− allow comments to appear in interactive commands
153−@@ -188,29 +198,41 @@ const struct {
154− int *variable;
155− setopt_set_func_t *set_func;
156− setopt_get_func_t *get_func;
157−+#if __CYGWIN__
158−+ /* Cygwin users have taken to exporting SHELLOPTS for the
159−+ cygwin-specific igncr. As a result, we need to make sure
160−+ SHELLOPTS parsing does not turn on interactive options when
161−+ exported from an interactive shell, but parsed in a
162−+ non-interactive setting, since some interactive options violate
163−+ POSIX /bin/sh rules. */
164−+ int interactive_only;
165−+#endif /* __CYGWIN__ */
166− } o_options[] = {
167− { "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
168− #if defined (BRACE_EXPANSION)
169− { "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
170− #endif
171− #if defined (READLINE)
172−- { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
173−+ { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
174− #endif
175− { "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
176− { "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
177− { "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
178− { "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
179− #if defined (BANG_HISTORY)
180−- { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
181−+ { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
182− #endif /* BANG_HISTORY */
183− #if defined (HISTORY)
184−- { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
185−+ { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
186−+#endif
187−+#if __CYGWIN__
188−+ { "igncr", '\0', &igncr, NULL, (setopt_get_func_t *)NULL },
189− #endif
190− { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
191− { "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
192− { "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
193− #if defined (JOB_CONTROL)
194−- { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
195−+ { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY},
196− #endif
197− { "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
198− { "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
199−@@ -229,7 +251,7 @@ const struct {
200− { "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
201− { "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
202− #if defined (READLINE)
203−- { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
204−+ { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY},
205− #endif
206− { "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
207− {(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
208−@@ -416,6 +438,15 @@ int
209− set_minus_o_option (on_or_off, option_name)
210− int on_or_off;
211− char *option_name;
212−+#if __CYGWIN__
213−+{
214−+ /* See cygwin comments above. */
215−+ return set_minus_o_option_maybe (on_or_off, option_name, 0);
216−+}
217−+static int
218−+set_minus_o_option_maybe (int on_or_off, const char *option_name,
219−+ int avoid_interactive)
220−+#endif /* __CYGWIN__ */
221− {
222− register int i;
223−
224−@@ -423,6 +454,10 @@ set_minus_o_option (on_or_off, option_na
225− {
226− if (STREQ (option_name, o_options[i].name))
227− {
228−+#if __CYGWIN__
229−+ if (o_options[i].interactive_only && avoid_interactive)
230−+ return EXECUTION_SUCCESS;
231−+#endif /* __CYGWIN__ */
232− if (o_options[i].letter == 0)
233− {
234− SET_BINARY_O_OPTION_VALUE (i, on_or_off, option_name);
235−@@ -548,7 +583,11 @@ parse_shellopts (value)
236− vptr = 0;
237− while (vname = extract_colon_unit (value, &vptr))
238− {
239−+#if __CYGWIN__
240−+ set_minus_o_option_maybe (FLAG_ON, vname, !interactive_shell);
241−+#else /* !__CYGWIN__ */
242− set_minus_o_option (FLAG_ON, vname);
243−+#endif
244− free (vname);
245− }
246− }
247−--- builtins/shopt.def 2013-02-27 07:43:20.000000000 -0700
248−+++ builtins/shopt.def 2015-02-06 17:14:11.015662800 -0700
249−@@ -91,6 +91,11 @@ extern int glob_star;
250− extern int glob_asciirange;
251− extern int lastpipe_opt;
252−
253−+#if __CYGWIN__
254−+extern int completion_strip_exe;
255−+#endif
256−+
257−+
258− #if defined (EXTENDED_GLOB)
259− extern int extended_glob;
260− #endif
261−@@ -161,6 +166,9 @@ static struct {
262− { "compat40", &shopt_compat40, set_compatibility_level },
263− { "compat41", &shopt_compat41, set_compatibility_level },
264− { "compat42", &shopt_compat41, set_compatibility_level },
265−+#if __CYGWIN__
266−+ { "completion_strip_exe", &completion_strip_exe, NULL },
267−+#endif
268− #if defined (READLINE)
269− { "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL},
270− { "direxpand", &dircomplete_expand, shopt_set_complete_direxpand },
271−--- config-top.h 2012-08-18 18:51:30.000000000 -0600
272−+++ config-top.h 2015-02-06 17:14:11.015662800 -0700
273−@@ -80,10 +80,10 @@
274− #define KSH_COMPATIBLE_SELECT
275−
276− /* System-wide .bashrc file for interactive shells. */
277−-/* #define SYS_BASHRC "/etc/bash.bashrc" */
278−+#define SYS_BASHRC "/etc/bash.bashrc"
279−
280− /* System-wide .bash_logout for login shells. */
281−-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
282−+#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"
283−
284− /* Define this to make non-interactive shells begun with argv[0][0] == '-'
285− run the startup files when not in posix mode. */
286−@@ -93,7 +93,7 @@
287− sshd and source the .bashrc if so (like the rshd behavior). This checks
288− for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
289− which can be fooled under certain not-uncommon circumstances. */
290−-/* #define SSH_SOURCE_BASHRC */
291−+#define SSH_SOURCE_BASHRC
292−
293− /* Define if you want the case-capitalizing operators (~[~]) and the
294− `capcase' variable attribute (declare -c). */
295−--- doc/Makefile.in 2013-10-30 14:18:12.000000000 -0600
296−+++ doc/Makefile.in 2015-02-06 17:14:11.015662800 -0700
297−@@ -176,7 +176,7 @@ bashref.html: $(BASHREF_FILES) $(HSUSER)
298− $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
299−
300− bash.info: bashref.info
301−- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
302−+ ${SHELL} ${INFOPOST} < bashref.info > $@ ; \
303−
304− bash.txt: bash.1
305− bash.ps: bash.1
306−@@ -237,9 +237,9 @@ install: info installdirs bash.info
307− -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
308− -$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)
309− # uncomment the next lines to install the builtins man page
310−-# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
311−-# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
312−-# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
313−+ sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
314−+ -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
315−+ -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
316− -if test -f bash.info; then d=.; else d=$(srcdir); fi; \
317− $(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info
318− # run install-info if it is present to update the info directory
319−--- doc/bash.1 2014-02-06 07:03:52.000000000 -0700
320−+++ doc/bash.1 2015-02-06 17:14:11.015662800 -0700
321−@@ -1658,6 +1658,14 @@ subsequently reset.
322− Expands to the effective user ID of the current user, initialized at
323− shell startup. This variable is readonly.
324− .TP
325−+.B EXECIGNORE
326−+A colon-separated list of extended glob (see \fBPattern Matching\fP)
327−+patterns. Files with full paths matching one of these patterns are
328−+not considered executable for the purposes of completion and PATH
329−+searching, but the \fB[\fP, \fB[[\fP, and \fBtest\fP builtins are not
330−+affected. Use this variable to deal with systems that set the
331−+executable bit on files that are not actually executable.
332−+.TP
333− .B FUNCNAME
334− An array variable containing the names of all shell functions
335− currently in the execution call stack.
336−@@ -3308,6 +3316,10 @@ the character
337− .B ``.''
338− at the start of a name or immediately following a slash
339− must be matched explicitly, unless the shell option
340−+.B completion_strip_exe
341−+If set, whenever bash sees `foo.exe' during completion, it checks if
342−+`foo' is the same file and strips the suffix.
343−+.TP 8
344− .B dotglob
345− is set.
346− When matching a pathname, the slash character must always be
347−--- doc/bashref.texi 2014-02-22 11:20:36.000000000 -0700
348−+++ doc/bashref.texi 2015-02-06 17:14:11.015662800 -0700
349−@@ -4992,6 +4992,10 @@ filenames.
350− This variable is set by default, which is the default Bash behavior in
351− versions through 4.2.
352−
353−+@item completion_strip_exe
354−+If set, whenever bash sees `foo.exe' during completion, it checks if
355−+`foo' is the same file and strips the suffix.
356−+
357− @item direxpand
358− If set, Bash
359− replaces directory names with the results of word expansion when performing
360−@@ -5578,6 +5582,14 @@ Similar to @code{BASH_ENV}; used when th
361− The numeric effective user id of the current user. This variable
362− is readonly.
363−
364−+@item EXECIGNORE
365−+A colon-separated list of extended glob ((@pxref{Pattern Matching})
366−+patterns. Files with full paths matching one of these patterns are
367−+not considered executable for the purposes of completion and PATH
368−+searching, but the @code{[}, @code{[[}, and @code{test} builtins are
369−+not affected. Use this variable to deal with systems that set the
370−+executable bit on files that are not actually executable.
371−+
372− @item FCEDIT
373− The editor used as a default by the @option{-e} option to the @code{fc}
374− builtin command.
375−--- doc/builtins.1 2012-02-21 12:32:05.000000000 -0700
376−+++ doc/builtins.1 2015-02-06 17:14:11.031260100 -0700
377−@@ -19,6 +19,6 @@ shift, shopt, source, suspend, test, tim
378− ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1)
379− .SH BASH BUILTIN COMMANDS
380− .nr zZ 1
381−-.so bash.1
382−+.so man1/bash.1
383− .SH SEE ALSO
384− bash(1), sh(1)
385−--- execute_cmd.c 2015-02-06 17:12:55.261573700 -0700
386−+++ execute_cmd.c 2015-02-06 17:14:11.031260100 -0700
387−@@ -58,6 +58,7 @@ extern int errno;
388− #endif
389−
390− #define NEED_FPURGE_DECL
391−+#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
392−
393− #include "bashansi.h"
394− #include "bashintl.h"
395−--- expr.c 2014-01-03 06:55:00.000000000 -0700
396−+++ expr.c 2015-02-06 17:14:11.031260100 -0700
397−@@ -83,6 +83,7 @@
398−
399− #include "shell.h"
400− #include "typemax.h" /* INTMAX_MAX, INTMAX_MIN */
401−+#define exp2 exp2_
402−
403− /* Because of the $((...)) construct, expressions may include newlines.
404− Here is a macro which accepts newlines, tabs and spaces as whitespace. */
405−--- findcmd.c 2012-10-15 05:45:04.000000000 -0600
406−+++ findcmd.c 2015-02-06 17:14:11.031260100 -0700
407−@@ -48,6 +48,8 @@
408− extern int errno;
409− #endif
410−
411−+#include <glob/strmatch.h>
412−+
413− extern int posixly_correct;
414− extern int last_command_exit_value;
415−
416−@@ -77,6 +79,38 @@ int check_hashed_filenames;
417− containing the file of interest. */
418− int dot_found_in_search = 0;
419−
420−+static struct ignorevar execignore =
421−+{
422−+ "EXECIGNORE",
423−+ (struct ign *)0,
424−+ 0,
425−+ (char *)0,
426−+ (sh_iv_item_func_t *)0,
427−+};
428−+
429−+void
430−+setup_exec_ignore (char *varname)
431−+{
432−+ setup_ignore_patterns (&execignore);
433−+}
434−+
435−+/* Return whether we should never consider file executable
436−+ * even if the system tells us it is. */
437−+static int
438−+is_on_exec_blacklist (char *name)
439−+{
440−+ struct ign *p;
441−+ int flags = FNM_EXTMATCH | FNM_CASEFOLD;
442−+
443−+ for (p = execignore.ignores; p && p->val; p++)
444−+ {
445−+ if (strmatch (p->val, (char *)name, flags) != FNM_NOMATCH)
446−+ return (1);
447−+ }
448−+
449−+ return (0);
450−+}
451−+
452− /* Return some flags based on information about this file.
453− The EXISTS bit is non-zero if the file is found.
454− The EXECABLE bit is non-zero the file is executble.
455−@@ -104,7 +138,7 @@ file_status (name)
456− file access mechanisms into account. eaccess uses the effective
457− user and group IDs, not the real ones. We could use sh_eaccess,
458− but we don't want any special treatment for /dev/fd. */
459−- if (eaccess (name, X_OK) == 0)
460−+ if (!is_on_exec_blacklist (name) && eaccess (name, X_OK) == 0)
461− r |= FS_EXECABLE;
462− if (eaccess (name, R_OK) == 0)
463− r |= FS_READABLE;
464−--- findcmd.h 2012-01-14 16:56:25.000000000 -0700
465−+++ findcmd.h 2015-02-06 17:14:11.031260100 -0700
466−@@ -31,5 +31,6 @@ extern char *find_user_command __P((cons
467− extern char *find_path_file __P((const char *));
468− extern char *search_for_command __P((const char *, int));
469− extern char *user_command_matches __P((const char *, int, int));
470−+extern void setup_exec_ignore __P((char *));
471−
472− #endif /* _FINDCMD_H_ */
473−--- general.c 2014-01-30 14:46:15.000000000 -0700
474−+++ general.c 2015-02-06 17:14:11.031260100 -0700
475−@@ -44,6 +44,10 @@
476−
477− #include <tilde/tilde.h>
478−
479−+#ifdef __CYGWIN__
480−+# include <sys/cygwin.h>
481−+#endif
482−+
483− #if !defined (errno)
484− extern int errno;
485− #endif /* !errno */
486−@@ -632,7 +636,8 @@ make_absolute (string, dot_path)
487− {
488− char pathbuf[PATH_MAX + 1];
489−
490−- cygwin_conv_to_full_posix_path (string, pathbuf);
491−+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
492−+ sizeof pathbuf);
493− result = savestring (pathbuf);
494− }
495− #else
496−--- include/chartypes.h 2011-04-11 12:30:52.000000000 -0600
497−+++ include/chartypes.h 2015-02-06 17:14:11.031260100 -0700
498−@@ -40,6 +40,7 @@
499− #else
500− # define IN_CTYPE_DOMAIN(c) isascii(c)
501− #endif
502−+#define to_uchar(c) ((unsigned char)(c))
503−
504− #if !defined (isspace) && !defined (HAVE_ISSPACE)
505− # define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\f')
506−@@ -67,16 +68,16 @@
507−
508− #undef ISPRINT
509−
510−-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
511−-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
512−-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
513−-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
514−-#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
515−-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
516−-#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c))
517−-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
518−-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
519−-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
520−+#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (to_uchar (c)))
521−+#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (to_uchar (c)))
522−+#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (to_uchar (c)))
523−+#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (to_uchar (c)))
524−+#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (to_uchar (c)))
525−+#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (to_uchar (c)))
526−+#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (to_uchar (c)))
527−+#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (to_uchar (c)))
528−+#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (to_uchar (c)))
529−+#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (to_uchar (c)))
530−
531− #define ISLETTER(c) (ISALPHA(c))
532−
533−--- include/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
534−+++ include/posixjmp.h 2015-02-06 17:14:11.031260100 -0700
535−@@ -27,13 +27,13 @@
536−
537− #if defined (HAVE_POSIX_SIGSETJMP)
538− # define procenv_t sigjmp_buf
539−-# if !defined (__OPENNT)
540−+# if !defined (__OPENNT) && !defined __CYGWIN__
541− # undef setjmp
542− # define setjmp(x) sigsetjmp((x), 1)
543−-# define setjmp_nosigs(x) sigsetjmp((x), 0)
544− # undef longjmp
545− # define longjmp(x, n) siglongjmp((x), (n))
546− # endif /* !__OPENNT */
547−+# define setjmp_nosigs(x) sigsetjmp((x), 0)
548− #else
549− # define procenv_t jmp_buf
550− # define setjmp_nosigs setjmp
551−--- input.c 2014-02-07 07:13:08.000000000 -0700
552−+++ input.c 2015-02-06 17:14:11.031260100 -0700
553−@@ -44,6 +44,10 @@
554− #include "quit.h"
555− #include "trap.h"
556−
557−+#if __CYGWIN__
558−+int igncr;
559−+#endif
560−+
561− #if !defined (errno)
562− extern int errno;
563− #endif /* !errno */
564−@@ -561,6 +565,19 @@ buffered_getchar ()
565− {
566− CHECK_TERMSIG;
567−
568−+#if __CYGWIN__
569−+ /* shopt igncr means to discard carriage returns from input stream.
570−+ If cr is the only character in the buffer, then recurse to pick
571−+ up the next character; otherwise flatten the buffer. */
572−+ if (igncr)
573−+ {
574−+ int ch;
575−+ while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd]))
576−+ == '\r')
577−+ ;
578−+ return ch;
579−+ }
580−+#endif /* __CYGWIN__ */
581− #if !defined (DJGPP)
582− return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
583− #else
584−--- lib/readline/bind.c 2013-04-06 15:46:38.000000000 -0600
585−+++ lib/readline/bind.c 2015-02-06 17:14:11.031260100 -0700
586−@@ -452,7 +452,7 @@ rl_translate_keyseq (seq, array, len)
587− {
588− register int i, c, l, temp;
589−
590−- for (i = l = 0; c = seq[i]; i++)
591−+ for (i = l = 0; (c = seq[i]); i++)
592− {
593− if (c == '\\')
594− {
595−@@ -1210,7 +1210,7 @@ _rl_skip_to_delim (string, start, delim)
596− {
597− int i, c, passc;
598−
599−- for (i = start,passc = 0; c = string[i]; i++)
600−+ for (i = start,passc = 0; (c = string[i]); i++)
601− {
602− if (passc)
603− {
604−@@ -1297,7 +1297,6 @@ rl_parse_and_bind (string)
605− if (_rl_stricmp (string, "set") == 0)
606− {
607− char *var, *value, *e;
608−- int s;
609−
610− var = string + i;
611− /* Make VAR point to start of variable name. */
612−@@ -2198,7 +2197,7 @@ rl_function_dumper (print_readably)
613−
614− fprintf (rl_outstream, "\n");
615−
616−- for (i = 0; name = names[i]; i++)
617−+ for (i = 0; (name = names[i]); i++)
618− {
619− rl_command_func_t *function;
620− char **invokers;
621−--- lib/readline/chardefs.h 2011-07-25 19:47:56.000000000 -0600
622−+++ lib/readline/chardefs.h 2015-02-06 17:14:11.046889800 -0700
623−@@ -71,6 +71,7 @@
624− #else
625− # define IN_CTYPE_DOMAIN(c) isascii(c)
626− #endif
627−+#define to_uchar(c) ((unsigned char)(c))
628−
629− #if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus)
630− # define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
631−@@ -87,13 +88,13 @@
632−
633− /* Beware: these only work with single-byte ASCII characters. */
634−
635−-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
636−-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
637−-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
638−-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
639−-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
640−-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
641−-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
642−+#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (to_uchar (c)))
643−+#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (to_uchar (c)))
644−+#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (to_uchar (c)))
645−+#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (to_uchar (c)))
646−+#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (to_uchar (c)))
647−+#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (to_uchar (c)))
648−+#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (to_uchar (c)))
649−
650− #define _rl_lowercase_p(c) (NON_NEGATIVE(c) && ISLOWER(c))
651− #define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
652−--- lib/readline/complete.c 2013-10-14 07:27:10.000000000 -0600
653−+++ lib/readline/complete.c 2015-02-06 17:14:11.046889800 -0700
654−@@ -1082,7 +1082,7 @@ _rl_find_completion_word (fp, dp)
655− /* We didn't find an unclosed quoted substring upon which to do
656− completion, so use the word break characters to find the
657− substring on which to complete. */
658−- while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
659−+ while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
660− {
661− scan = rl_line_buffer[rl_point];
662−
663−@@ -2116,7 +2116,7 @@ rl_completion_matches (text, entry_funct
664− match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
665− match_list[1] = (char *)NULL;
666−
667−- while (string = (*entry_function) (text, matches))
668−+ while ((string = (*entry_function) (text, matches)))
669− {
670− if (RL_SIG_RECEIVED ())
671− {
672−@@ -2190,7 +2190,7 @@ rl_username_completion_function (text, s
673− }
674−
675− #if defined (HAVE_GETPWENT)
676−- while (entry = getpwent ())
677−+ while ((entry = getpwent ()))
678− {
679− /* Null usernames should result in all users as possible completions. */
680− if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
681−@@ -2723,7 +2723,7 @@ rl_menu_complete (count, ignore)
682− static int full_completion = 0; /* set to 1 if menu completion should reinitialize on next call */
683− static int orig_start, orig_end;
684− static char quote_char;
685−- static int delimiter, cstate;
686−+ static int delimiter;
687−
688− /* The first time through, we generate the list of matches and set things
689− up to insert them. */
690−--- lib/readline/display.c 2015-02-06 17:12:54.793574600 -0700
691−+++ lib/readline/display.c 2015-02-06 17:14:11.046889800 -0700
692−@@ -66,7 +66,6 @@ extern char *strchr (), *strrchr ();
693− static void update_line PARAMS((char *, char *, int, int, int, int));
694− static void space_to_eol PARAMS((int));
695− static void delete_chars PARAMS((int));
696−-static void insert_some_chars PARAMS((char *, int, int));
697− static void open_some_spaces PARAMS((int));
698− static void cr PARAMS((void));
699−
700−@@ -1314,7 +1313,7 @@ update_line (old, new, current_line, oma
701− int current_line, omax, nmax, inv_botlin;
702− {
703− register char *ofd, *ols, *oe, *nfd, *nls, *ne;
704−- int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
705−+ int temp, lendiff, wsatend, od, nd, o_cpos;
706− int current_invis_chars;
707− int col_lendiff, col_temp;
708− int bytes_to_insert;
709−@@ -2485,6 +2484,7 @@ _rl_clear_screen ()
710− #endif /* __DJGPP__ */
711− }
712−
713−+#if 0
714− /* Insert COUNT characters from STRING to the output stream at column COL. */
715− static void
716− insert_some_chars (string, count, col)
717−@@ -2494,6 +2494,7 @@ insert_some_chars (string, count, col)
718− open_some_spaces (col);
719− _rl_output_some_chars (string, count);
720− }
721−+#endif
722−
723− /* Insert COL spaces, keeping the cursor at the same position. We follow the
724− ncurses documentation and use either im/ei with explicit spaces, or IC/ic
725−--- lib/readline/histexpand.c 2013-12-02 07:22:30.000000000 -0700
726−+++ lib/readline/histexpand.c 2015-02-06 17:14:11.046889800 -0700
727−@@ -204,7 +204,7 @@ get_history_event (string, caller_index,
728− }
729−
730− /* Only a closing `?' or a newline delimit a substring search string. */
731−- for (local_index = i; c = string[i]; i++)
732−+ for (local_index = i; (c = string[i]); i++)
733− {
734− #if defined (HANDLE_MULTIBYTE)
735− if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
736−@@ -677,7 +677,7 @@ history_expand_internal (string, start,
737− case 's':
738− {
739− char *new_event;
740−- int delimiter, failed, si, l_temp, ws, we;
741−+ int delimiter, failed, si, l_temp, we;
742−
743− if (c == 's')
744− {
745−@@ -776,7 +776,6 @@ history_expand_internal (string, start,
746− {
747− for (; temp[si] && whitespace (temp[si]); si++)
748− ;
749−- ws = si;
750− we = history_tokenize_word (temp, si);
751− }
752−
753−--- lib/readline/histfile.c 2013-07-19 06:17:17.000000000 -0600
754−+++ lib/readline/histfile.c 2015-02-06 17:14:11.046889800 -0700
755−@@ -104,7 +104,7 @@ int history_write_timestamps = 0;
756−
757− /* Does S look like the beginning of a history timestamp entry? Placeholder
758− for more extensive tests. */
759−-#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((s)[1]) )
760−+#define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((unsigned char) (s)[1]) )
761−
762− /* Return the string that should be used in the place of this
763− filename. This only matters when you don't specify the
764−--- lib/readline/input.c 2015-02-06 17:12:55.027577800 -0700
765−+++ lib/readline/input.c 2015-02-06 17:14:11.046889800 -0700
766−@@ -431,7 +431,7 @@ rl_read_key ()
767− else
768− {
769− /* If input is coming from a macro, then use that. */
770−- if (c = _rl_next_macro_key ())
771−+ if ((c = _rl_next_macro_key ()))
772− return (c);
773−
774− /* If the user has an event function, then call it periodically. */
775−--- lib/readline/isearch.c 2013-10-14 07:08:40.000000000 -0600
776−+++ lib/readline/isearch.c 2015-02-06 17:14:11.046889800 -0700
777−@@ -740,7 +740,7 @@ rl_search_history (direction, invoking_k
778− int direction, invoking_key;
779− {
780− _rl_search_cxt *cxt; /* local for now, but saved globally */
781−- int c, r;
782−+ int r;
783−
784− RL_SETSTATE(RL_STATE_ISEARCH);
785− cxt = _rl_isearch_init (direction);
786−@@ -755,7 +755,7 @@ rl_search_history (direction, invoking_k
787− r = -1;
788− for (;;)
789− {
790−- c = _rl_search_getchar (cxt);
791−+ _rl_search_getchar (cxt);
792− /* We might want to handle EOF here (c == 0) */
793− r = _rl_isearch_dispatch (cxt, cxt->lastc);
794− if (r <= 0)
795−@@ -778,9 +778,9 @@ int
796− _rl_isearch_callback (cxt)
797− _rl_search_cxt *cxt;
798− {
799−- int c, r;
800−+ int r;
801−
802−- c = _rl_search_getchar (cxt);
803−+ _rl_search_getchar (cxt);
804− /* We might want to handle EOF here */
805− r = _rl_isearch_dispatch (cxt, cxt->lastc);
806−
807−--- lib/readline/misc.c 2015-02-06 17:12:55.230384200 -0700
808−+++ lib/readline/misc.c 2015-02-06 17:14:11.046889800 -0700
809−@@ -455,7 +455,7 @@ _rl_revert_all_lines ()
810− entry = (hpos == history_length) ? previous_history () : current_history ();
811− while (entry)
812− {
813−- if (ul = (UNDO_LIST *)entry->data)
814−+ if ((ul = (UNDO_LIST *)entry->data))
815− {
816− if (ul == saved_undo_list)
817− saved_undo_list = 0;
818−@@ -502,7 +502,7 @@ rl_clear_history ()
819− for (i = 0; i < history_length; i++)
820− {
821− hent = hlist[i];
822−- if (ul = (UNDO_LIST *)hent->data)
823−+ if ((ul = (UNDO_LIST *)hent->data))
824− {
825− if (ul == saved_undo_list)
826− saved_undo_list = 0;
827−--- lib/readline/nls.c 2013-03-09 12:51:10.000000000 -0700
828−+++ lib/readline/nls.c 2015-02-06 17:14:11.046889800 -0700
829−@@ -80,7 +80,7 @@ static char *legal_lang_values[] =
830− static char *normalize_codeset PARAMS((char *));
831− #endif /* !HAVE_SETLOCALE */
832−
833−-static char *find_codeset PARAMS((char *, size_t *));
834−+static char *find_codeset PARAMS((char *, size_t *)) __attribute__ ((__unused__));
835−
836− static char *_rl_get_locale_var PARAMS((const char *));
837−
838−@@ -104,12 +104,13 @@ utf8locale (lspec)
839− char *lspec;
840− {
841− char *cp;
842−- size_t len;
843−
844− #if HAVE_LANGINFO_CODESET
845− cp = nl_langinfo (CODESET);
846− return (STREQ (cp, "UTF-8") || STREQ (cp, "utf8"));
847− #else
848−+ size_t len;
849−+
850− cp = find_codeset (lspec, &len);
851−
852− if (cp == 0 || len < 4 || len > 5)
853−--- lib/readline/parens.c 2009-04-19 11:12:06.000000000 -0600
854−+++ lib/readline/parens.c 2015-02-06 17:14:11.046889800 -0700
855−@@ -106,7 +106,7 @@ rl_insert_close (count, invoking_key)
856− else
857− {
858− #if defined (HAVE_SELECT)
859−- int orig_point, match_point, ready;
860−+ int orig_point, match_point;
861− struct timeval timer;
862− fd_set readfds;
863−
864−@@ -126,7 +126,7 @@ rl_insert_close (count, invoking_key)
865− orig_point = rl_point;
866− rl_point = match_point;
867− (*rl_redisplay_function) ();
868−- ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
869−+ select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
870− rl_point = orig_point;
871− #else /* !HAVE_SELECT */
872− _rl_insert_char (count, invoking_key);
873−--- lib/readline/posixjmp.h 2012-12-23 20:20:50.000000000 -0700
874−+++ lib/readline/posixjmp.h 2015-02-06 17:14:11.046889800 -0700
875−@@ -27,13 +27,13 @@
876−
877− #if defined (HAVE_POSIX_SIGSETJMP)
878− # define procenv_t sigjmp_buf
879−-# if !defined (__OPENNT)
880−+# if !defined (__OPENNT) && !defined __CYGWIN__
881− # undef setjmp
882− # define setjmp(x) sigsetjmp((x), 1)
883−-# define setjmp_nosigs(x) sigsetjmp((x), 0)
884− # undef longjmp
885− # define longjmp(x, n) siglongjmp((x), (n))
886− # endif /* !__OPENNT */
887−+# define setjmp_nosigs(x) sigsetjmp((x), 0)
888− #else
889− # define procenv_t jmp_buf
890− # define setjmp_nosigs setjmp
891−--- lib/readline/readline.c 2015-02-06 17:12:54.310964200 -0700
892−+++ lib/readline/readline.c 2015-02-06 17:14:11.046889800 -0700
893−@@ -95,7 +95,7 @@ static void bind_arrow_keys_internal PAR
894− static void bind_arrow_keys PARAMS((void));
895−
896− static void readline_default_bindings PARAMS((void));
897−-static void reset_default_bindings PARAMS((void));
898−+//static void reset_default_bindings PARAMS((void));
899−
900− static int _rl_subseq_result PARAMS((int, Keymap, int, int));
901− static int _rl_subseq_getchar PARAMS((int));
902−@@ -522,7 +522,7 @@ readline_internal_char ()
903− readline_internal_charloop ()
904− #endif
905− {
906−- static int lastc, eof_found;
907−+ static int lastc, eof_found __attribute__((unused));
908− int c, code, lk;
909−
910− lastc = -1;
911−@@ -1204,6 +1204,7 @@ readline_default_bindings ()
912− rl_tty_set_default_bindings (_rl_keymap);
913− }
914−
915−+#if 0
916− /* Reset the default bindings for the terminal special characters we're
917− interested in back to rl_insert and read the new ones. */
918− static void
919−@@ -1215,6 +1216,7 @@ reset_default_bindings ()
920− rl_tty_set_default_bindings (_rl_keymap);
921− }
922− }
923−+#endif
924−
925− /* Bind some common arrow key sequences in MAP. */
926− static void
927−--- lib/readline/rltty.c 2013-08-25 14:57:05.000000000 -0600
928−+++ lib/readline/rltty.c 2015-02-06 17:14:11.062454900 -0700
929−@@ -30,6 +30,7 @@
930− #include <signal.h>
931− #include <errno.h>
932− #include <stdio.h>
933−+#include <sys/ioctl.h>
934−
935− #if defined (HAVE_UNISTD_H)
936− # include <unistd.h>
937−--- lib/readline/shell.c 2013-03-13 08:17:00.000000000 -0600
938−+++ lib/readline/shell.c 2015-02-06 17:14:11.062454900 -0700
939−@@ -123,8 +123,10 @@ sh_single_quote (string)
940− /* Set the environment variables LINES and COLUMNS to lines and cols,
941− respectively. */
942− static char setenv_buf[INT_STRLEN_BOUND (int) + 1];
943−+# if !defined (HAVE_SETENV) && defined (HAVE_PUTENV)
944− static char putenv_buf1[INT_STRLEN_BOUND (int) + 6 + 1]; /* sizeof("LINES=") == 6 */
945− static char putenv_buf2[INT_STRLEN_BOUND (int) + 8 + 1]; /* sizeof("COLUMNS=") == 8 */
946−+# endif
947−
948− void
949− sh_set_lines_and_columns (lines, cols)
950−--- lib/readline/signals.c 2014-01-10 13:06:48.000000000 -0700
951−+++ lib/readline/signals.c 2015-02-06 17:14:11.062454900 -0700
952−@@ -576,7 +576,6 @@ rl_free_line_state ()
953− /* **************************************************************** */
954−
955− #if defined (HAVE_POSIX_SIGNALS)
956−-static sigset_t sigint_set, sigint_oset;
957− static sigset_t sigwinch_set, sigwinch_oset;
958− #else /* !HAVE_POSIX_SIGNALS */
959− # if defined (HAVE_BSD_SIGNALS)
960−--- lib/readline/terminal.c 2013-09-18 07:12:01.000000000 -0600
961−+++ lib/readline/terminal.c 2015-02-06 17:14:11.062454900 -0700
962−@@ -31,6 +31,7 @@
963− #if defined (HAVE_SYS_FILE_H)
964− # include <sys/file.h>
965− #endif /* HAVE_SYS_FILE_H */
966−+#include <sys/ioctl.h>
967−
968− #if defined (HAVE_UNISTD_H)
969− # include <unistd.h>
970−--- lib/readline/text.c 2013-10-14 07:25:05.000000000 -0600
971−+++ lib/readline/text.c 2015-02-06 17:14:11.062454900 -0700
972−@@ -859,11 +859,10 @@ _rl_overwrite_char (count, c)
973− int i;
974− #if defined (HANDLE_MULTIBYTE)
975− char mbkey[MB_LEN_MAX];
976−- int k;
977−
978− /* Read an entire multibyte character sequence to insert COUNT times. */
979− if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
980−- k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
981−+ _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
982− #endif
983−
984− rl_begin_undo_group ();
985−--- lib/readline/tilde.c 2010-07-25 15:42:13.000000000 -0600
986−+++ lib/readline/tilde.c 2015-02-06 17:14:11.062454900 -0700
987−@@ -196,7 +196,7 @@ tilde_expand (string)
988− int result_size, result_index;
989−
990− result_index = result_size = 0;
991−- if (result = strchr (string, '~'))
992−+ if ((result = strchr (string, '~')))
993− result = (char *)xmalloc (result_size = (strlen (string) + 16));
994− else
995− result = (char *)xmalloc (result_size = (strlen (string) + 1));
996−--- lib/readline/undo.c 2014-02-02 13:47:46.000000000 -0700
997−+++ lib/readline/undo.c 2015-02-06 17:14:11.062454900 -0700
998−@@ -124,7 +124,7 @@ _rl_free_undo_list (ul)
999− void
1000− rl_free_undo_list ()
1001− {
1002−- UNDO_LIST *release, *orig_list;
1003−+ UNDO_LIST *orig_list;
1004−
1005− orig_list = rl_undo_list;
1006− _rl_free_undo_list (rl_undo_list);
1007−--- lib/readline/vi_mode.c 2012-09-01 16:55:30.000000000 -0600
1008−+++ lib/readline/vi_mode.c 2015-02-06 17:14:11.062454900 -0700
1009−@@ -1089,7 +1089,7 @@ static int
1010− rl_domove_motion_callback (m)
1011− _rl_vimotion_cxt *m;
1012− {
1013−- int c, save, r;
1014−+ int c, r;
1015− int old_end;
1016−
1017− _rl_vi_last_motion = c = m->motion;
1018−@@ -1257,7 +1257,6 @@ int
1019− rl_vi_domove (x, ignore)
1020− int x, *ignore;
1021− {
1022−- int r;
1023− _rl_vimotion_cxt *m;
1024−
1025− m = _rl_vimvcxt;
1026−--- lib/sh/pathphys.c 2013-05-28 13:33:58.000000000 -0600
1027−+++ lib/sh/pathphys.c 2015-02-06 17:14:11.062454900 -0700
1028−@@ -35,6 +35,7 @@
1029− #include <stdio.h>
1030− #include <chartypes.h>
1031− #include <errno.h>
1032−+#include <stdlib.h>
1033−
1034− #include "shell.h"
1035−
1036−@@ -76,6 +77,10 @@ sh_physpath (path, flags)
1037− char *path;
1038− int flags;
1039− {
1040−+#if __CYGWIN__
1041−+ /* realpath does this correctly without all the hassle */
1042−+ return realpath (path, NULL);
1043−+#else
1044− char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1];
1045− char *result, *p, *q, *qsave, *qbase, *workpath;
1046− int double_slash_path, linklen, nlink;
1047−@@ -214,11 +219,7 @@ error:
1048− {
1049− q = result;
1050− /* Duplicating some code here... */
1051−-#if defined (__CYGWIN__)
1052−- qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1;
1053−-#else
1054− qbase = workpath + 1;
1055−-#endif
1056− double_slash_path = DOUBLE_SLASH (workpath);
1057− qbase += double_slash_path;
1058−
1059−@@ -249,6 +250,7 @@ error:
1060− }
1061−
1062− return (result);
1063−+#endif /* ! __CYGWIN__ */
1064− }
1065−
1066− char *
1067−--- lib/sh/tmpfile.c 2013-12-18 15:50:13.000000000 -0700
1068−+++ lib/sh/tmpfile.c 2015-02-06 17:14:11.062454900 -0700
1069−@@ -96,7 +96,7 @@ get_tmpdir (flags)
1070− if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX))
1071− tdir = 0;
1072−
1073−- if (tdir == 0)
1074−+ if (tdir == 0 || !file_iswdir (tdir))
1075− tdir = get_sys_tmpdir ();
1076−
1077− #if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX)
1078−@@ -118,14 +118,15 @@ sh_mktmpname (nameroot, flags)
1079− struct stat sb;
1080− int r, tdlen;
1081−
1082−- filename = (char *)xmalloc (PATH_MAX + 1);
1083−+ filename = NULL;
1084− tdir = get_tmpdir (flags);
1085− tdlen = strlen (tdir);
1086−
1087− lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
1088−
1089− #ifdef USE_MKTEMP
1090−- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
1091−+ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
1092−+ return NULL;
1093− if (mktemp (filename) == 0)
1094− {
1095− free (filename);
1096−@@ -138,7 +139,9 @@ sh_mktmpname (nameroot, flags)
1097− (unsigned long) time ((time_t *)0) ^
1098− (unsigned long) dollar_dollar_pid ^
1099− (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
1100−- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
1101−+ free (filename);
1102−+ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
1103−+ return NULL;
1104− if (tmpnamelen > 0 && tmpnamelen < 32)
1105− filename[tdlen + 1 + tmpnamelen] = '\0';
1106− # ifdef HAVE_LSTAT
1107−@@ -163,14 +166,19 @@ sh_mktmpfd (nameroot, flags, namep)
1108− char *filename, *tdir, *lroot;
1109− int fd, tdlen;
1110−
1111−- filename = (char *)xmalloc (PATH_MAX + 1);
1112−+ filename = NULL;
1113− tdir = get_tmpdir (flags);
1114− tdlen = strlen (tdir);
1115−
1116− lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
1117−
1118− #ifdef USE_MKSTEMP
1119−- sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
1120−+ if (asprintf (&filename, "%s/%s.XXXXXX", tdir, lroot) < 0)
1121−+ {
1122−+ if (namep)
1123−+ *namep = NULL;
1124−+ return -1;
1125−+ }
1126− fd = mkstemp (filename);
1127− if (fd < 0 || namep == 0)
1128− {
1129−@@ -187,7 +195,13 @@ sh_mktmpfd (nameroot, flags, namep)
1130− (unsigned long) time ((time_t *)0) ^
1131− (unsigned long) dollar_dollar_pid ^
1132− (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
1133−- sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
1134−+ free (filename);
1135−+ if (asprintf (&filename, "%s/%s-%lu", tdir, lroot, filenum) < 0)
1136−+ {
1137−+ if (namep)
1138−+ *namep = NULL;
1139−+ return -1;
1140−+ }
1141− if (tmpnamelen > 0 && tmpnamelen < 32)
1142− filename[tdlen + 1 + tmpnamelen] = '\0';
1143− fd = open (filename, BASEOPENFLAGS | ((flags & MT_READWRITE) ? O_RDWR : O_WRONLY), 0600);
1144−--- mksyntax.c 2012-07-29 17:48:38.000000000 -0600
1145−+++ mksyntax.c 2015-02-06 17:14:11.062454900 -0700
1146−@@ -29,13 +29,13 @@
1147−
1148− #ifdef HAVE_UNISTD_H
1149− # include <unistd.h>
1150−+#else
1151−+extern int optind;
1152−+extern char *optarg;
1153− #endif
1154−
1155− #include "syntax.h"
1156−
1157−-extern int optind;
1158−-extern char *optarg;
1159−-
1160− #ifndef errno
1161− extern int errno;
1162− #endif
1163−--- parse.y 2015-02-06 17:12:55.682776800 -0700
1164−+++ parse.y 2015-02-06 17:14:11.062454900 -0700
1165−@@ -1531,14 +1531,20 @@ yy_string_get ()
1166− string = bash_input.location.string;
1167−
1168− /* If the string doesn't exist, or is empty, EOF found. */
1169−- if (string && *string)
1170−+ while (string && *string)
1171− {
1172− c = *string++;
1173− bash_input.location.string = string;
1174−+#if __CYGWIN__
1175−+ {
1176−+ extern int igncr;
1177−+ if (igncr && c == '\r')
1178−+ continue;
1179−+ }
1180−+#endif
1181− return (c);
1182− }
1183−- else
1184−- return (EOF);
1185−+ return (EOF);
1186− }
1187−
1188− static int
1189−@@ -2305,7 +2311,7 @@ shell_getc (remove_quoted_newline)
1190− if (n <= 2) /* we have to save 1 for the newline added below */
1191− {
1192− if (truncating == 0)
1193−- internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX);
1194−+ internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%zu): line truncated", shell_input_line_size, SIZE_MAX);
1195− shell_input_line[i] = '\0';
1196− truncating = 1;
1197− }
1198−@@ -3582,7 +3588,6 @@ parse_comsub (qc, open, close, lenp, fla
1199−
1200− while (count)
1201− {
1202−-comsub_readchar:
1203− ch = shell_getc (qc != '\'' && (tflags & (LEX_INCOMMENT|LEX_PASSNEXT)) == 0);
1204−
1205− if (ch == EOF)
1206−--- pathexp.h 2009-01-04 12:32:40.000000000 -0700
1207−+++ pathexp.h 2015-02-06 17:14:11.062454900 -0700
1208−@@ -86,7 +86,7 @@ struct ign {
1209− typedef int sh_iv_item_func_t __P((struct ign *));
1210−
1211− struct ignorevar {
1212−- char *varname; /* FIGNORE or GLOBIGNORE */
1213−+ char *varname; /* FIGNORE or GLOBIGNORE or EXECIGNORE */
1214− struct ign *ignores; /* Store the ignore strings here */
1215− int num_ignores; /* How many are there? */
1216− char *last_ignoreval; /* Last value of variable - cached for speed */
1217−--- redir.c 2013-10-14 07:19:59.000000000 -0600
1218−+++ redir.c 2015-02-06 17:14:11.078059300 -0700
1219−@@ -156,7 +156,6 @@ redirection_error (temp, error)
1220− #endif
1221− else if (expandable_redirection_filename (temp))
1222− {
1223−-expandable_filename:
1224− oflags = temp->redirectee.filename->flags;
1225− if (posixly_correct && interactive_shell == 0)
1226− temp->redirectee.filename->flags |= W_NOGLOB;
1227−--- subst.c 2015-02-06 17:12:55.370841100 -0700
1228−+++ subst.c 2015-02-06 17:14:11.078059300 -0700
1229−@@ -41,6 +41,7 @@
1230− #include "posixstat.h"
1231− #include "bashintl.h"
1232−
1233−+#define NEED_SH_SETLINEBUF_DECL /* used in externs.h */
1234− #include "shell.h"
1235− #include "parser.h"
1236− #include "flags.h"
1237−@@ -5268,6 +5269,13 @@ read_comsub (fd, quoted, rflag)
1238− #endif
1239− continue;
1240− }
1241−+#if __CYGWIN__
1242−+ {
1243−+ extern int igncr;
1244−+ if (igncr && c == '\r')
1245−+ continue;
1246−+ }
1247−+#endif /* __CYGWIN__ */
1248−
1249− /* Add the character to ISTRING, possibly after resizing it. */
1250− RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
1251−@@ -5385,6 +5393,28 @@ command_substitute (string, quoted)
1252− goto error_exit;
1253− }
1254−
1255−+#if __CYGWIN__
1256−+ /* Passing a pipe through std fds can cause hangs when talking to a
1257−+ non-cygwin child. Move it. */
1258−+ if (fildes[0] < 3)
1259−+ {
1260−+ int fd = fcntl (fildes[0], F_DUPFD, 3);
1261−+ close (fildes[0]);
1262−+ fildes[0] = fd;
1263−+ }
1264−+ if (fildes[1] < 3)
1265−+ {
1266−+ int fd = fcntl (fildes[1], F_DUPFD, 3);
1267−+ close (fildes[1]);
1268−+ fildes[1] = fd;
1269−+ }
1270−+ if (fildes[0] < 0 || fildes[1] < 0)
1271−+ {
1272−+ sys_error (_("cannot make pipe for command substitution"));
1273−+ goto error_exit;
1274−+ }
1275−+#endif /* __CYGWIN__ */
1276−+
1277− old_pid = last_made_pid;
1278− #if defined (JOB_CONTROL)
1279− old_pipeline_pgrp = pipeline_pgrp;
1280−--- support/bashversion.c 2008-09-09 07:31:53.000000000 -0600
1281−+++ support/bashversion.c 2015-02-06 17:14:11.078059300 -0700
1282−@@ -26,6 +26,9 @@
1283−
1284− #if defined (HAVE_UNISTD_H)
1285− # include <unistd.h>
1286−+#else
1287−+extern int optind;
1288−+extern char *optarg;
1289− #endif
1290−
1291− #include "bashansi.h"
1292−@@ -41,9 +44,6 @@
1293− #define LFLAG 0x0020
1294− #define XFLAG 0x0040
1295−
1296−-extern int optind;
1297−-extern char *optarg;
1298−-
1299− extern char *dist_version;
1300− extern int patch_level;
1301−
1302−@@ -65,7 +65,7 @@ main (argc, argv)
1303− char **argv;
1304− {
1305− int opt, oflags;
1306−- char dv[128], *rv;
1307−+ char dv[128], *rv = NULL;
1308−
1309− if (progname = strrchr (argv[0], '/'))
1310− progname++;
1311−--- support/mkversion.sh 2008-08-13 06:25:57.000000000 -0600
1312−+++ support/mkversion.sh 2015-02-06 17:14:11.078059300 -0700
1313−@@ -29,7 +29,7 @@ source_dir="."
1314− while [ $# -gt 0 ]; do
1315− case "$1" in
1316− -o) shift; OUTFILE=$1; shift ;;
1317−- -b) shift; inc_build=yes ;;
1318−+ -b) shift; ;;# inc_build=yes ;; # hacked out for cygport
1319− -s) shift; rel_status=$1; shift ;;
1320− -p) shift; patch_level=$1; shift ;;
1321− -d) shift; dist_version=$1; shift ;;
1322−--- variables.c 2015-02-06 17:12:55.729569600 -0700
1323−+++ variables.c 2015-02-06 17:14:11.078059300 -0700
1324−@@ -2526,9 +2526,9 @@ bind_variable_internal (name, value, tab
1325−
1326− newname = 0;
1327− #if defined (ARRAY_VARS)
1328−- if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name))
1329−+ if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference ((char *)name))
1330− {
1331−- newname = array_variable_name (name, &subp, &sublen);
1332−+ newname = array_variable_name ((char*)name, &subp, &sublen);
1333− if (newname == 0)
1334− return (SHELL_VAR *)NULL; /* XXX */
1335− entry = hash_lookup (newname, table);
1336−@@ -2573,13 +2573,13 @@ bind_variable_internal (name, value, tab
1337− entry = make_new_array_variable (newname); /* indexed array by default */
1338− if (entry == 0)
1339− return entry;
1340−- ind = array_expand_index (name, subp, sublen);
1341−+ ind = array_expand_index (entry, subp, sublen);
1342− bind_array_element (entry, ind, value, aflags);
1343− }
1344− #endif
1345− else if (entry == 0)
1346− {
1347−- entry = make_new_variable (name, table);
1348−+ entry = make_new_variable ((char*)name, table);
1349− var_setvalue (entry, make_variable_value (entry, value, 0)); /* XXX */
1350− }
1351− else if (entry->assign_func) /* array vars have assign functions now */
1352−@@ -4679,6 +4679,8 @@ static struct name_and_function special_
1353− { "COMP_WORDBREAKS", sv_comp_wordbreaks },
1354− #endif
1355−
1356−+ { "EXECIGNORE", sv_execignore },
1357−+
1358− { "FUNCNEST", sv_funcnest },
1359−
1360− { "GLOBIGNORE", sv_globignore },
1361−@@ -4877,6 +4879,13 @@ sv_globignore (name)
1362− setup_glob_ignore (name);
1363− }
1364−
1365−+/* What to do when EXECIGNORE changes. */
1366−+void
1367−+sv_execignore (char *name)
1368−+{
1369−+ setup_exec_ignore (name);
1370−+}
1371−+
1372− #if defined (READLINE)
1373− void
1374− sv_comp_wordbreaks (name)
1375−@@ -4950,7 +4959,7 @@ sv_winsize (name)
1376− /* Update the value of HOME in the export environment so tilde expansion will
1377− work on cygwin. */
1378− #if defined (__CYGWIN__)
1379−-sv_home (name)
1380−+void sv_home (name)
1381− char *name;
1382− {
1383− array_needs_making = 1;
1384−--- variables.h 2014-01-08 13:33:29.000000000 -0700
1385−+++ variables.h 2015-02-06 17:14:11.078059300 -0700
1386−@@ -372,6 +372,7 @@ extern void sv_ifs __P((char *));
1387− extern void sv_path __P((char *));
1388− extern void sv_mail __P((char *));
1389− extern void sv_funcnest __P((char *));
1390−+extern void sv_execignore __P((char *));
1391− extern void sv_globignore __P((char *));
1392− extern void sv_ignoreeof __P((char *));
1393− extern void sv_strict_posix __P((char *));
pkgs/shells/bash/cygwin-bash-4.4.11-2.src.patchnew file+607
@@ -0,0 +1,607 @@
1+--- origsrc/bash-4.4/bashline.c 2017-01-23 13:28:06.955247200 -0600
2++++ src/bash-4.4/bashline.c 2017-01-23 13:55:07.992877600 -0600
3+@@ -76,6 +76,16 @@
4+ # include "pcomplete.h"
5+ #endif
6+
7++#if __CYGWIN__
8++# ifdef __x86_64__
9++# define IMP(x) __imp_##x
10++# else
11++# define IMP(x) _imp__##x
12++# endif
13++#else
14++# define IMP(x) x
15++#endif
16++
17+ /* These should agree with the defines for emacs_mode and vi_mode in
18+ rldefs.h, even though that's not a public readline header file. */
19+ #ifndef EMACS_EDITING_MODE
20+@@ -271,6 +281,11 @@ int no_empty_command_completion;
21+ are the only possible matches, even if FIGNORE says to. */
22+ int force_fignore = 1;
23+
24++#if __CYGWIN__
25++/* If set, shorten "foo.exe" to "foo" when they are the same file. */
26++int completion_strip_exe;
27++#endif /* __CYGWIN__ */
28++
29+ /* Perform spelling correction on directory names during word completion */
30+ int dircomplete_spelling = 0;
31+
32+@@ -498,11 +513,12 @@ initialize_readline ()
33+ kseq[0] = CTRL('J');
34+ kseq[1] = '\0';
35+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
36+- if (func == rl_vi_editing_mode)
37++ extern rl_command_func_t *IMP(rl_vi_editing_mode);
38++ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
39+ rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
40+ kseq[0] = CTRL('M');
41+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
42+- if (func == rl_vi_editing_mode)
43++ if (func == rl_vi_editing_mode || func == IMP(rl_vi_editing_mode))
44+ rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
45+ #if defined (VI_MODE)
46+ rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap);
47+@@ -521,7 +537,8 @@ initialize_readline ()
48+ kseq[0] = '~';
49+ kseq[1] = '\0';
50+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
51+- if (func == 0 || func == rl_tilde_expand)
52++ extern rl_command_func_t *IMP(rl_tilde_expand);
53++ if (func == 0 || func == rl_tilde_expand || func == IMP(rl_tilde_expand))
54+ rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap);
55+
56+ rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
57+@@ -544,7 +561,8 @@ initialize_readline ()
58+ kseq[0] = TAB;
59+ kseq[1] = '\0';
60+ func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
61+- if (func == 0 || func == rl_tab_insert)
62++ extern rl_command_func_t *IMP(rl_tab_insert);
63++ if (func == 0 || func == rl_tab_insert || func == IMP(rl_tab_insert))
64+ rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
65+
66+ /* Tell the completer that we want a crack first. */
67+@@ -2194,6 +2212,21 @@ globword:
68+
69+ if (match && executable_completion ((searching_path ? val : cval), searching_path))
70+ {
71++#if __CYGWIN__
72++ if (completion_strip_exe)
73++ {
74++ size_t val_len = strlen (val);
75++ char *candidate;
76++ if (val_len > 4 && !strcasecmp (&val[val_len - 4], ".exe")
77++ && (candidate = strdup (val)))
78++ {
79++ candidate[val_len - 4] = '\0';
80++ if (same_file (val, candidate, NULL, NULL))
81++ temp[strlen (temp) - 4] = '\0';
82++ free (candidate);
83++ }
84++ }
85++#endif
86+ if (cval != val)
87+ free (cval);
88+ free (val);
89+@@ -2929,6 +2962,17 @@ test_for_directory (name)
90+ int r;
91+
92+ fn = bash_tilde_expand (name, 0);
93++#if __CYGWIN
94++ /* stat("//server") can only be successful as a directory, but can take
95++ seconds to time out on failure. It is much faster to assume that
96++ "//server" is a valid name than it is to wait for a stat, even if it
97++ gives false positives on bad names. */
98++ if (fn[0] == '/' && fn[1] == '/' && ! strchr (&fn[2], '/'))
99++ {
100++ free (fn);
101++ return 1;
102++ }
103++#endif
104+ r = file_isdir (fn);
105+ free (fn);
106+
107+--- origsrc/bash-4.4/builtins/read.def 2017-01-23 13:28:07.017686500 -0600
108++++ src/bash-4.4/builtins/read.def 2017-01-23 13:55:07.992877600 -0600
109+@@ -85,7 +85,6 @@ $END
110+
111+ #ifdef __CYGWIN__
112+ # include <fcntl.h>
113+-# include <io.h>
114+ #endif
115+
116+ #include "../bashintl.h"
117+@@ -530,10 +529,6 @@ read_builtin (list)
118+ fflush (stderr);
119+ }
120+
121+-#if defined (__CYGWIN__) && defined (O_TEXT)
122+- setmode (0, O_TEXT);
123+-#endif
124+-
125+ ps2 = 0;
126+ for (print_ps2 = eof = retval = 0;;)
127+ {
128+@@ -664,6 +659,14 @@ read_builtin (list)
129+ if (c == '\0' && delim != '\0')
130+ continue; /* skip NUL bytes in input */
131+
132++#ifdef __CYGWIN__
133++ {
134++ extern igncr;
135++ if (igncr && c == '\r' && delim != '\r')
136++ continue; /* skip carriage return */
137++ }
138++#endif
139++
140+ if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL))
141+ {
142+ saw_escape++;
143+--- origsrc/bash-4.4/builtins/set.def 2016-06-02 19:10:10.000000000 -0500
144++++ src/bash-4.4/builtins/set.def 2017-01-23 13:55:07.992877600 -0600
145+@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
146+ #if defined (READLINE)
147+ extern int no_line_editing;
148+ #endif /* READLINE */
149++#ifdef __CYGWIN__
150++extern int igncr;
151++static int set_minus_o_option_maybe (int, const char *, int);
152++# define INTERACTIVE_ONLY ,1
153++#else
154++# define INTERACTIVE_ONLY
155++#endif
156+
157+ $BUILTIN set
158+ $FUNCTION set_builtin
159+@@ -92,6 +99,9 @@ Options:
160+ #if defined (HISTORY)
161+ history enable command history
162+ #endif
163++#ifdef __CYGWIN__
164++ igncr on Cygwin, ignore \r in line endings
165++#endif
166+ ignoreeof the shell will not exit upon reading EOF
167+ interactive-comments
168+ allow comments to appear in interactive commands
169+@@ -192,29 +202,39 @@ const struct {
170+ int *variable;
171+ setopt_set_func_t *set_func;
172+ setopt_get_func_t *get_func;
173++#ifdef __CYGWIN__
174++ /* Cygwin users have taken to exporting SHELLOPTS for the cygwin-specific
175++ igncr. As a result, we want to ensure SHELLOPTS parsing does not turn
176++ on interactive options when exported from an interactive shell, but
177++ parse in a non-interactive setting, so as not to break POSIX /bin/sh */
178++ int interactive_only;
179++#endif
180+ } o_options[] = {
181+ { "allexport", 'a', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
182+ #if defined (BRACE_EXPANSION)
183+ { "braceexpand",'B', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
184+ #endif
185+ #if defined (READLINE)
186+- { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
187++ { "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY },
188+ #endif
189+ { "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
190+ { "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
191+ { "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
192+ { "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
193+ #if defined (BANG_HISTORY)
194+- { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
195++ { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY },
196+ #endif /* BANG_HISTORY */
197+ #if defined (HISTORY)
198+- { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
199++ { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL INTERACTIVE_ONLY },
200++#endif
201++#ifdef __CYGWIN__
202++ { "igncr", '\0', &igncr, NULL, (setopt_get_func_t *)NULL },
203+ #endif
204+ { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
205+ { "interactive-comments", '\0', &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
206+ { "keyword", 'k', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
207+ #if defined (JOB_CONTROL)
208+- { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
209++ { "monitor", 'm', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL INTERACTIVE_ONLY },
210+ #endif
211+ { "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
212+ { "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
213+@@ -233,7 +253,7 @@ const struct {
214+ { "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
215+ { "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
216+ #if defined (READLINE)
217+- { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
218++ { "vi", '\0', (int *)NULL, set_edit_mode, get_edit_mode INTERACTIVE_ONLY },
219+ #endif
220+ { "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
221+ {(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
222+@@ -455,6 +475,15 @@ int
223+ set_minus_o_option (on_or_off, option_name)
224+ int on_or_off;
225+ char *option_name;
226++#ifdef __CYGWIN__
227++{
228++ /* See Cygwin comments above. */
229++ return set_minus_o_option_maybe (on_or_off, option_name, 0);
230++}
231++static int
232++set_minus_o_option_maybe (int on_or_off, const char *option_name,
233++ int avoid_interactive)
234++#endif /* __CYGWIN__ */
235+ {
236+ register int i;
237+
238+@@ -462,6 +491,10 @@ set_minus_o_option (on_or_off, option_na
239+ {
240+ if (STREQ (option_name, o_options[i].name))
241+ {
242++#ifdef __CYGWIN__
243++ if (o_options[i].interactive_only && avoid_interactive)
244++ return EXECUTION_SUCCESS;
245++#endif
246+ if (o_options[i].letter == 0)
247+ {
248+ previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name);
249+@@ -588,7 +621,11 @@ parse_shellopts (value)
250+ vptr = 0;
251+ while (vname = extract_colon_unit (value, &vptr))
252+ {
253++#ifdef __CYGWIN__
254++ set_minus_o_option_maybe (FLAG_ON, vname, !interactive_shell);
255++#else
256+ set_minus_o_option (FLAG_ON, vname);
257++#endif
258+ free (vname);
259+ }
260+ }
261+--- origsrc/bash-4.4/builtins/shopt.def 2016-05-06 14:00:02.000000000 -0500
262++++ src/bash-4.4/builtins/shopt.def 2017-01-23 13:55:07.992877600 -0600
263+@@ -92,6 +92,10 @@ extern int glob_asciirange;
264+ extern int lastpipe_opt;
265+ extern int inherit_errexit;
266+
267++#ifdef __CYGWIN__
268++extern int completion_strip_exe;
269++#endif
270++
271+ #if defined (EXTENDED_GLOB)
272+ extern int extended_glob;
273+ #endif
274+@@ -169,6 +173,9 @@ static struct {
275+ { "compat41", &shopt_compat41, set_compatibility_level },
276+ { "compat42", &shopt_compat42, set_compatibility_level },
277+ { "compat43", &shopt_compat43, set_compatibility_level },
278++#ifdef __CYGWIN__
279++ { "completion_strip_exe", &completion_strip_exe, NULL },
280++#endif
281+ #if defined (READLINE)
282+ { "complete_fullquote", &complete_fullquote, (shopt_set_func_t *)NULL},
283+ { "direxpand", &dircomplete_expand, shopt_set_complete_direxpand },
284+--- origsrc/bash-4.4/config-top.h 2016-05-19 13:34:02.000000000 -0500
285++++ src/bash-4.4/config-top.h 2017-01-23 13:55:07.992877600 -0600
286+@@ -87,10 +87,10 @@
287+ #define DEFAULT_BASHRC "~/.bashrc"
288+
289+ /* System-wide .bashrc file for interactive shells. */
290+-/* #define SYS_BASHRC "/etc/bash.bashrc" */
291++#define SYS_BASHRC "/etc/bash.bashrc"
292+
293+ /* System-wide .bash_logout for login shells. */
294+-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
295++#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"
296+
297+ /* Define this to make non-interactive shells begun with argv[0][0] == '-'
298+ run the startup files when not in posix mode. */
299+@@ -100,7 +100,7 @@
300+ sshd and source the .bashrc if so (like the rshd behavior). This checks
301+ for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
302+ which can be fooled under certain not-uncommon circumstances. */
303+-/* #define SSH_SOURCE_BASHRC */
304++#define SSH_SOURCE_BASHRC
305+
306+ /* Define if you want the case-capitalizing operators (~[~]) and the
307+ `capcase' variable attribute (declare -c). */
308+--- origsrc/bash-4.4/doc/Makefile.in 2015-12-06 18:55:56.000000000 -0600
309++++ src/bash-4.4/doc/Makefile.in 2017-01-23 13:55:07.992877600 -0600
310+@@ -189,7 +189,7 @@ bashref.html: $(BASHREF_FILES) $(HSUSER)
311+ $(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
312+
313+ bash.info: bashref.info
314+- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
315++ ${SHELL} ${INFOPOST} < bashref.info > $@ ; \
316+
317+ bash.txt: bash.1
318+ bash.ps: bash.1
319+@@ -252,9 +252,9 @@ install: info installdirs
320+ -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
321+ -$(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir)
322+ # uncomment the next lines to install the builtins man page
323+-# sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
324+-# -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
325+-# -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
326++ sed 's:bash\.1:man1/&:' $(srcdir)/builtins.1 > $${TMPDIR:-/var/tmp}/builtins.1
327++ -$(INSTALL_DATA) $${TMPDIR:-/var/tmp}/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
328++ -$(RM) $${TMPDIR:-/var/tmp}/builtins.1
329+ -if test -f bash.info; then d=.; else d=$(srcdir); fi; \
330+ $(INSTALL_DATA) $$d/bash.info $(DESTDIR)$(infodir)/bash.info
331+ # run install-info if it is present to update the info directory
332+--- origsrc/bash-4.4/doc/bash.1 2016-08-26 08:45:17.000000000 -0500
333++++ src/bash-4.4/doc/bash.1 2017-01-23 13:55:08.008447700 -0600
334+@@ -9607,6 +9607,10 @@ filenames.
335+ This variable is set by default, which is the default bash behavior in
336+ versions through 4.2.
337+ .TP 8
338++.B completion_strip_exe
339++If set, whenever bash sees \fIfoo.exe\fP during completion, it checks if
340++\fIfoo\fP is the same file and strips the suffix.
341++.TP 8
342+ .B direxpand
343+ If set,
344+ .B bash
345+--- origsrc/bash-4.4/doc/bashref.texi 2016-09-07 16:13:36.000000000 -0500
346++++ src/bash-4.4/doc/bashref.texi 2017-01-23 13:55:08.008447700 -0600
347+@@ -5123,6 +5123,10 @@ filenames.
348+ This variable is set by default, which is the default Bash behavior in
349+ versions through 4.2.
350+
351++@item completion_strip_exe
352++If set, whenever bash sees @file{foo.exe} during completion, it checks if
353++@file{foo} is the same file and strips the suffix.
354++
355+ @item direxpand
356+ If set, Bash
357+ replaces directory names with the results of word expansion when performing
358+--- origsrc/bash-4.4/doc/builtins.1 2012-02-21 13:32:05.000000000 -0600
359++++ src/bash-4.4/doc/builtins.1 2017-01-23 13:55:08.008447700 -0600
360+@@ -19,6 +19,6 @@ shift, shopt, source, suspend, test, tim
361+ ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1)
362+ .SH BASH BUILTIN COMMANDS
363+ .nr zZ 1
364+-.so bash.1
365++.so man1/bash.1
366+ .SH SEE ALSO
367+ bash(1), sh(1)
368+--- origsrc/bash-4.4/general.c 2016-08-11 10:16:56.000000000 -0500
369++++ src/bash-4.4/general.c 2017-01-23 13:55:08.008447700 -0600
370+@@ -48,6 +48,10 @@
371+
372+ #include <tilde/tilde.h>
373+
374++#ifdef __CYGWIN__
375++# include <sys/cygwin.h>
376++#endif
377++
378+ #if !defined (errno)
379+ extern int errno;
380+ #endif /* !errno */
381+@@ -718,7 +722,8 @@ make_absolute (string, dot_path)
382+ {
383+ char pathbuf[PATH_MAX + 1];
384+
385+- cygwin_conv_to_full_posix_path (string, pathbuf);
386++ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
387++ sizeof pathbuf);
388+ result = savestring (pathbuf);
389+ }
390+ #else
391+--- origsrc/bash-4.4/input.c 2015-09-24 18:49:23.000000000 -0500
392++++ src/bash-4.4/input.c 2017-01-23 13:55:08.008447700 -0600
393+@@ -44,6 +44,10 @@
394+ #include "quit.h"
395+ #include "trap.h"
396+
397++#ifdef __CYGWIN__
398++int igncr;
399++#endif
400++
401+ #if !defined (errno)
402+ extern int errno;
403+ #endif /* !errno */
404+@@ -561,6 +565,19 @@ buffered_getchar ()
405+ {
406+ CHECK_TERMSIG;
407+
408++#ifdef __CYGWIN__
409++ /* shopt igncr discards carriage returns from the input stream.
410++ If cr is the only character left in the buffer, recurse to pick
411++ up the next byte; otherwise flatten the buffer. */
412++ if (igncr)
413++ {
414++ int ch;
415++ while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd]))
416++ == '\r')
417++ ;
418++ return ch;
419++ }
420++#endif
421+ #if !defined (DJGPP)
422+ return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
423+ #else
424+--- origsrc/bash-4.4/lib/sh/pathphys.c 2013-05-28 14:33:58.000000000 -0500
425++++ src/bash-4.4/lib/sh/pathphys.c 2017-01-23 13:55:08.008447700 -0600
426+@@ -35,6 +35,7 @@
427+ #include <stdio.h>
428+ #include <chartypes.h>
429+ #include <errno.h>
430++#include <stdlib.h>
431+
432+ #include "shell.h"
433+
434+@@ -76,6 +77,9 @@ sh_physpath (path, flags)
435+ char *path;
436+ int flags;
437+ {
438++#ifdef __CYGWIN__
439++ return realpath (path, NULL);
440++#endif
441+ char tbuf[PATH_MAX+1], linkbuf[PATH_MAX+1];
442+ char *result, *p, *q, *qsave, *qbase, *workpath;
443+ int double_slash_path, linklen, nlink;
444+@@ -214,11 +218,7 @@ error:
445+ {
446+ q = result;
447+ /* Duplicating some code here... */
448+-#if defined (__CYGWIN__)
449+- qbase = (ISALPHA((unsigned char)workpath[0]) && workpath[1] == ':') ? workpath + 3 : workpath + 1;
450+-#else
451+ qbase = workpath + 1;
452+-#endif
453+ double_slash_path = DOUBLE_SLASH (workpath);
454+ qbase += double_slash_path;
455+
456+--- origsrc/bash-4.4/lib/sh/tmpfile.c 2016-08-11 10:05:58.000000000 -0500
457++++ src/bash-4.4/lib/sh/tmpfile.c 2017-01-23 13:55:08.008447700 -0600
458+@@ -101,7 +101,7 @@ get_tmpdir (flags)
459+ if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX))
460+ tdir = 0;
461+
462+- if (tdir == 0)
463++ if (tdir == 0 || !file_iswdir (tdir))
464+ tdir = get_sys_tmpdir ();
465+
466+ #if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX)
467+--- origsrc/bash-4.4/mksyntax.c 2012-07-29 18:48:38.000000000 -0500
468++++ src/bash-4.4/mksyntax.c 2017-01-23 13:55:08.008447700 -0600
469+@@ -29,13 +29,13 @@
470+
471+ #ifdef HAVE_UNISTD_H
472+ # include <unistd.h>
473++#else
474++extern int optind;
475++extern char *optarg;
476+ #endif
477+
478+ #include "syntax.h"
479+
480+-extern int optind;
481+-extern char *optarg;
482+-
483+ #ifndef errno
484+ extern int errno;
485+ #endif
486+--- origsrc/bash-4.4/parse.y 2016-09-11 10:31:46.000000000 -0500
487++++ src/bash-4.4/parse.y 2017-01-23 13:55:08.008447700 -0600
488+@@ -1539,14 +1539,20 @@ yy_string_get ()
489+ string = bash_input.location.string;
490+
491+ /* If the string doesn't exist, or is empty, EOF found. */
492+- if (string && *string)
493++ while (string && *string)
494+ {
495+ c = *string++;
496+ bash_input.location.string = string;
497++#ifdef __CYGWIN__
498++ {
499++ extern int igncr;
500++ if (igncr && c == '\r')
501++ continue;
502++ }
503++#endif
504+ return (c);
505+ }
506+- else
507+- return (EOF);
508++ return (EOF);
509+ }
510+
511+ static int
512+--- origsrc/bash-4.4/subst.c 2017-01-23 13:28:06.955247200 -0600
513++++ src/bash-4.4/subst.c 2017-01-23 13:55:08.008447700 -0600
514+@@ -43,6 +43,7 @@
515+ #include "posixstat.h"
516+ #include "bashintl.h"
517+
518++#define NEED_SH_SETLINEBUF_DECL
519+ #include "shell.h"
520+ #include "parser.h"
521+ #include "flags.h"
522+@@ -5964,6 +5965,13 @@ read_comsub (fd, quoted, rflag)
523+ #endif
524+ continue;
525+ }
526++#ifdef __CYGWIN__
527++ {
528++ extern int igncr;
529++ if (igncr && c == '\r')
530++ continue;
531++ }
532++#endif
533+
534+ /* Add the character to ISTRING, possibly after resizing it. */
535+ RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
536+@@ -6088,6 +6096,28 @@ command_substitute (string, quoted)
537+ goto error_exit;
538+ }
539+
540++#ifdef __CYGWIN__
541++ /* Passing a pipe through std fds can cause hangs when talking to a
542++ non-cygwin child. Move it. */
543++ if (fildes[0] < 3)
544++ {
545++ int fd = fcntl (fildes[0], F_DUPFD, 3);
546++ close (fildes[0]);
547++ fildes[0] = fd;
548++ }
549++ if (fildes[1] < 3)
550++ {
551++ int fd = fcntl (fildes[1], F_DUPFD, 3);
552++ close (fildes[1]);
553++ fildes[1] = fd;
554++ }
555++ if (fildes[0] < 0 || fildes[1] < 0)
556++ {
557++ sys_error (_("cannot make pipe for command substitution"));
558++ goto error_exit;
559++ }
560++#endif /* __CYGWIN__ */
561++
562+ old_pid = last_made_pid;
563+ #if defined (JOB_CONTROL)
564+ old_pipeline_pgrp = pipeline_pgrp;
565+--- origsrc/bash-4.4/support/bashversion.c 2008-09-09 08:31:53.000000000 -0500
566++++ src/bash-4.4/support/bashversion.c 2017-01-23 13:55:08.024037200 -0600
567+@@ -26,6 +26,9 @@
568+
569+ #if defined (HAVE_UNISTD_H)
570+ # include <unistd.h>
571++#else
572++extern int optind;
573++extern char *optarg;
574+ #endif
575+
576+ #include "bashansi.h"
577+@@ -41,9 +44,6 @@
578+ #define LFLAG 0x0020
579+ #define XFLAG 0x0040
580+
581+-extern int optind;
582+-extern char *optarg;
583+-
584+ extern char *dist_version;
585+ extern int patch_level;
586+
587+--- origsrc/bash-4.4/support/mkversion.sh 2008-08-13 07:25:57.000000000 -0500
588++++ src/bash-4.4/support/mkversion.sh 2017-01-23 13:55:08.024037200 -0600
589+@@ -29,7 +29,7 @@ source_dir="."
590+ while [ $# -gt 0 ]; do
591+ case "$1" in
592+ -o) shift; OUTFILE=$1; shift ;;
593+- -b) shift; inc_build=yes ;;
594++ -b) shift; ;; # inc_build=yes ;; # hacked out for cygport
595+ -s) shift; rel_status=$1; shift ;;
596+ -p) shift; patch_level=$1; shift ;;
597+ -d) shift; dist_version=$1; shift ;;
598+--- origsrc/bash-4.4/variables.c 2016-06-15 15:05:52.000000000 -0500
599++++ src/bash-4.4/variables.c 2017-01-23 13:55:08.024037200 -0600
600+@@ -5239,6 +5239,7 @@ sv_winsize (name)
601+ /* Update the value of HOME in the export environment so tilde expansion will
602+ work on cygwin. */
603+ #if defined (__CYGWIN__)
604++void
605+ sv_home (name)
606+ char *name;
607+ {
pkgs/stdenv/cygwin/rebase-i686.sh+3−3
@@ -1,10 +1,10 @@
1−postFixupHooks+=(_cygwinFixAutoImageBase)
1+fixupOutputHooks+=(_cygwinFixAutoImageBase)
22
33_cygwinFixAutoImageBase() {
4− if [ "$dontRebase" == 1 ]; then
4+ if [ "$dontRebase" == 1 ] || [ ! -d "$prefix" ]; then
55 return
66 fi
7− find $out -name "*.dll" | while read DLL; do
7+ find "$prefix" -name "*.dll" -type f | while read DLL; do
88 if [ -f /etc/rebasenix.nextbase ]; then
99 NEXTBASE="$(</etc/rebasenix.nextbase)"
1010 fi
pkgs/stdenv/cygwin/rebase-x86_64.sh+3−3
@@ -1,10 +1,10 @@
1−postFixupHooks+=(_cygwinFixAutoImageBase)
1+fixupOutputHooks+=(_cygwinFixAutoImageBase)
22
33_cygwinFixAutoImageBase() {
4− if [ "$dontRebase" == 1 ]; then
4+ if [ "$dontRebase" == 1 ] || [ ! -d "$prefix" ]; then
55 return
66 fi
7− find $out -name "*.dll" | while read DLL; do
7+ find "$prefix" -name "*.dll" -type f | while read DLL; do
88 if [ -f /etc/rebasenix.nextbase ]; then
99 NEXTBASE="$(</etc/rebasenix.nextbase)"
1010 fi
pkgs/stdenv/native/default.nix+1−1
@@ -102,7 +102,7 @@ let
102102
103103 fetchurlBoot = fetchurl;
104104
105− inherit system shell cc overrides config;
105+ inherit shell cc overrides config;
106106 };
107107
108108in
pkgs/tools/compression/gzip/default.nix−4
@@ -15,10 +15,6 @@ stdenv.mkDerivation rec {
1515
1616 nativeBuildInputs = [ xz.bin ];
1717
18− preConfigure = if stdenv.isCygwin then ''
19− sed -i lib/fpending.h -e 's,include <stdio_ext.h>,,'
20− '' else null;
21−
2218 # In stdenv-linux, prevent a dependency on bootstrap-tools.
2319 makeFlags = "SHELL=/bin/sh GREP=grep";
2420
pkgs/top-level/perl-packages.nix+1
@@ -7753,6 +7753,7 @@ let self = _self // overrides; _self = with self; {
77537753 url = mirror://cpan/authors/id/P/PV/PVANDRY/gettext-1.05.tar.gz;
77547754 sha256 = "15262a00vx714szpx8p2z52wxkz46xp7acl72znwjydyq4ypydi7";
77557755 };
7756+ LANG="C";
77567757 };
77577758
77587759 LocaleMaketext = buildPerlPackage {