]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/mach/configure
* hurd/hurdselect.c (_hurd_select): Fix
[thirdparty/glibc.git] / sysdeps / mach / configure
1
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
72
73
74 echo $ac_n "checking for task_t in mach/mach_types.h""... $ac_c" 1>&6
75 echo "configure:76: checking for task_t in mach/mach_types.h" >&5
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
80 #line 81 "configure"
81 #include "confdefs.h"
82 #include <mach/mach_types.h>
83 int main() {
84 extern task_t foo;
85 ; return 0; }
86 EOF
87 if { (eval echo configure:88: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
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
104 echo "configure:105: checking for thread_t in mach/mach_types.h" >&5
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
109 #line 110 "configure"
110 #include "confdefs.h"
111 #include <mach/mach_types.h>
112 int main() {
113 extern thread_t foo;
114 ; return 0; }
115 EOF
116 if { (eval echo configure:117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
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
134 echo "configure:135: checking for creation_time in task_basic_info" >&5
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
139 #line 140 "configure"
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
149 if { (eval echo configure:150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
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
165
166 mach_interface_list=
167 for ifc in mach mach4 \
168 clock clock_priv host_priv host_security ledger lock_set \
169 processor processor_set task thread_act vm_map \
170 memory_object memory_object_default default_pager \
171 i386/mach_i386 \
172 ; do
173 ac_safe=`echo "mach/${ifc}.defs" | sed 'y%./+-%__p_%'`
174 echo $ac_n "checking for mach/${ifc}.defs""... $ac_c" 1>&6
175 echo "configure:176: checking for mach/${ifc}.defs" >&5
176 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
177 echo $ac_n "(cached) $ac_c" 1>&6
178 else
179 cat > conftest.$ac_ext <<EOF
180 #line 181 "configure"
181 #include "confdefs.h"
182 #include <mach/${ifc}.defs>
183 EOF
184 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
185 { (eval echo configure:186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
186 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
187 if test -z "$ac_err"; then
188 rm -rf conftest*
189 eval "ac_cv_header_$ac_safe=yes"
190 else
191 echo "$ac_err" >&5
192 echo "configure: failed program was:" >&5
193 cat conftest.$ac_ext >&5
194 rm -rf conftest*
195 eval "ac_cv_header_$ac_safe=no"
196 fi
197 rm -f conftest*
198 fi
199 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
200 echo "$ac_t""yes" 1>&6
201 mach_interface_list="$mach_interface_list $ifc"
202 else
203 echo "$ac_t""no" 1>&6
204 fi
205
206 done
207 if test "x$mach_interface_list" = x; then
208 { echo "configure: error: what manner of Mach is this?" 1>&2; exit 1; }
209 fi
210
211 echo $ac_n "checking for host_page_size in mach_host.defs""... $ac_c" 1>&6
212 echo "configure:213: checking for host_page_size in mach_host.defs" >&5
213 if eval "test \"`echo '$''{'libc_cv_mach_host_page_size'+set}'`\" = set"; then
214 echo $ac_n "(cached) $ac_c" 1>&6
215 else
216 cat > conftest.$ac_ext <<EOF
217 #line 218 "configure"
218 #include "confdefs.h"
219 #include <mach/mach_host.defs>
220 EOF
221 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
222 egrep "host_page_size" >/dev/null 2>&1; then
223 rm -rf conftest*
224 libc_cv_mach_host_page_size=yes
225 else
226 rm -rf conftest*
227 libc_cv_mach_host_page_size=no
228 fi
229 rm -f conftest*
230
231 fi
232
233 echo "$ac_t""$libc_cv_mach_host_page_size" 1>&6
234 if test $libc_cv_mach_host_page_size = yes; then
235 cat >> confdefs.h <<\EOF
236 #define HAVE_HOST_PAGE_SIZE 1
237 EOF
238
239 fi
240
241 ac_safe=`echo "mach/machine/ndr_def.h" | sed 'y%./+-%__p_%'`
242 echo $ac_n "checking for mach/machine/ndr_def.h""... $ac_c" 1>&6
243 echo "configure:244: checking for mach/machine/ndr_def.h" >&5
244 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
245 echo $ac_n "(cached) $ac_c" 1>&6
246 else
247 cat > conftest.$ac_ext <<EOF
248 #line 249 "configure"
249 #include "confdefs.h"
250 #include <mach/machine/ndr_def.h>
251 EOF
252 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
253 { (eval echo configure:254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
254 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
255 if test -z "$ac_err"; then
256 rm -rf conftest*
257 eval "ac_cv_header_$ac_safe=yes"
258 else
259 echo "$ac_err" >&5
260 echo "configure: failed program was:" >&5
261 cat conftest.$ac_ext >&5
262 rm -rf conftest*
263 eval "ac_cv_header_$ac_safe=no"
264 fi
265 rm -f conftest*
266 fi
267 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
268 echo "$ac_t""yes" 1>&6
269 DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
270 else
271 echo "$ac_t""no" 1>&6
272 ac_safe=`echo "machine/ndr_def.h" | sed 'y%./+-%__p_%'`
273 echo $ac_n "checking for machine/ndr_def.h""... $ac_c" 1>&6
274 echo "configure:275: checking for machine/ndr_def.h" >&5
275 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
276 echo $ac_n "(cached) $ac_c" 1>&6
277 else
278 cat > conftest.$ac_ext <<EOF
279 #line 280 "configure"
280 #include "confdefs.h"
281 #include <machine/ndr_def.h>
282 EOF
283 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
284 { (eval echo configure:285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
285 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
286 if test -z "$ac_err"; then
287 rm -rf conftest*
288 eval "ac_cv_header_$ac_safe=yes"
289 else
290 echo "$ac_err" >&5
291 echo "configure: failed program was:" >&5
292 cat conftest.$ac_ext >&5
293 rm -rf conftest*
294 eval "ac_cv_header_$ac_safe=no"
295 fi
296 rm -f conftest*
297 fi
298 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
299 echo "$ac_t""yes" 1>&6
300 DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
301 else
302 echo "$ac_t""no" 1>&6
303 fi
304
305 fi
306
307
308 echo $ac_n "checking for i386_io_perm_modify in mach_i386.defs""... $ac_c" 1>&6
309 echo "configure:310: checking for i386_io_perm_modify in mach_i386.defs" >&5
310 if eval "test \"`echo '$''{'libc_cv_mach_i386_ioports'+set}'`\" = set"; then
311 echo $ac_n "(cached) $ac_c" 1>&6
312 else
313 cat > conftest.$ac_ext <<EOF
314 #line 315 "configure"
315 #include "confdefs.h"
316 #include <mach/i386/mach_i386.defs>
317 EOF
318 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
319 egrep "i386_io_perm_modify" >/dev/null 2>&1; then
320 rm -rf conftest*
321 libc_cv_mach_i386_ioports=yes
322 else
323 rm -rf conftest*
324 libc_cv_mach_i386_ioports=no
325 fi
326 rm -f conftest*
327
328 fi
329
330 echo "$ac_t""$libc_cv_mach_i386_ioports" 1>&6
331 if test $libc_cv_mach_i386_ioports = yes; then
332 cat >> confdefs.h <<\EOF
333 #define HAVE_I386_IO_PERM_MODIFY 1
334 EOF
335
336 fi