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 ()
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
13 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17 if ac_fn_c_try_cpp "$LINENO"; then :
22 rm -f conftest.err conftest.i conftest.$ac_ext
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
29 } # ac_fn_c_check_header_preproc
30 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
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
40 if test -n "$MIG"; then
41 ac_cv_prog_MIG="$MIG" # Let the user override the test.
43 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
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
61 if test -n "$MIG"; then
62 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIG" >&5
63 $as_echo "$MIG" >&6; }
65 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
71 if test -z "$ac_cv_prog_MIG"; then
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
80 if test -n "$ac_ct_MIG"; then
81 ac_cv_prog_ac_ct_MIG="$ac_ct_MIG" # Let the user override the test.
83 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
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
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; }
105 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
109 if test "x$ac_ct_MIG" = x; then
112 case $cross_compiling:$ac_tool_warned in
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 ;;
121 MIG="$ac_cv_prog_MIG"
124 if test "x$MIG" = xMISSING; then
125 as_fn_error $? "cannot find required build tool mig" "$LINENO" 5
127 config_vars="$config_vars
130 if test -n "$sysheaders"; then
131 OLD_CPPFLAGS=$CPPFLAGS
132 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
135 ### Sanity checks for Mach header installation
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 :
142 as_fn_error $? "cannot find Mach headers" "$LINENO" 5
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 :
150 as_fn_error $? "cannot find Mach .defs files" "$LINENO" 5
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
162 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
163 /* end confdefs.h. */
164 #include <mach/mach_types.h>
173 if ac_fn_c_try_compile "$LINENO"; then :
174 libc_cv_mach_task_t=task_t
176 libc_cv_mach_task_t=task_port_t
178 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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"
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
190 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
191 /* end confdefs.h. */
192 #include <mach/mach_types.h>
201 if ac_fn_c_try_compile "$LINENO"; then :
202 libc_cv_mach_thread_t=thread_t
204 libc_cv_mach_thread_t=thread_port_t
206 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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"
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
219 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
220 /* end confdefs.h. */
221 #include <mach/task_info.h>
226 extern struct task_basic_info *i;
227 long s = i->creation_time.seconds;
233 if ac_fn_c_try_compile "$LINENO"; then :
234 libc_cv_mach_task_creation_time=yes
236 libc_cv_mach_task_creation_time=no
238 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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
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 \
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"
261 if test "x$mach_interface_list" = x; then
262 as_fn_error $? "what manner of Mach is this?" "$LINENO" 5
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
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
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
286 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
289 $as_echo_n 0123456789 >"conftest.in"
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
304 # 10*(2^10) chars as input seems more than enough
305 test $ac_count -gt 10 && break
307 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
310 $ac_path_GREP_found && break 3
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
319 ac_cv_path_GREP=$GREP
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"
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
333 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
334 then ac_cv_path_EGREP="$GREP -E"
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
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
352 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
355 $as_echo_n 0123456789 >"conftest.in"
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
370 # 10*(2^10) chars as input seems more than enough
371 test $ac_count -gt 10 && break
373 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
376 $ac_path_EGREP_found && break 3
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
385 ac_cv_path_EGREP=$EGREP
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"
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
400 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
401 /* end confdefs.h. */
402 #include <mach/mach_host.defs>
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
409 libc_cv_mach_host_page_size=no
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
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>'"
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>'"
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
440 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
441 /* end confdefs.h. */
442 #include <mach/i386/mach_i386.defs>
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
449 libc_cv_mach_i386_ioports=no
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
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
466 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
467 /* end confdefs.h. */
468 #include <mach/i386/mach_i386.defs>
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
475 libc_cv_mach_i386_gdt=no
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
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
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
501 simpleroutine foobar_reply (
502 reply_port: reply_port_t;
503 err: kern_return_t, RetCode);
505 if { ac_try='CC="${CC}" ${MIG-false} -n conftest.defs 1>&5'
506 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
509 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
510 test $ac_status = 0; }; }; then
511 hurd_cv_mig_retcode=yes
513 hurd_cv_mig_retcode=no
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
524 if test -n "$sysheaders"; then
525 CPPFLAGS=$OLD_CPPFLAGS