]>
Commit | Line | Data |
---|---|---|
fb190a04 | 1 | |
746f4007 RM |
2 | ### Sanity checks for Mach header installation |
3 | ac_safe=`echo "mach/mach_types.h" | sed 'y%./+-%__p_%'` | |
4 | echo $ac_n "checking for mach/mach_types.h""... $ac_c" 1>&6 | |
5 | echo "configure:6: checking for mach/mach_types.h" >&5 | |
6 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
7 | echo $ac_n "(cached) $ac_c" 1>&6 | |
8 | else | |
9 | cat > conftest.$ac_ext <<EOF | |
10 | #line 11 "configure" | |
11 | #include "confdefs.h" | |
12 | #include <mach/mach_types.h> | |
13 | EOF | |
14 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
15 | { (eval echo configure:16: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
16 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
17 | if test -z "$ac_err"; then | |
18 | rm -rf conftest* | |
19 | eval "ac_cv_header_$ac_safe=yes" | |
20 | else | |
21 | echo "$ac_err" >&5 | |
22 | echo "configure: failed program was:" >&5 | |
23 | cat conftest.$ac_ext >&5 | |
24 | rm -rf conftest* | |
25 | eval "ac_cv_header_$ac_safe=no" | |
26 | fi | |
27 | rm -f conftest* | |
28 | fi | |
29 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
30 | echo "$ac_t""yes" 1>&6 | |
31 | : | |
32 | else | |
33 | echo "$ac_t""no" 1>&6 | |
34 | { echo "configure: error: cannot find Mach headers" 1>&2; exit 1; } | |
35 | fi | |
36 | ||
37 | ac_safe=`echo "mach/mach_types.defs" | sed 'y%./+-%__p_%'` | |
38 | echo $ac_n "checking for mach/mach_types.defs""... $ac_c" 1>&6 | |
39 | echo "configure:40: checking for mach/mach_types.defs" >&5 | |
40 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
41 | echo $ac_n "(cached) $ac_c" 1>&6 | |
42 | else | |
43 | cat > conftest.$ac_ext <<EOF | |
44 | #line 45 "configure" | |
45 | #include "confdefs.h" | |
46 | #include <mach/mach_types.defs> | |
47 | EOF | |
48 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
49 | { (eval echo configure:50: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
50 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
51 | if test -z "$ac_err"; then | |
52 | rm -rf conftest* | |
53 | eval "ac_cv_header_$ac_safe=yes" | |
54 | else | |
55 | echo "$ac_err" >&5 | |
56 | echo "configure: failed program was:" >&5 | |
57 | cat conftest.$ac_ext >&5 | |
58 | rm -rf conftest* | |
59 | eval "ac_cv_header_$ac_safe=no" | |
60 | fi | |
61 | rm -f conftest* | |
62 | fi | |
63 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
64 | echo "$ac_t""yes" 1>&6 | |
65 | : | |
66 | else | |
67 | echo "$ac_t""no" 1>&6 | |
68 | { echo "configure: error: cannot find Mach .defs files" 1>&2; exit 1; } | |
69 | fi | |
70 | ||
71 | ||
fb190a04 RM |
72 | |
73 | ||
74 | echo $ac_n "checking for task_t in mach/mach_types.h""... $ac_c" 1>&6 | |
746f4007 | 75 | echo "configure:76: checking for task_t in mach/mach_types.h" >&5 |
fb190a04 RM |
76 | if eval "test \"`echo '$''{'libc_cv_mach_task_t'+set}'`\" = set"; then |
77 | echo $ac_n "(cached) $ac_c" 1>&6 | |
78 | else | |
79 | cat > conftest.$ac_ext <<EOF | |
746f4007 | 80 | #line 81 "configure" |
fb190a04 RM |
81 | #include "confdefs.h" |
82 | #include <mach/mach_types.h> | |
83 | int main() { | |
84 | extern task_t foo; | |
85 | ; return 0; } | |
86 | EOF | |
746f4007 | 87 | if { (eval echo configure:88: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then |
fb190a04 RM |
88 | rm -rf conftest* |
89 | libc_cv_mach_task_t=task_t | |
90 | else | |
91 | echo "configure: failed program was:" >&5 | |
92 | cat conftest.$ac_ext >&5 | |
93 | rm -rf conftest* | |
94 | libc_cv_mach_task_t=task_port_t | |
95 | fi | |
96 | rm -f conftest* | |
97 | fi | |
98 | ||
99 | echo "$ac_t""$libc_cv_mach_task_t" 1>&6 | |
100 | if test $libc_cv_mach_task_t != task_t; then | |
101 | DEFINES="$DEFINES -Dtask_t=task_port_t" | |
102 | fi | |
103 | echo $ac_n "checking for thread_t in mach/mach_types.h""... $ac_c" 1>&6 | |
746f4007 | 104 | echo "configure:105: checking for thread_t in mach/mach_types.h" >&5 |
fb190a04 RM |
105 | if eval "test \"`echo '$''{'libc_cv_mach_thread_t'+set}'`\" = set"; then |
106 | echo $ac_n "(cached) $ac_c" 1>&6 | |
107 | else | |
108 | cat > conftest.$ac_ext <<EOF | |
746f4007 | 109 | #line 110 "configure" |
fb190a04 RM |
110 | #include "confdefs.h" |
111 | #include <mach/mach_types.h> | |
112 | int main() { | |
113 | extern thread_t foo; | |
114 | ; return 0; } | |
115 | EOF | |
746f4007 | 116 | if { (eval echo configure:117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then |
fb190a04 RM |
117 | rm -rf conftest* |
118 | libc_cv_mach_thread_t=thread_t | |
119 | else | |
120 | echo "configure: failed program was:" >&5 | |
121 | cat conftest.$ac_ext >&5 | |
122 | rm -rf conftest* | |
123 | libc_cv_mach_thread_t=thread_port_t | |
124 | fi | |
125 | rm -f conftest* | |
126 | fi | |
127 | ||
128 | echo "$ac_t""$libc_cv_mach_thread_t" 1>&6 | |
129 | if test $libc_cv_mach_thread_t != thread_t; then | |
130 | DEFINES="$DEFINES -Dthread_t=thread_port_t" | |
131 | fi | |
132 | ||
133 | echo $ac_n "checking for creation_time in task_basic_info""... $ac_c" 1>&6 | |
746f4007 | 134 | echo "configure:135: checking for creation_time in task_basic_info" >&5 |
fb190a04 RM |
135 | if eval "test \"`echo '$''{'libc_cv_mach_task_creation_time'+set}'`\" = set"; then |
136 | echo $ac_n "(cached) $ac_c" 1>&6 | |
137 | else | |
138 | cat > conftest.$ac_ext <<EOF | |
746f4007 | 139 | #line 140 "configure" |
fb190a04 RM |
140 | #include "confdefs.h" |
141 | #include <mach/task_info.h> | |
142 | int main() { | |
143 | ||
144 | extern struct task_basic_info *i; | |
145 | long s = i->creation_time.seconds; | |
146 | ||
147 | ; return 0; } | |
148 | EOF | |
746f4007 | 149 | if { (eval echo configure:150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then |
fb190a04 RM |
150 | rm -rf conftest* |
151 | libc_cv_mach_task_creation_time=yes | |
152 | else | |
153 | echo "configure: failed program was:" >&5 | |
154 | cat conftest.$ac_ext >&5 | |
155 | rm -rf conftest* | |
156 | libc_cv_mach_task_creation_time=no | |
157 | fi | |
158 | rm -f conftest* | |
159 | fi | |
160 | ||
161 | echo "$ac_t""$libc_cv_mach_task_creation_time" 1>&6 | |
162 | if test $libc_cv_mach_task_creation_time = no; then | |
163 | DEFINES="$DEFINES -DNO_CREATION_TIME=1" | |
164 | fi | |
746f4007 RM |
165 | |
166 | mach_interface_list= | |
167 | for ifc in mach mach4 \ | |
3a2832a0 | 168 | clock clock_priv host_priv host_security ledger lock_set \ |
746f4007 RM |
169 | processor processor_set task thread_act vm_map \ |
170 | memory_object memory_object_default default_pager \ | |
171 | ; do | |
172 | ac_safe=`echo "mach/${ifc}.defs" | sed 'y%./+-%__p_%'` | |
173 | echo $ac_n "checking for mach/${ifc}.defs""... $ac_c" 1>&6 | |
174 | echo "configure:175: checking for mach/${ifc}.defs" >&5 | |
175 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
176 | echo $ac_n "(cached) $ac_c" 1>&6 | |
177 | else | |
178 | cat > conftest.$ac_ext <<EOF | |
179 | #line 180 "configure" | |
180 | #include "confdefs.h" | |
181 | #include <mach/${ifc}.defs> | |
182 | EOF | |
183 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
184 | { (eval echo configure:185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
185 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
186 | if test -z "$ac_err"; then | |
187 | rm -rf conftest* | |
188 | eval "ac_cv_header_$ac_safe=yes" | |
189 | else | |
190 | echo "$ac_err" >&5 | |
191 | echo "configure: failed program was:" >&5 | |
192 | cat conftest.$ac_ext >&5 | |
193 | rm -rf conftest* | |
194 | eval "ac_cv_header_$ac_safe=no" | |
195 | fi | |
196 | rm -f conftest* | |
197 | fi | |
198 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
199 | echo "$ac_t""yes" 1>&6 | |
200 | mach_interface_list="$mach_interface_list $ifc" | |
201 | else | |
202 | echo "$ac_t""no" 1>&6 | |
203 | fi | |
204 | ||
205 | done | |
206 | if test "x$mach_interface_list" = x; then | |
207 | { echo "configure: error: what manner of Mach is this?" 1>&2; exit 1; } | |
208 | fi | |
209 | ||
210 | echo $ac_n "checking for host_page_size in mach_host.defs""... $ac_c" 1>&6 | |
211 | echo "configure:212: checking for host_page_size in mach_host.defs" >&5 | |
212 | if eval "test \"`echo '$''{'libc_cv_mach_host_page_size'+set}'`\" = set"; then | |
213 | echo $ac_n "(cached) $ac_c" 1>&6 | |
214 | else | |
215 | cat > conftest.$ac_ext <<EOF | |
216 | #line 217 "configure" | |
217 | #include "confdefs.h" | |
218 | #include <mach/mach_host.defs> | |
219 | EOF | |
220 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | | |
221 | egrep "host_page_size" >/dev/null 2>&1; then | |
222 | rm -rf conftest* | |
223 | libc_cv_mach_host_page_size=yes | |
224 | else | |
225 | rm -rf conftest* | |
226 | libc_cv_mach_host_page_size=no | |
227 | fi | |
228 | rm -f conftest* | |
229 | ||
230 | fi | |
231 | ||
232 | echo "$ac_t""$libc_cv_mach_host_page_size" 1>&6 | |
233 | if test $libc_cv_mach_host_page_size = yes; then | |
234 | cat >> confdefs.h <<\EOF | |
235 | #define HAVE_HOST_PAGE_SIZE 1 | |
236 | EOF | |
237 | ||
238 | fi | |
21297437 RM |
239 | |
240 | ac_safe=`echo "mach/machine/ndr_def.h" | sed 'y%./+-%__p_%'` | |
241 | echo $ac_n "checking for mach/machine/ndr_def.h""... $ac_c" 1>&6 | |
242 | echo "configure:243: checking for mach/machine/ndr_def.h" >&5 | |
243 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
244 | echo $ac_n "(cached) $ac_c" 1>&6 | |
245 | else | |
246 | cat > conftest.$ac_ext <<EOF | |
247 | #line 248 "configure" | |
248 | #include "confdefs.h" | |
249 | #include <mach/machine/ndr_def.h> | |
250 | EOF | |
251 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
252 | { (eval echo configure:253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
253 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
254 | if test -z "$ac_err"; then | |
255 | rm -rf conftest* | |
256 | eval "ac_cv_header_$ac_safe=yes" | |
257 | else | |
258 | echo "$ac_err" >&5 | |
259 | echo "configure: failed program was:" >&5 | |
260 | cat conftest.$ac_ext >&5 | |
261 | rm -rf conftest* | |
262 | eval "ac_cv_header_$ac_safe=no" | |
263 | fi | |
264 | rm -f conftest* | |
265 | fi | |
266 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
267 | echo "$ac_t""yes" 1>&6 | |
268 | DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'" | |
269 | else | |
270 | echo "$ac_t""no" 1>&6 | |
271 | ac_safe=`echo "machine/ndr_def.h" | sed 'y%./+-%__p_%'` | |
272 | echo $ac_n "checking for machine/ndr_def.h""... $ac_c" 1>&6 | |
273 | echo "configure:274: checking for machine/ndr_def.h" >&5 | |
274 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
275 | echo $ac_n "(cached) $ac_c" 1>&6 | |
276 | else | |
277 | cat > conftest.$ac_ext <<EOF | |
278 | #line 279 "configure" | |
279 | #include "confdefs.h" | |
280 | #include <machine/ndr_def.h> | |
281 | EOF | |
282 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
283 | { (eval echo configure:284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
284 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
285 | if test -z "$ac_err"; then | |
286 | rm -rf conftest* | |
287 | eval "ac_cv_header_$ac_safe=yes" | |
288 | else | |
289 | echo "$ac_err" >&5 | |
290 | echo "configure: failed program was:" >&5 | |
291 | cat conftest.$ac_ext >&5 | |
292 | rm -rf conftest* | |
293 | eval "ac_cv_header_$ac_safe=no" | |
294 | fi | |
295 | rm -f conftest* | |
296 | fi | |
297 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
298 | echo "$ac_t""yes" 1>&6 | |
299 | DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'" | |
300 | else | |
301 | echo "$ac_t""no" 1>&6 | |
302 | fi | |
303 | ||
304 | fi | |
305 |