2 if test "x$MIG" = xMISSING; then
3 { echo "configure: error: cannot find required build tool mig" 1>&2; exit 1; }
6 ### Sanity checks for Mach header installation
7 ac_safe=`echo "mach/mach_types.h" | sed 'y%./+-%__p_%'`
8 echo $ac_n "checking for mach/mach_types.h""... $ac_c" 1>&6
9 echo "configure:10: checking for mach/mach_types.h" >&5
10 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
11 echo $ac_n "(cached) $ac_c" 1>&6
13 cat > conftest.$ac_ext <<EOF
16 #include <mach/mach_types.h>
18 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
19 { (eval echo configure:20: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
20 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
21 if test -z "$ac_err"; then
23 eval "ac_cv_header_$ac_safe=yes"
26 echo "configure: failed program was:" >&5
27 cat conftest.$ac_ext >&5
29 eval "ac_cv_header_$ac_safe=no"
33 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
34 echo "$ac_t""yes" 1>&6
38 { echo "configure: error: cannot find Mach headers" 1>&2; exit 1; }
41 ac_safe=`echo "mach/mach_types.defs" | sed 'y%./+-%__p_%'`
42 echo $ac_n "checking for mach/mach_types.defs""... $ac_c" 1>&6
43 echo "configure:44: checking for mach/mach_types.defs" >&5
44 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
45 echo $ac_n "(cached) $ac_c" 1>&6
47 cat > conftest.$ac_ext <<EOF
50 #include <mach/mach_types.defs>
52 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
53 { (eval echo configure:54: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
54 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
55 if test -z "$ac_err"; then
57 eval "ac_cv_header_$ac_safe=yes"
60 echo "configure: failed program was:" >&5
61 cat conftest.$ac_ext >&5
63 eval "ac_cv_header_$ac_safe=no"
67 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
68 echo "$ac_t""yes" 1>&6
72 { echo "configure: error: cannot find Mach .defs files" 1>&2; exit 1; }
78 echo $ac_n "checking for task_t in mach/mach_types.h""... $ac_c" 1>&6
79 echo "configure:80: checking for task_t in mach/mach_types.h" >&5
80 if eval "test \"`echo '$''{'libc_cv_mach_task_t'+set}'`\" = set"; then
81 echo $ac_n "(cached) $ac_c" 1>&6
83 cat > conftest.$ac_ext <<EOF
86 #include <mach/mach_types.h>
91 if { (eval echo configure:92: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
93 libc_cv_mach_task_t=task_t
95 echo "configure: failed program was:" >&5
96 cat conftest.$ac_ext >&5
98 libc_cv_mach_task_t=task_port_t
103 echo "$ac_t""$libc_cv_mach_task_t" 1>&6
104 if test $libc_cv_mach_task_t != task_t; then
105 DEFINES="$DEFINES -Dtask_t=task_port_t"
107 echo $ac_n "checking for thread_t in mach/mach_types.h""... $ac_c" 1>&6
108 echo "configure:109: checking for thread_t in mach/mach_types.h" >&5
109 if eval "test \"`echo '$''{'libc_cv_mach_thread_t'+set}'`\" = set"; then
110 echo $ac_n "(cached) $ac_c" 1>&6
112 cat > conftest.$ac_ext <<EOF
113 #line 114 "configure"
114 #include "confdefs.h"
115 #include <mach/mach_types.h>
120 if { (eval echo configure:121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
122 libc_cv_mach_thread_t=thread_t
124 echo "configure: failed program was:" >&5
125 cat conftest.$ac_ext >&5
127 libc_cv_mach_thread_t=thread_port_t
132 echo "$ac_t""$libc_cv_mach_thread_t" 1>&6
133 if test $libc_cv_mach_thread_t != thread_t; then
134 DEFINES="$DEFINES -Dthread_t=thread_port_t"
137 echo $ac_n "checking for creation_time in task_basic_info""... $ac_c" 1>&6
138 echo "configure:139: checking for creation_time in task_basic_info" >&5
139 if eval "test \"`echo '$''{'libc_cv_mach_task_creation_time'+set}'`\" = set"; then
140 echo $ac_n "(cached) $ac_c" 1>&6
142 cat > conftest.$ac_ext <<EOF
143 #line 144 "configure"
144 #include "confdefs.h"
145 #include <mach/task_info.h>
148 extern struct task_basic_info *i;
149 long s = i->creation_time.seconds;
153 if { (eval echo configure:154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
155 libc_cv_mach_task_creation_time=yes
157 echo "configure: failed program was:" >&5
158 cat conftest.$ac_ext >&5
160 libc_cv_mach_task_creation_time=no
165 echo "$ac_t""$libc_cv_mach_task_creation_time" 1>&6
166 if test $libc_cv_mach_task_creation_time = no; then
167 DEFINES="$DEFINES -DNO_CREATION_TIME=1"
171 for ifc in mach mach4 \
172 clock clock_priv host_priv host_security ledger lock_set \
173 processor processor_set task thread_act vm_map \
174 memory_object memory_object_default default_pager \
177 ac_safe=`echo "mach/${ifc}.defs" | sed 'y%./+-%__p_%'`
178 echo $ac_n "checking for mach/${ifc}.defs""... $ac_c" 1>&6
179 echo "configure:180: checking for mach/${ifc}.defs" >&5
180 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
181 echo $ac_n "(cached) $ac_c" 1>&6
183 cat > conftest.$ac_ext <<EOF
184 #line 185 "configure"
185 #include "confdefs.h"
186 #include <mach/${ifc}.defs>
188 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
189 { (eval echo configure:190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
190 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
191 if test -z "$ac_err"; then
193 eval "ac_cv_header_$ac_safe=yes"
196 echo "configure: failed program was:" >&5
197 cat conftest.$ac_ext >&5
199 eval "ac_cv_header_$ac_safe=no"
203 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
204 echo "$ac_t""yes" 1>&6
205 mach_interface_list="$mach_interface_list $ifc"
207 echo "$ac_t""no" 1>&6
211 if test "x$mach_interface_list" = x; then
212 { echo "configure: error: what manner of Mach is this?" 1>&2; exit 1; }
215 echo $ac_n "checking for host_page_size in mach_host.defs""... $ac_c" 1>&6
216 echo "configure:217: checking for host_page_size in mach_host.defs" >&5
217 if eval "test \"`echo '$''{'libc_cv_mach_host_page_size'+set}'`\" = set"; then
218 echo $ac_n "(cached) $ac_c" 1>&6
220 cat > conftest.$ac_ext <<EOF
221 #line 222 "configure"
222 #include "confdefs.h"
223 #include <mach/mach_host.defs>
225 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
226 egrep "host_page_size" >/dev/null 2>&1; then
228 libc_cv_mach_host_page_size=yes
231 libc_cv_mach_host_page_size=no
237 echo "$ac_t""$libc_cv_mach_host_page_size" 1>&6
238 if test $libc_cv_mach_host_page_size = yes; then
239 cat >> confdefs.h <<\EOF
240 #define HAVE_HOST_PAGE_SIZE 1
245 ac_safe=`echo "mach/machine/ndr_def.h" | sed 'y%./+-%__p_%'`
246 echo $ac_n "checking for mach/machine/ndr_def.h""... $ac_c" 1>&6
247 echo "configure:248: checking for mach/machine/ndr_def.h" >&5
248 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
249 echo $ac_n "(cached) $ac_c" 1>&6
251 cat > conftest.$ac_ext <<EOF
252 #line 253 "configure"
253 #include "confdefs.h"
254 #include <mach/machine/ndr_def.h>
256 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
257 { (eval echo configure:258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
258 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
259 if test -z "$ac_err"; then
261 eval "ac_cv_header_$ac_safe=yes"
264 echo "configure: failed program was:" >&5
265 cat conftest.$ac_ext >&5
267 eval "ac_cv_header_$ac_safe=no"
271 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
272 echo "$ac_t""yes" 1>&6
273 DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
275 echo "$ac_t""no" 1>&6
276 ac_safe=`echo "machine/ndr_def.h" | sed 'y%./+-%__p_%'`
277 echo $ac_n "checking for machine/ndr_def.h""... $ac_c" 1>&6
278 echo "configure:279: checking for machine/ndr_def.h" >&5
279 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
280 echo $ac_n "(cached) $ac_c" 1>&6
282 cat > conftest.$ac_ext <<EOF
283 #line 284 "configure"
284 #include "confdefs.h"
285 #include <machine/ndr_def.h>
287 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
288 { (eval echo configure:289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
289 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
290 if test -z "$ac_err"; then
292 eval "ac_cv_header_$ac_safe=yes"
295 echo "configure: failed program was:" >&5
296 cat conftest.$ac_ext >&5
298 eval "ac_cv_header_$ac_safe=no"
302 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
303 echo "$ac_t""yes" 1>&6
304 DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
306 echo "$ac_t""no" 1>&6
312 echo $ac_n "checking for i386_io_perm_modify in mach_i386.defs""... $ac_c" 1>&6
313 echo "configure:314: checking for i386_io_perm_modify in mach_i386.defs" >&5
314 if eval "test \"`echo '$''{'libc_cv_mach_i386_ioports'+set}'`\" = set"; then
315 echo $ac_n "(cached) $ac_c" 1>&6
317 cat > conftest.$ac_ext <<EOF
318 #line 319 "configure"
319 #include "confdefs.h"
320 #include <mach/i386/mach_i386.defs>
322 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
323 egrep "i386_io_perm_modify" >/dev/null 2>&1; then
325 libc_cv_mach_i386_ioports=yes
328 libc_cv_mach_i386_ioports=no
334 echo "$ac_t""$libc_cv_mach_i386_ioports" 1>&6
335 if test $libc_cv_mach_i386_ioports = yes; then
336 cat >> confdefs.h <<\EOF
337 #define HAVE_I386_IO_PERM_MODIFY 1