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
9 cat > conftest.$ac_ext <<EOF
12 #include <mach/mach_types.h>
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
19 eval "ac_cv_header_$ac_safe=yes"
22 echo "configure: failed program was:" >&5
23 cat conftest.$ac_ext >&5
25 eval "ac_cv_header_$ac_safe=no"
29 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
30 echo "$ac_t""yes" 1>&6
34 { echo "configure: error: cannot find Mach headers" 1>&2; exit 1; }
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
43 cat > conftest.$ac_ext <<EOF
46 #include <mach/mach_types.defs>
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
53 eval "ac_cv_header_$ac_safe=yes"
56 echo "configure: failed program was:" >&5
57 cat conftest.$ac_ext >&5
59 eval "ac_cv_header_$ac_safe=no"
63 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
64 echo "$ac_t""yes" 1>&6
68 { echo "configure: error: cannot find Mach .defs files" 1>&2; exit 1; }
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
79 cat > conftest.$ac_ext <<EOF
82 #include <mach/mach_types.h>
87 if { (eval echo configure:88: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
89 libc_cv_mach_task_t=task_t
91 echo "configure: failed program was:" >&5
92 cat conftest.$ac_ext >&5
94 libc_cv_mach_task_t=task_port_t
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"
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
108 cat > conftest.$ac_ext <<EOF
109 #line 110 "configure"
110 #include "confdefs.h"
111 #include <mach/mach_types.h>
116 if { (eval echo configure:117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
118 libc_cv_mach_thread_t=thread_t
120 echo "configure: failed program was:" >&5
121 cat conftest.$ac_ext >&5
123 libc_cv_mach_thread_t=thread_port_t
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"
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
138 cat > conftest.$ac_ext <<EOF
139 #line 140 "configure"
140 #include "confdefs.h"
141 #include <mach/task_info.h>
144 extern struct task_basic_info *i;
145 long s = i->creation_time.seconds;
149 if { (eval echo configure:150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
151 libc_cv_mach_task_creation_time=yes
153 echo "configure: failed program was:" >&5
154 cat conftest.$ac_ext >&5
156 libc_cv_mach_task_creation_time=no
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"
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 \
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
179 cat > conftest.$ac_ext <<EOF
180 #line 181 "configure"
181 #include "confdefs.h"
182 #include <mach/${ifc}.defs>
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
189 eval "ac_cv_header_$ac_safe=yes"
192 echo "configure: failed program was:" >&5
193 cat conftest.$ac_ext >&5
195 eval "ac_cv_header_$ac_safe=no"
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"
203 echo "$ac_t""no" 1>&6
207 if test "x$mach_interface_list" = x; then
208 { echo "configure: error: what manner of Mach is this?" 1>&2; exit 1; }
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
216 cat > conftest.$ac_ext <<EOF
217 #line 218 "configure"
218 #include "confdefs.h"
219 #include <mach/mach_host.defs>
221 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
222 egrep "host_page_size" >/dev/null 2>&1; then
224 libc_cv_mach_host_page_size=yes
227 libc_cv_mach_host_page_size=no
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
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
247 cat > conftest.$ac_ext <<EOF
248 #line 249 "configure"
249 #include "confdefs.h"
250 #include <mach/machine/ndr_def.h>
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
257 eval "ac_cv_header_$ac_safe=yes"
260 echo "configure: failed program was:" >&5
261 cat conftest.$ac_ext >&5
263 eval "ac_cv_header_$ac_safe=no"
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>'"
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
278 cat > conftest.$ac_ext <<EOF
279 #line 280 "configure"
280 #include "confdefs.h"
281 #include <machine/ndr_def.h>
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
288 eval "ac_cv_header_$ac_safe=yes"
291 echo "configure: failed program was:" >&5
292 cat conftest.$ac_ext >&5
294 eval "ac_cv_header_$ac_safe=no"
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>'"
302 echo "$ac_t""no" 1>&6
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
313 cat > conftest.$ac_ext <<EOF
314 #line 315 "configure"
315 #include "confdefs.h"
316 #include <mach/i386/mach_i386.defs>
318 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
319 egrep "i386_io_perm_modify" >/dev/null 2>&1; then
321 libc_cv_mach_i386_ioports=yes
324 libc_cv_mach_i386_ioports=no
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