summaryrefslogtreecommitdiff
path: root/shells/zsh/patches/patch-ac
blob: 7ccfb2c9d8734344fb7e3063637b2e362778f244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
$NetBSD: patch-ac,v 1.29 2013/05/10 01:17:33 riastradh Exp $

First chunk:
Add support for thread limits.
From Peter Stephenson <Peter.Stephenson@csr.com> on zsh-workers.
Accepted by Peter Stephenson <p.w.stephenson@ntlworld.com> on
zsh-workers on 2012-08-16.

Middle chunks:
Use a compile test, not a run test, for whether various rlimit values
are equivalent.  A compile test is sufficient because zsh uses these
values in switch cases, so they must be compile-time, if not
preprocessor-time, constants.

Last chunk:
Make this package build on Interix.  Patches provided by Hiramatsu
Yoshifumi in PR pkg/25946.
Last chunk only:
Don't force -Wl,--whole-archive for NetBSD, it breaks the build with
clang, which doesn't have a reason to disable it again.
Accepted by Peter Stephenson <p.w.stephenson@ntlworld.com> on
zsh-workers on 2012-08-16.

--- configure.orig	2012-09-15 20:13:14.000000000 +0000
+++ configure
@@ -9645,6 +9645,42 @@ if test $zsh_cv_have_RLIMIT_NTHR = yes; 
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NTHR" >&5
+$as_echo_n "checking for limit RLIMIT_NTHR... " >&6; }
+if ${zsh_cv_have_RLIMIT_NTHR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <sys/resource.h>
+int
+main ()
+{
+RLIMIT_NTHR
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  zsh_cv_have_RLIMIT_NTHR=yes
+else
+  zsh_cv_have_RLIMIT_NTHR=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NTHR" >&5
+$as_echo "$zsh_cv_have_RLIMIT_NTHR" >&6; }
+
+if test $zsh_cv_have_RLIMIT_NTHR = yes; then
+  $as_echo "#define HAVE_RLIMIT_NTHR 1" >>confdefs.h
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NOFILE" >&5
 $as_echo_n "checking for limit RLIMIT_NOFILE... " >&6; }
 if ${zsh_cv_have_RLIMIT_NOFILE+:} false; then :
@@ -10011,9 +10047,6 @@ $as_echo_n "checking if RLIMIT_VMEM and 
 if ${zsh_cv_rlimit_vmem_is_rss+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  zsh_cv_rlimit_vmem_is_rss=no
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -10022,43 +10055,33 @@ else
 #include <sys/time.h>
 #endif
 #include <sys/resource.h>
-int main()
+int
+main ()
 {
-int ret = 1;
-#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_RSS)
-if (RLIMIT_RSS == RLIMIT_VMEM) ret = 0;
-#endif
-return ret;
+static char x[(RLIMIT_VMEM == RLIMIT_RSS)? 1 : -1]
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
   zsh_cv_rlimit_vmem_is_rss=yes
 else
   zsh_cv_rlimit_vmem_is_rss=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_rss" >&5
 $as_echo "$zsh_cv_rlimit_vmem_is_rss" >&6; }
-
 if test x$zsh_cv_rlimit_vmem_is_rss = xyes; then
   $as_echo "#define RLIMIT_VMEM_IS_RSS 1" >>confdefs.h
 
 fi
 
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_VMEM and RLIMIT_AS are the same" >&5
 $as_echo_n "checking if RLIMIT_VMEM and RLIMIT_AS are the same... " >&6; }
 if ${zsh_cv_rlimit_vmem_is_as+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  zsh_cv_rlimit_vmem_is_as=no
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -10067,43 +10090,33 @@ else
 #include <sys/time.h>
 #endif
 #include <sys/resource.h>
-int main()
+int
+main ()
 {
-int ret = 1;
-#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_AS)
-if (RLIMIT_AS == RLIMIT_VMEM) ret = 0;
-#endif
-return ret;
+static char x[(RLIMIT_VMEM == RLIMIT_AS)? 1 : -1]
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
   zsh_cv_rlimit_vmem_is_as=yes
 else
   zsh_cv_rlimit_vmem_is_as=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_as" >&5
 $as_echo "$zsh_cv_rlimit_vmem_is_as" >&6; }
-
 if test x$zsh_cv_rlimit_vmem_is_as = xyes; then
   $as_echo "#define RLIMIT_VMEM_IS_AS 1" >>confdefs.h
 
 fi
 
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_RSS and RLIMIT_AS are the same" >&5
 $as_echo_n "checking if RLIMIT_RSS and RLIMIT_AS are the same... " >&6; }
 if ${zsh_cv_rlimit_rss_is_as+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  zsh_cv_rlimit_rss_is_as=no
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -10112,28 +10125,23 @@ else
 #include <sys/time.h>
 #endif
 #include <sys/resource.h>
-int main()
+int
+main ()
 {
-int ret = 1;
-#if defined(HAVE_RLIMIT_RSS) && defined(HAVE_RLIMIT_AS)
-if (RLIMIT_AS == RLIMIT_RSS) ret = 0;
-#endif
-return ret;
+static char x[(RLIMIT_RSS == RLIMIT_AS)? 1 : -1]
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
   zsh_cv_rlimit_rss_is_as=yes
 else
   zsh_cv_rlimit_rss_is_as=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_rss_is_as" >&5
 $as_echo "$zsh_cv_rlimit_rss_is_as" >&6; }
-
 if test x$zsh_cv_rlimit_rss_is_as = xyes; then
   $as_echo "#define RLIMIT_RSS_IS_AS 1" >>confdefs.h
 
@@ -11630,6 +11638,10 @@ $as_echo "$zsh_cv_sys_elf" >&6; }
         DLLD="${DLLD=$CC}"
         DLLDARG=""
       ;;
+      *interix*)
+        DLLD="${DLLD=$CC}"
+        DLLDARG=""
+      ;;
       * )
 	DLLD="${DLLD=ld}"
 	DLLDARG=""
@@ -11659,7 +11699,7 @@ $as_echo "$zsh_cv_sys_elf" >&6; }
     sunos*)       DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;;
     sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;;
     aix*)         DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;;
-    solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;;
+    solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;;
     darwin*)      DLLDFLAGS="${DLLDFLAGS=-bundle -flat_namespace -undefined suppress}" ;;
     beos*|haiku*) DLLDFLAGS="${DLLDFLAGS=-nostart}" ;;
     openbsd*)