File: getcontext-0.8.3

package info (click to toggle)
sigscheme 0.8.5-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,916 kB
  • ctags: 8,271
  • sloc: lisp: 37,498; ansic: 31,011; sh: 10,329; makefile: 749; asm: 333; ruby: 288
file content (254 lines) | stat: -rw-r--r-- 7,451 bytes parent folder | download | duplicates (3)
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
Description: Upstream changes by gniibe, not to use AX_FUNC_GETCONTEXT
	Some architectures has stub for getcontext, so we just use CHECK_FUNCS
Author: NIIBE Yutaka <gniibe@fsij.org>
Last-Update: 2011-02-15

Index: sigscheme-0.8.5/configure.in
===================================================================
--- sigscheme-0.8.5.orig/configure.in	2011-02-15 16:55:01.000000000 +0900
+++ sigscheme-0.8.5/configure.in	2011-02-15 16:55:02.000000000 +0900
@@ -202,10 +202,10 @@
 # Checks for library functions
 #
 
-AX_FUNC_GETCONTEXT
+# AX_FUNC_GETCONTEXT
 AX_FUNC_SIGSETJMP
 
-AC_CHECK_FUNCS([strtoll strtoimax \
+AC_CHECK_FUNCS([getcontext strtoll strtoimax \
                 memalign \
                 fileno getcwd getpagesize])
 
Index: sigscheme-0.8.5/configure
===================================================================
--- sigscheme-0.8.5.orig/configure	2011-02-15 16:55:01.000000000 +0900
+++ sigscheme-0.8.5/configure	2011-02-15 16:55:02.000000000 +0900
@@ -30139,71 +30139,7 @@
 # Checks for library functions
 #
 
-
-  { $as_echo "$as_me:$LINENO: checking for getcontext" >&5
-$as_echo_n "checking for getcontext... " >&6; }
-if test "${ax_cv_func_getcontext+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ucontext.h>
-int
-main ()
-{
-ucontext_t ctx;
-                                      return getcontext(&ctx);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ax_cv_func_getcontext=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ax_cv_func_getcontext=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ax_cv_func_getcontext" >&5
-$as_echo "$ax_cv_func_getcontext" >&6; }
-  if test "x$ax_cv_func_getcontext" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETCONTEXT 1
-_ACEOF
-
-  fi
-
+# AX_FUNC_GETCONTEXT
 
   { $as_echo "$as_me:$LINENO: checking for sigsetjmp" >&5
 $as_echo_n "checking for sigsetjmp... " >&6; }
@@ -30278,7 +30214,8 @@
 
 
 
-for ac_func in strtoll strtoimax \
+
+for ac_func in getcontext strtoll strtoimax \
                 memalign \
                 fileno getcwd getpagesize
 do
Index: sigscheme-0.8.5/libgcroots/configure.ac
===================================================================
--- sigscheme-0.8.5.orig/libgcroots/configure.ac	2011-02-15 16:55:01.000000000 +0900
+++ sigscheme-0.8.5/libgcroots/configure.ac	2011-02-15 16:55:02.000000000 +0900
@@ -376,7 +376,8 @@
 AC_SUBST(INCLUDES)
 AC_SUBST(CXXINCLUDES)
 
-AX_FUNC_GETCONTEXT
+# AX_FUNC_GETCONTEXT
+AC_CHECK_FUNCS([getcontext])
 
 # Configuration of shared libraries
 #
Index: sigscheme-0.8.5/libgcroots/configure
===================================================================
--- sigscheme-0.8.5.orig/libgcroots/configure	2011-02-15 16:55:01.000000000 +0900
+++ sigscheme-0.8.5/libgcroots/configure	2011-02-15 16:55:02.000000000 +0900
@@ -8279,15 +8279,15 @@
 
 
 
+# AX_FUNC_GETCONTEXT
 
-
-
-
-
-  { $as_echo "$as_me:$LINENO: checking for getcontext" >&5
-$as_echo_n "checking for getcontext... " >&6; }
-if test "${ax_cv_func_getcontext+set}" = set; then
-  $as_echo_n "(cached) " >&6
+for ac_func in getcontext
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -8295,12 +8295,41 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <ucontext.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
 int
 main ()
 {
-ucontext_t ctx;
-                                      return getcontext(&ctx);
+return $ac_func ();
   ;
   return 0;
 }
@@ -8311,42 +8340,39 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ax_cv_func_getcontext=yes
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ax_cv_func_getcontext=no
+	eval "$as_ac_var=no"
 fi
 
-rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ax_cv_func_getcontext" >&5
-$as_echo "$ax_cv_func_getcontext" >&6; }
-  if test "x$ax_cv_func_getcontext" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETCONTEXT 1
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-  fi
+fi
+done
 
 
 # Configuration of shared libraries