initial commit
[glibc.git] / .pc / hurd-i386 / git-mach-headers-freestanding.diff / sysdeps / mach / configure
1
2 # ac_fn_c_check_header_preproc LINENO HEADER VAR
3 # ----------------------------------------------
4 # Tests whether HEADER is present, setting the cache variable VAR accordingly.
5 ac_fn_c_check_header_preproc ()
6 {
7 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
8 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
9 $as_echo_n "checking for $2... " >&6; }
10 if eval \${$3+:} false; then :
11 $as_echo_n "(cached) " >&6
12 else
13 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14 /* end confdefs.h. */
15 #include <$2>
16 _ACEOF
17 if ac_fn_c_try_cpp "$LINENO"; then :
18 eval "$3=yes"
19 else
20 eval "$3=no"
21 fi
22 rm -f conftest.err conftest.i conftest.$ac_ext
23 fi
24 eval ac_res=\$$3
25 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
26 $as_echo "$ac_res" >&6; }
27 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
28
29 } # ac_fn_c_check_header_preproc
30 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
31
32 if test -n "$ac_tool_prefix"; then
33 # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
34 set dummy ${ac_tool_prefix}mig; ac_word=$2
35 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
36 $as_echo_n "checking for $ac_word... " >&6; }
37 if ${ac_cv_prog_MIG+:} false; then :
38 $as_echo_n "(cached) " >&6
39 else
40 if test -n "$MIG"; then
41 ac_cv_prog_MIG="$MIG" # Let the user override the test.
42 else
43 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
44 for as_dir in $PATH
45 do
46 IFS=$as_save_IFS
47 test -z "$as_dir" && as_dir=.
48 for ac_exec_ext in '' $ac_executable_extensions; do
49 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
50 ac_cv_prog_MIG="${ac_tool_prefix}mig"
51 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
52 break 2
53 fi
54 done
55 done
56 IFS=$as_save_IFS
57
58 fi
59 fi
60 MIG=$ac_cv_prog_MIG
61 if test -n "$MIG"; then
62 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIG" >&5
63 $as_echo "$MIG" >&6; }
64 else
65 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
66 $as_echo "no" >&6; }
67 fi
68
69
70 fi
71 if test -z "$ac_cv_prog_MIG"; then
72 ac_ct_MIG=$MIG
73 # Extract the first word of "mig", so it can be a program name with args.
74 set dummy mig; ac_word=$2
75 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
76 $as_echo_n "checking for $ac_word... " >&6; }
77 if ${ac_cv_prog_ac_ct_MIG+:} false; then :
78 $as_echo_n "(cached) " >&6
79 else
80 if test -n "$ac_ct_MIG"; then
81 ac_cv_prog_ac_ct_MIG="$ac_ct_MIG" # Let the user override the test.
82 else
83 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
84 for as_dir in $PATH
85 do
86 IFS=$as_save_IFS
87 test -z "$as_dir" && as_dir=.
88 for ac_exec_ext in '' $ac_executable_extensions; do
89 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
90 ac_cv_prog_ac_ct_MIG="mig"
91 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
92 break 2
93 fi
94 done
95 done
96 IFS=$as_save_IFS
97
98 fi
99 fi
100 ac_ct_MIG=$ac_cv_prog_ac_ct_MIG
101 if test -n "$ac_ct_MIG"; then
102 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MIG" >&5
103 $as_echo "$ac_ct_MIG" >&6; }
104 else
105 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
106 $as_echo "no" >&6; }
107 fi
108
109 if test "x$ac_ct_MIG" = x; then
110 MIG="MISSING"
111 else
112 case $cross_compiling:$ac_tool_warned in
113 yes:)
114 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
115 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
116 ac_tool_warned=yes ;;
117 esac
118 MIG=$ac_ct_MIG
119 fi
120 else
121 MIG="$ac_cv_prog_MIG"
122 fi
123
124 if test "x$MIG" = xMISSING; then
125 as_fn_error $? "cannot find required build tool mig" "$LINENO" 5
126 fi
127 config_vars="$config_vars
128 MIG = $MIG"
129
130 if test -n "$sysheaders"; then
131 OLD_CPPFLAGS=$CPPFLAGS
132 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
133 fi
134
135 ### Sanity checks for Mach header installation
136
137
138 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h"
139 if test "x$ac_cv_header_mach_mach_types_h" = xyes; then :
140
141 else
142 as_fn_error $? "cannot find Mach headers" "$LINENO" 5
143 fi
144
145
146 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.defs" "ac_cv_header_mach_mach_types_defs"
147 if test "x$ac_cv_header_mach_mach_types_defs" = xyes; then :
148
149 else
150 as_fn_error $? "cannot find Mach .defs files" "$LINENO" 5
151 fi
152
153
154
155
156
157 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for task_t in mach/mach_types.h" >&5
158 $as_echo_n "checking for task_t in mach/mach_types.h... " >&6; }
159 if ${libc_cv_mach_task_t+:} false; then :
160 $as_echo_n "(cached) " >&6
161 else
162 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
163 /* end confdefs.h. */
164 #include <mach/mach_types.h>
165 int
166 main ()
167 {
168 extern task_t foo;
169 ;
170 return 0;
171 }
172 _ACEOF
173 if ac_fn_c_try_compile "$LINENO"; then :
174 libc_cv_mach_task_t=task_t
175 else
176 libc_cv_mach_task_t=task_port_t
177 fi
178 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
179 fi
180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_t" >&5
181 $as_echo "$libc_cv_mach_task_t" >&6; }
182 if test $libc_cv_mach_task_t != task_t; then
183 DEFINES="$DEFINES -Dtask_t=task_port_t"
184 fi
185 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread_t in mach/mach_types.h" >&5
186 $as_echo_n "checking for thread_t in mach/mach_types.h... " >&6; }
187 if ${libc_cv_mach_thread_t+:} false; then :
188 $as_echo_n "(cached) " >&6
189 else
190 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
191 /* end confdefs.h. */
192 #include <mach/mach_types.h>
193 int
194 main ()
195 {
196 extern thread_t foo;
197 ;
198 return 0;
199 }
200 _ACEOF
201 if ac_fn_c_try_compile "$LINENO"; then :
202 libc_cv_mach_thread_t=thread_t
203 else
204 libc_cv_mach_thread_t=thread_port_t
205 fi
206 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
207 fi
208 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_thread_t" >&5
209 $as_echo "$libc_cv_mach_thread_t" >&6; }
210 if test $libc_cv_mach_thread_t != thread_t; then
211 DEFINES="$DEFINES -Dthread_t=thread_port_t"
212 fi
213
214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for creation_time in task_basic_info" >&5
215 $as_echo_n "checking for creation_time in task_basic_info... " >&6; }
216 if ${libc_cv_mach_task_creation_time+:} false; then :
217 $as_echo_n "(cached) " >&6
218 else
219 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
220 /* end confdefs.h. */
221 #include <mach/task_info.h>
222 int
223 main ()
224 {
225
226 extern struct task_basic_info *i;
227 long s = i->creation_time.seconds;
228
229 ;
230 return 0;
231 }
232 _ACEOF
233 if ac_fn_c_try_compile "$LINENO"; then :
234 libc_cv_mach_task_creation_time=yes
235 else
236 libc_cv_mach_task_creation_time=no
237 fi
238 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
239 fi
240 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_creation_time" >&5
241 $as_echo "$libc_cv_mach_task_creation_time" >&6; }
242 if test $libc_cv_mach_task_creation_time = no; then
243 as_fn_error $? "you need Mach headers supporting task_info.creation_time" "$LINENO" 5
244 fi
245
246 mach_interface_list=
247 for ifc in mach mach4 gnumach \
248 clock clock_priv host_priv host_security ledger lock_set \
249 processor processor_set task task_notify thread_act vm_map \
250 memory_object memory_object_default default_pager \
251 i386/mach_i386 \
252 ; do
253 as_ac_Header=`$as_echo "ac_cv_header_mach/${ifc}.defs" | $as_tr_sh`
254 ac_fn_c_check_header_preproc "$LINENO" "mach/${ifc}.defs" "$as_ac_Header"
255 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
256 mach_interface_list="$mach_interface_list $ifc"
257 fi
258
259
260 done
261 if test "x$mach_interface_list" = x; then
262 as_fn_error $? "what manner of Mach is this?" "$LINENO" 5
263 fi
264
265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
266 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
267 if ${ac_cv_path_GREP+:} false; then :
268 $as_echo_n "(cached) " >&6
269 else
270 if test -z "$GREP"; then
271 ac_path_GREP_found=false
272 # Loop through the user's path and test for each of PROGNAME-LIST
273 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
274 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
275 do
276 IFS=$as_save_IFS
277 test -z "$as_dir" && as_dir=.
278 for ac_prog in grep ggrep; do
279 for ac_exec_ext in '' $ac_executable_extensions; do
280 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
281 as_fn_executable_p "$ac_path_GREP" || continue
282 # Check for GNU ac_path_GREP and select it if it is found.
283 # Check for GNU $ac_path_GREP
284 case `"$ac_path_GREP" --version 2>&1` in
285 *GNU*)
286 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
287 *)
288 ac_count=0
289 $as_echo_n 0123456789 >"conftest.in"
290 while :
291 do
292 cat "conftest.in" "conftest.in" >"conftest.tmp"
293 mv "conftest.tmp" "conftest.in"
294 cp "conftest.in" "conftest.nl"
295 $as_echo 'GREP' >> "conftest.nl"
296 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
297 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
298 as_fn_arith $ac_count + 1 && ac_count=$as_val
299 if test $ac_count -gt ${ac_path_GREP_max-0}; then
300 # Best one so far, save it but keep looking for a better one
301 ac_cv_path_GREP="$ac_path_GREP"
302 ac_path_GREP_max=$ac_count
303 fi
304 # 10*(2^10) chars as input seems more than enough
305 test $ac_count -gt 10 && break
306 done
307 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
308 esac
309
310 $ac_path_GREP_found && break 3
311 done
312 done
313 done
314 IFS=$as_save_IFS
315 if test -z "$ac_cv_path_GREP"; then
316 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
317 fi
318 else
319 ac_cv_path_GREP=$GREP
320 fi
321
322 fi
323 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
324 $as_echo "$ac_cv_path_GREP" >&6; }
325 GREP="$ac_cv_path_GREP"
326
327
328 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
329 $as_echo_n "checking for egrep... " >&6; }
330 if ${ac_cv_path_EGREP+:} false; then :
331 $as_echo_n "(cached) " >&6
332 else
333 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
334 then ac_cv_path_EGREP="$GREP -E"
335 else
336 if test -z "$EGREP"; then
337 ac_path_EGREP_found=false
338 # Loop through the user's path and test for each of PROGNAME-LIST
339 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
340 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
341 do
342 IFS=$as_save_IFS
343 test -z "$as_dir" && as_dir=.
344 for ac_prog in egrep; do
345 for ac_exec_ext in '' $ac_executable_extensions; do
346 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
347 as_fn_executable_p "$ac_path_EGREP" || continue
348 # Check for GNU ac_path_EGREP and select it if it is found.
349 # Check for GNU $ac_path_EGREP
350 case `"$ac_path_EGREP" --version 2>&1` in
351 *GNU*)
352 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
353 *)
354 ac_count=0
355 $as_echo_n 0123456789 >"conftest.in"
356 while :
357 do
358 cat "conftest.in" "conftest.in" >"conftest.tmp"
359 mv "conftest.tmp" "conftest.in"
360 cp "conftest.in" "conftest.nl"
361 $as_echo 'EGREP' >> "conftest.nl"
362 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
363 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
364 as_fn_arith $ac_count + 1 && ac_count=$as_val
365 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
366 # Best one so far, save it but keep looking for a better one
367 ac_cv_path_EGREP="$ac_path_EGREP"
368 ac_path_EGREP_max=$ac_count
369 fi
370 # 10*(2^10) chars as input seems more than enough
371 test $ac_count -gt 10 && break
372 done
373 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
374 esac
375
376 $ac_path_EGREP_found && break 3
377 done
378 done
379 done
380 IFS=$as_save_IFS
381 if test -z "$ac_cv_path_EGREP"; then
382 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
383 fi
384 else
385 ac_cv_path_EGREP=$EGREP
386 fi
387
388 fi
389 fi
390 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
391 $as_echo "$ac_cv_path_EGREP" >&6; }
392 EGREP="$ac_cv_path_EGREP"
393
394
395 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for host_page_size in mach_host.defs" >&5
396 $as_echo_n "checking for host_page_size in mach_host.defs... " >&6; }
397 if ${libc_cv_mach_host_page_size+:} false; then :
398 $as_echo_n "(cached) " >&6
399 else
400 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
401 /* end confdefs.h. */
402 #include <mach/mach_host.defs>
403
404 _ACEOF
405 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
406 $EGREP "host_page_size" >/dev/null 2>&1; then :
407 libc_cv_mach_host_page_size=yes
408 else
409 libc_cv_mach_host_page_size=no
410 fi
411 rm -f conftest*
412
413 fi
414 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_host_page_size" >&5
415 $as_echo "$libc_cv_mach_host_page_size" >&6; }
416 if test $libc_cv_mach_host_page_size = yes; then
417 $as_echo "#define HAVE_HOST_PAGE_SIZE 1" >>confdefs.h
418
419 fi
420
421 ac_fn_c_check_header_preproc "$LINENO" "mach/machine/ndr_def.h" "ac_cv_header_mach_machine_ndr_def_h"
422 if test "x$ac_cv_header_mach_machine_ndr_def_h" = xyes; then :
423 DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
424 else
425 ac_fn_c_check_header_preproc "$LINENO" "machine/ndr_def.h" "ac_cv_header_machine_ndr_def_h"
426 if test "x$ac_cv_header_machine_ndr_def_h" = xyes; then :
427 DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
428 fi
429
430
431 fi
432
433
434
435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for i386_io_perm_modify in mach_i386.defs" >&5
436 $as_echo_n "checking for i386_io_perm_modify in mach_i386.defs... " >&6; }
437 if ${libc_cv_mach_i386_ioports+:} false; then :
438 $as_echo_n "(cached) " >&6
439 else
440 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
441 /* end confdefs.h. */
442 #include <mach/i386/mach_i386.defs>
443
444 _ACEOF
445 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
446 $EGREP "i386_io_perm_modify" >/dev/null 2>&1; then :
447 libc_cv_mach_i386_ioports=yes
448 else
449 libc_cv_mach_i386_ioports=no
450 fi
451 rm -f conftest*
452
453 fi
454 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_ioports" >&5
455 $as_echo "$libc_cv_mach_i386_ioports" >&6; }
456 if test $libc_cv_mach_i386_ioports = yes; then
457 $as_echo "#define HAVE_I386_IO_PERM_MODIFY 1" >>confdefs.h
458
459 fi
460
461 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for i386_set_gdt in mach_i386.defs" >&5
462 $as_echo_n "checking for i386_set_gdt in mach_i386.defs... " >&6; }
463 if ${libc_cv_mach_i386_gdt+:} false; then :
464 $as_echo_n "(cached) " >&6
465 else
466 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
467 /* end confdefs.h. */
468 #include <mach/i386/mach_i386.defs>
469
470 _ACEOF
471 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
472 $EGREP "i386_set_gdt" >/dev/null 2>&1; then :
473 libc_cv_mach_i386_gdt=yes
474 else
475 libc_cv_mach_i386_gdt=no
476 fi
477 rm -f conftest*
478
479 fi
480 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_gdt" >&5
481 $as_echo "$libc_cv_mach_i386_gdt" >&6; }
482 if test $libc_cv_mach_i386_gdt = yes; then
483 $as_echo "#define HAVE_I386_SET_GDT 1" >>confdefs.h
484
485 fi
486
487
488
489 # See if mig groks `retcode'.
490 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $MIG supports the retcode keyword" >&5
491 $as_echo_n "checking whether $MIG supports the retcode keyword... " >&6; }
492 if ${hurd_cv_mig_retcode+:} false; then :
493 $as_echo_n "(cached) " >&6
494 else
495 cat > conftest.defs <<\EOF
496 #include <mach/std_types.defs>
497 #include <mach/mach_types.defs>
498 subsystem foobar 1000;
499 type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE
500 ctype: mach_port_t;
501 simpleroutine foobar_reply (
502 reply_port: reply_port_t;
503 err: kern_return_t, RetCode);
504 EOF
505 if { ac_try='CC="${CC}" ${MIG-false} -n conftest.defs 1>&5'
506 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
507 (eval $ac_try) 2>&5
508 ac_status=$?
509 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
510 test $ac_status = 0; }; }; then
511 hurd_cv_mig_retcode=yes
512 else
513 hurd_cv_mig_retcode=no
514 fi
515 rm -f conftest*
516 fi
517 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_mig_retcode" >&5
518 $as_echo "$hurd_cv_mig_retcode" >&6; }
519 if test $hurd_cv_mig_retcode = yes; then
520 $as_echo "#define HAVE_MIG_RETCODE 1" >>confdefs.h
521
522 fi
523
524 if test -n "$sysheaders"; then
525 CPPFLAGS=$OLD_CPPFLAGS
526 fi