2 # ac_fn_c_check_header_preproc LINENO HEADER VAR
3 # ----------------------------------------------
4 # Tests whether HEADER exists and can be preprocessed (in isolation), setting
5 # the cache variable VAR accordingly.
6 ac_fn_c_check_header_preproc ()
8 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
10 printf %s "checking for $2... " >&6; }
13 printf %s "(cached) " >&6
15 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19 if ac_fn_c_try_cpp "$LINENO"
26 rm -f conftest.err conftest.i conftest.$ac_ext ;;
30 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
31 printf "%s\n" "$ac_res" >&6; }
32 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
34 } # ac_fn_c_check_header_preproc
35 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
37 if test -n "$ac_tool_prefix"; then
38 # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
39 set dummy ${ac_tool_prefix}mig; ac_word=$2
40 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
41 printf %s "checking for $ac_word... " >&6; }
42 if test ${ac_cv_prog_MIG+y}
44 printf %s "(cached) " >&6
46 e) if test -n "$MIG"; then
47 ac_cv_prog_MIG="$MIG" # Let the user override the test.
49 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
58 for ac_exec_ext in '' $ac_executable_extensions; do
59 if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
60 ac_cv_prog_MIG="${ac_tool_prefix}mig"
61 printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
72 if test -n "$MIG"; then
73 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MIG" >&5
74 printf "%s\n" "$MIG" >&6; }
76 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
77 printf "%s\n" "no" >&6; }
82 if test -z "$ac_cv_prog_MIG"; then
84 # Extract the first word of "mig", so it can be a program name with args.
85 set dummy mig; ac_word=$2
86 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
87 printf %s "checking for $ac_word... " >&6; }
88 if test ${ac_cv_prog_ac_ct_MIG+y}
90 printf %s "(cached) " >&6
92 e) if test -n "$ac_ct_MIG"; then
93 ac_cv_prog_ac_ct_MIG="$ac_ct_MIG" # Let the user override the test.
95 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
102 *) as_dir=$as_dir/ ;;
104 for ac_exec_ext in '' $ac_executable_extensions; do
105 if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
106 ac_cv_prog_ac_ct_MIG="mig"
107 printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
117 ac_ct_MIG=$ac_cv_prog_ac_ct_MIG
118 if test -n "$ac_ct_MIG"; then
119 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MIG" >&5
120 printf "%s\n" "$ac_ct_MIG" >&6; }
122 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
123 printf "%s\n" "no" >&6; }
126 if test "x$ac_ct_MIG" = x; then
129 case $cross_compiling:$ac_tool_warned in
131 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
132 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
133 ac_tool_warned=yes ;;
138 MIG="$ac_cv_prog_MIG"
141 if test "x$MIG" = xMISSING; then
142 as_fn_error $? "cannot find required build tool mig" "$LINENO" 5
144 config_vars="$config_vars
147 OLD_CPPFLAGS=$CPPFLAGS
148 if test -n "$sysheaders"; then
149 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
152 ### Sanity checks for Mach header installation
153 CPPFLAGS="$CPPFLAGS -ffreestanding"
156 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h"
157 if test "x$ac_cv_header_mach_mach_types_h" = xyes
161 e) as_fn_error $? "cannot find Mach headers" "$LINENO" 5 ;;
165 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.defs" "ac_cv_header_mach_mach_types_defs"
166 if test "x$ac_cv_header_mach_mach_types_defs" = xyes
170 e) as_fn_error $? "cannot find Mach .defs files" "$LINENO" 5 ;;
177 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for task_t in mach/mach_types.h" >&5
178 printf %s "checking for task_t in mach/mach_types.h... " >&6; }
179 if test ${libc_cv_mach_task_t+y}
181 printf %s "(cached) " >&6
183 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
184 /* end confdefs.h. */
185 #include <mach/mach_types.h>
194 if ac_fn_c_try_compile "$LINENO"
196 libc_cv_mach_task_t=task_t
198 e) libc_cv_mach_task_t=task_port_t ;;
201 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
204 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_t" >&5
205 printf "%s\n" "$libc_cv_mach_task_t" >&6; }
206 if test $libc_cv_mach_task_t != task_t; then
207 DEFINES="$DEFINES -Dtask_t=task_port_t"
209 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread_t in mach/mach_types.h" >&5
210 printf %s "checking for thread_t in mach/mach_types.h... " >&6; }
211 if test ${libc_cv_mach_thread_t+y}
213 printf %s "(cached) " >&6
215 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
216 /* end confdefs.h. */
217 #include <mach/mach_types.h>
226 if ac_fn_c_try_compile "$LINENO"
228 libc_cv_mach_thread_t=thread_t
230 e) libc_cv_mach_thread_t=thread_port_t ;;
233 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
236 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_thread_t" >&5
237 printf "%s\n" "$libc_cv_mach_thread_t" >&6; }
238 if test $libc_cv_mach_thread_t != thread_t; then
239 DEFINES="$DEFINES -Dthread_t=thread_port_t"
242 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for creation_time in task_basic_info" >&5
243 printf %s "checking for creation_time in task_basic_info... " >&6; }
244 if test ${libc_cv_mach_task_creation_time+y}
246 printf %s "(cached) " >&6
248 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
249 /* end confdefs.h. */
250 #include <mach/task_info.h>
255 extern struct task_basic_info *i;
256 long s = i->creation_time.seconds;
262 if ac_fn_c_try_compile "$LINENO"
264 libc_cv_mach_task_creation_time=yes
266 e) libc_cv_mach_task_creation_time=no ;;
269 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;
272 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_creation_time" >&5
273 printf "%s\n" "$libc_cv_mach_task_creation_time" >&6; }
274 if test $libc_cv_mach_task_creation_time = no; then
275 as_fn_error $? "you need Mach headers supporting task_info.creation_time" "$LINENO" 5
279 for ifc in mach mach4 gnumach \
280 clock clock_priv host_priv host_security ledger lock_set \
281 processor processor_set task task_notify thread_act vm_map \
282 memory_object memory_object_default i386/mach_i386 x86_64/mach_i386 \
284 as_ac_Header=`printf "%s\n" "ac_cv_header_mach/${ifc}.defs" | sed "$as_sed_sh"`
285 ac_fn_c_check_header_preproc "$LINENO" "mach/${ifc}.defs" "$as_ac_Header"
286 if eval test \"x\$"$as_ac_Header"\" = x"yes"
288 mach_interface_list="$mach_interface_list $ifc"
292 if test "x$mach_interface_list" = x; then
293 as_fn_error $? "what manner of Mach is this?" "$LINENO" 5
299 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5
300 printf %s "checking for egrep -e... " >&6; }
301 if test ${ac_cv_path_EGREP_TRADITIONAL+y}
303 printf %s "(cached) " >&6
305 e) if test -z "$EGREP_TRADITIONAL"; then
306 ac_path_EGREP_TRADITIONAL_found=false
307 # Loop through the user's path and test for each of PROGNAME-LIST
308 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
309 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
315 *) as_dir=$as_dir/ ;;
317 for ac_prog in grep ggrep
319 for ac_exec_ext in '' $ac_executable_extensions; do
320 ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
321 as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
322 # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
323 # Check for GNU $ac_path_EGREP_TRADITIONAL
324 case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
326 ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;;
330 printf %s 0123456789 >"conftest.in"
333 cat "conftest.in" "conftest.in" >"conftest.tmp"
334 mv "conftest.tmp" "conftest.in"
335 cp "conftest.in" "conftest.nl"
336 printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl"
337 "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
338 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
339 as_fn_arith $ac_count + 1 && ac_count=$as_val
340 if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then
341 # Best one so far, save it but keep looking for a better one
342 ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
343 ac_path_EGREP_TRADITIONAL_max=$ac_count
345 # 10*(2^10) chars as input seems more than enough
346 test $ac_count -gt 10 && break
348 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
351 $ac_path_EGREP_TRADITIONAL_found && break 3
356 if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then
360 ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL
363 if test "$ac_cv_path_EGREP_TRADITIONAL"
365 ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E"
367 e) if test -z "$EGREP_TRADITIONAL"; then
368 ac_path_EGREP_TRADITIONAL_found=false
369 # Loop through the user's path and test for each of PROGNAME-LIST
370 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
371 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
377 *) as_dir=$as_dir/ ;;
381 for ac_exec_ext in '' $ac_executable_extensions; do
382 ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext"
383 as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue
384 # Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found.
385 # Check for GNU $ac_path_EGREP_TRADITIONAL
386 case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #(
388 ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;;
392 printf %s 0123456789 >"conftest.in"
395 cat "conftest.in" "conftest.in" >"conftest.tmp"
396 mv "conftest.tmp" "conftest.in"
397 cp "conftest.in" "conftest.nl"
398 printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl"
399 "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
400 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
401 as_fn_arith $ac_count + 1 && ac_count=$as_val
402 if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then
403 # Best one so far, save it but keep looking for a better one
404 ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL"
405 ac_path_EGREP_TRADITIONAL_max=$ac_count
407 # 10*(2^10) chars as input seems more than enough
408 test $ac_count -gt 10 && break
410 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
413 $ac_path_EGREP_TRADITIONAL_found && break 3
418 if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then
419 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
422 ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL
429 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5
430 printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; }
431 EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL
433 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for host_page_size in mach_host.defs" >&5
434 printf %s "checking for host_page_size in mach_host.defs... " >&6; }
435 if test ${libc_cv_mach_rpc_host_page_size+y}
437 printf %s "(cached) " >&6
439 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
440 /* end confdefs.h. */
441 #include <mach/mach_host.defs>
444 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
445 $EGREP_TRADITIONAL "host_page_size" >/dev/null 2>&1
447 libc_cv_mach_rpc_host_page_size=yes
449 e) libc_cv_mach_rpc_host_page_size=no ;;
456 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_rpc_host_page_size" >&5
457 printf "%s\n" "$libc_cv_mach_rpc_host_page_size" >&6; }
458 if test $libc_cv_mach_rpc_host_page_size = yes; then
459 printf "%s\n" "#define HAVE_HOST_PAGE_SIZE 1" >>confdefs.h
463 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread_set_name in gnumach.defs" >&5
464 printf %s "checking for thread_set_name in gnumach.defs... " >&6; }
465 if test ${libc_cv_mach_rpc_thread_set_name+y}
467 printf %s "(cached) " >&6
469 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
470 /* end confdefs.h. */
471 #include <mach/gnumach.defs>
474 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
475 $EGREP_TRADITIONAL "thread_set_name" >/dev/null 2>&1
477 libc_cv_mach_rpc_thread_set_name=yes
479 e) libc_cv_mach_rpc_thread_set_name=no ;;
486 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_rpc_thread_set_name" >&5
487 printf "%s\n" "$libc_cv_mach_rpc_thread_set_name" >&6; }
488 if test $libc_cv_mach_rpc_thread_set_name = yes; then
489 printf "%s\n" "#define HAVE_MACH_THREAD_SET_NAME 1" >>confdefs.h
493 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread_get_name in gnumach.defs" >&5
494 printf %s "checking for thread_get_name in gnumach.defs... " >&6; }
495 if test ${libc_cv_mach_rpc_thread_get_name+y}
497 printf %s "(cached) " >&6
499 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
500 /* end confdefs.h. */
501 #include <mach/gnumach.defs>
504 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
505 $EGREP_TRADITIONAL "thread_get_name" >/dev/null 2>&1
507 libc_cv_mach_rpc_thread_get_name=yes
509 e) libc_cv_mach_rpc_thread_get_name=no ;;
516 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_rpc_thread_get_name" >&5
517 printf "%s\n" "$libc_cv_mach_rpc_thread_get_name" >&6; }
518 if test $libc_cv_mach_rpc_thread_get_name = yes; then
519 printf "%s\n" "#define HAVE_MACH_THREAD_GET_NAME 1" >>confdefs.h
524 ac_fn_c_check_header_preproc "$LINENO" "mach/machine/ndr_def.h" "ac_cv_header_mach_machine_ndr_def_h"
525 if test "x$ac_cv_header_mach_machine_ndr_def_h" = xyes
527 DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
529 e) ac_fn_c_check_header_preproc "$LINENO" "machine/ndr_def.h" "ac_cv_header_machine_ndr_def_h"
530 if test "x$ac_cv_header_machine_ndr_def_h" = xyes
532 DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
539 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for i386_io_perm_modify in mach_i386.defs" >&5
540 printf %s "checking for i386_io_perm_modify in mach_i386.defs... " >&6; }
541 if test ${libc_cv_mach_i386_ioports+y}
543 printf %s "(cached) " >&6
545 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
546 /* end confdefs.h. */
547 #include <mach/machine/mach_i386.defs>
550 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
551 $EGREP_TRADITIONAL "i386_io_perm_modify" >/dev/null 2>&1
553 libc_cv_mach_i386_ioports=yes
555 e) libc_cv_mach_i386_ioports=no ;;
562 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_ioports" >&5
563 printf "%s\n" "$libc_cv_mach_i386_ioports" >&6; }
564 if test $libc_cv_mach_i386_ioports = yes; then
565 printf "%s\n" "#define HAVE_I386_IO_PERM_MODIFY 1" >>confdefs.h
569 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for i386_set_gdt in mach_i386.defs" >&5
570 printf %s "checking for i386_set_gdt in mach_i386.defs... " >&6; }
571 if test ${libc_cv_mach_i386_gdt+y}
573 printf %s "(cached) " >&6
575 e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
576 /* end confdefs.h. */
577 #include <mach/machine/mach_i386.defs>
580 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
581 $EGREP_TRADITIONAL "i386_set_gdt" >/dev/null 2>&1
583 libc_cv_mach_i386_gdt=yes
585 e) libc_cv_mach_i386_gdt=no ;;
592 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_gdt" >&5
593 printf "%s\n" "$libc_cv_mach_i386_gdt" >&6; }
594 if test $libc_cv_mach_i386_gdt = yes; then
595 printf "%s\n" "#define HAVE_I386_SET_GDT 1" >>confdefs.h
599 CPPFLAGS=$OLD_CPPFLAGS