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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19 if ac_fn_c_try_cpp "$LINENO"
25 rm -f conftest.err conftest.i conftest.$ac_ext
28 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
29 printf "%s\n" "$ac_res" >&6; }
30 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
32 } # ac_fn_c_check_header_preproc
33 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
35 if test -n "$ac_tool_prefix"; then
36 # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
37 set dummy ${ac_tool_prefix}mig; ac_word=$2
38 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
39 printf %s "checking for $ac_word... " >&6; }
40 if test ${ac_cv_prog_MIG+y}
42 printf %s "(cached) " >&6
44 if test -n "$MIG"; then
45 ac_cv_prog_MIG="$MIG" # Let the user override the test.
47 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
56 for ac_exec_ext in '' $ac_executable_extensions; do
57 if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
58 ac_cv_prog_MIG="${ac_tool_prefix}mig"
59 printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
69 if test -n "$MIG"; then
70 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MIG" >&5
71 printf "%s\n" "$MIG" >&6; }
73 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
74 printf "%s\n" "no" >&6; }
79 if test -z "$ac_cv_prog_MIG"; then
81 # Extract the first word of "mig", so it can be a program name with args.
82 set dummy mig; ac_word=$2
83 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
84 printf %s "checking for $ac_word... " >&6; }
85 if test ${ac_cv_prog_ac_ct_MIG+y}
87 printf %s "(cached) " >&6
89 if test -n "$ac_ct_MIG"; then
90 ac_cv_prog_ac_ct_MIG="$ac_ct_MIG" # Let the user override the test.
92 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
101 for ac_exec_ext in '' $ac_executable_extensions; do
102 if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
103 ac_cv_prog_ac_ct_MIG="mig"
104 printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
113 ac_ct_MIG=$ac_cv_prog_ac_ct_MIG
114 if test -n "$ac_ct_MIG"; then
115 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MIG" >&5
116 printf "%s\n" "$ac_ct_MIG" >&6; }
118 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
119 printf "%s\n" "no" >&6; }
122 if test "x$ac_ct_MIG" = x; then
125 case $cross_compiling:$ac_tool_warned in
127 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
128 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
129 ac_tool_warned=yes ;;
134 MIG="$ac_cv_prog_MIG"
137 if test "x$MIG" = xMISSING; then
138 as_fn_error $? "cannot find required build tool mig" "$LINENO" 5
140 config_vars="$config_vars
143 OLD_CPPFLAGS=$CPPFLAGS
144 if test -n "$sysheaders"; then
145 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
148 ### Sanity checks for Mach header installation
149 CPPFLAGS="$CPPFLAGS -ffreestanding"
152 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h"
153 if test "x$ac_cv_header_mach_mach_types_h" = xyes
157 as_fn_error $? "cannot find Mach headers" "$LINENO" 5
160 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.defs" "ac_cv_header_mach_mach_types_defs"
161 if test "x$ac_cv_header_mach_mach_types_defs" = xyes
165 as_fn_error $? "cannot find Mach .defs files" "$LINENO" 5
171 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for task_t in mach/mach_types.h" >&5
172 printf %s "checking for task_t in mach/mach_types.h... " >&6; }
173 if test ${libc_cv_mach_task_t+y}
175 printf %s "(cached) " >&6
177 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
178 /* end confdefs.h. */
179 #include <mach/mach_types.h>
188 if ac_fn_c_try_compile "$LINENO"
190 libc_cv_mach_task_t=task_t
192 libc_cv_mach_task_t=task_port_t
194 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
196 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_t" >&5
197 printf "%s\n" "$libc_cv_mach_task_t" >&6; }
198 if test $libc_cv_mach_task_t != task_t; then
199 DEFINES="$DEFINES -Dtask_t=task_port_t"
201 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread_t in mach/mach_types.h" >&5
202 printf %s "checking for thread_t in mach/mach_types.h... " >&6; }
203 if test ${libc_cv_mach_thread_t+y}
205 printf %s "(cached) " >&6
207 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
208 /* end confdefs.h. */
209 #include <mach/mach_types.h>
218 if ac_fn_c_try_compile "$LINENO"
220 libc_cv_mach_thread_t=thread_t
222 libc_cv_mach_thread_t=thread_port_t
224 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
226 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_thread_t" >&5
227 printf "%s\n" "$libc_cv_mach_thread_t" >&6; }
228 if test $libc_cv_mach_thread_t != thread_t; then
229 DEFINES="$DEFINES -Dthread_t=thread_port_t"
232 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for creation_time in task_basic_info" >&5
233 printf %s "checking for creation_time in task_basic_info... " >&6; }
234 if test ${libc_cv_mach_task_creation_time+y}
236 printf %s "(cached) " >&6
238 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
239 /* end confdefs.h. */
240 #include <mach/task_info.h>
245 extern struct task_basic_info *i;
246 long s = i->creation_time.seconds;
252 if ac_fn_c_try_compile "$LINENO"
254 libc_cv_mach_task_creation_time=yes
256 libc_cv_mach_task_creation_time=no
258 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
260 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_creation_time" >&5
261 printf "%s\n" "$libc_cv_mach_task_creation_time" >&6; }
262 if test $libc_cv_mach_task_creation_time = no; then
263 as_fn_error $? "you need Mach headers supporting task_info.creation_time" "$LINENO" 5
267 for ifc in mach mach4 gnumach \
268 clock clock_priv host_priv host_security ledger lock_set \
269 processor processor_set task task_notify thread_act vm_map \
270 memory_object memory_object_default i386/mach_i386 x86_64/mach_i386 \
272 as_ac_Header=`printf "%s\n" "ac_cv_header_mach/${ifc}.defs" | $as_tr_sh`
273 ac_fn_c_check_header_preproc "$LINENO" "mach/${ifc}.defs" "$as_ac_Header"
274 if eval test \"x\$"$as_ac_Header"\" = x"yes"
276 mach_interface_list="$mach_interface_list $ifc"
280 if test "x$mach_interface_list" = x; then
281 as_fn_error $? "what manner of Mach is this?" "$LINENO" 5
284 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
285 printf %s "checking for grep that handles long lines and -e... " >&6; }
286 if test ${ac_cv_path_GREP+y}
288 printf %s "(cached) " >&6
290 if test -z "$GREP"; then
291 ac_path_GREP_found=false
292 # Loop through the user's path and test for each of PROGNAME-LIST
293 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
294 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
300 *) as_dir=$as_dir/ ;;
302 for ac_prog in grep ggrep
304 for ac_exec_ext in '' $ac_executable_extensions; do
305 ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
306 as_fn_executable_p "$ac_path_GREP" || continue
307 # Check for GNU ac_path_GREP and select it if it is found.
308 # Check for GNU $ac_path_GREP
309 case `"$ac_path_GREP" --version 2>&1` in
311 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
314 printf %s 0123456789 >"conftest.in"
317 cat "conftest.in" "conftest.in" >"conftest.tmp"
318 mv "conftest.tmp" "conftest.in"
319 cp "conftest.in" "conftest.nl"
320 printf "%s\n" 'GREP' >> "conftest.nl"
321 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
322 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
323 as_fn_arith $ac_count + 1 && ac_count=$as_val
324 if test $ac_count -gt ${ac_path_GREP_max-0}; then
325 # Best one so far, save it but keep looking for a better one
326 ac_cv_path_GREP="$ac_path_GREP"
327 ac_path_GREP_max=$ac_count
329 # 10*(2^10) chars as input seems more than enough
330 test $ac_count -gt 10 && break
332 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
335 $ac_path_GREP_found && break 3
340 if test -z "$ac_cv_path_GREP"; then
341 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
344 ac_cv_path_GREP=$GREP
348 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
349 printf "%s\n" "$ac_cv_path_GREP" >&6; }
350 GREP="$ac_cv_path_GREP"
353 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
354 printf %s "checking for egrep... " >&6; }
355 if test ${ac_cv_path_EGREP+y}
357 printf %s "(cached) " >&6
359 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
360 then ac_cv_path_EGREP="$GREP -E"
362 if test -z "$EGREP"; then
363 ac_path_EGREP_found=false
364 # Loop through the user's path and test for each of PROGNAME-LIST
365 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
366 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
372 *) as_dir=$as_dir/ ;;
376 for ac_exec_ext in '' $ac_executable_extensions; do
377 ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
378 as_fn_executable_p "$ac_path_EGREP" || continue
379 # Check for GNU ac_path_EGREP and select it if it is found.
380 # Check for GNU $ac_path_EGREP
381 case `"$ac_path_EGREP" --version 2>&1` in
383 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
386 printf %s 0123456789 >"conftest.in"
389 cat "conftest.in" "conftest.in" >"conftest.tmp"
390 mv "conftest.tmp" "conftest.in"
391 cp "conftest.in" "conftest.nl"
392 printf "%s\n" 'EGREP' >> "conftest.nl"
393 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
394 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
395 as_fn_arith $ac_count + 1 && ac_count=$as_val
396 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
397 # Best one so far, save it but keep looking for a better one
398 ac_cv_path_EGREP="$ac_path_EGREP"
399 ac_path_EGREP_max=$ac_count
401 # 10*(2^10) chars as input seems more than enough
402 test $ac_count -gt 10 && break
404 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
407 $ac_path_EGREP_found && break 3
412 if test -z "$ac_cv_path_EGREP"; then
413 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
416 ac_cv_path_EGREP=$EGREP
421 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
422 printf "%s\n" "$ac_cv_path_EGREP" >&6; }
423 EGREP="$ac_cv_path_EGREP"
426 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for host_page_size in mach_host.defs" >&5
427 printf %s "checking for host_page_size in mach_host.defs... " >&6; }
428 if test ${libc_cv_mach_host_page_size+y}
430 printf %s "(cached) " >&6
432 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
433 /* end confdefs.h. */
434 #include <mach/mach_host.defs>
437 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
438 $EGREP "host_page_size" >/dev/null 2>&1
440 libc_cv_mach_host_page_size=yes
442 libc_cv_mach_host_page_size=no
447 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_host_page_size" >&5
448 printf "%s\n" "$libc_cv_mach_host_page_size" >&6; }
449 if test $libc_cv_mach_host_page_size = yes; then
450 printf "%s\n" "#define HAVE_HOST_PAGE_SIZE 1" >>confdefs.h
454 ac_fn_c_check_header_preproc "$LINENO" "mach/machine/ndr_def.h" "ac_cv_header_mach_machine_ndr_def_h"
455 if test "x$ac_cv_header_mach_machine_ndr_def_h" = xyes
457 DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
459 ac_fn_c_check_header_preproc "$LINENO" "machine/ndr_def.h" "ac_cv_header_machine_ndr_def_h"
460 if test "x$ac_cv_header_machine_ndr_def_h" = xyes
462 DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
468 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for i386_io_perm_modify in mach_i386.defs" >&5
469 printf %s "checking for i386_io_perm_modify in mach_i386.defs... " >&6; }
470 if test ${libc_cv_mach_i386_ioports+y}
472 printf %s "(cached) " >&6
474 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
475 /* end confdefs.h. */
476 #include <mach/machine/mach_i386.defs>
479 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
480 $EGREP "i386_io_perm_modify" >/dev/null 2>&1
482 libc_cv_mach_i386_ioports=yes
484 libc_cv_mach_i386_ioports=no
489 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_ioports" >&5
490 printf "%s\n" "$libc_cv_mach_i386_ioports" >&6; }
491 if test $libc_cv_mach_i386_ioports = yes; then
492 printf "%s\n" "#define HAVE_I386_IO_PERM_MODIFY 1" >>confdefs.h
496 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for i386_set_gdt in mach_i386.defs" >&5
497 printf %s "checking for i386_set_gdt in mach_i386.defs... " >&6; }
498 if test ${libc_cv_mach_i386_gdt+y}
500 printf %s "(cached) " >&6
502 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
503 /* end confdefs.h. */
504 #include <mach/machine/mach_i386.defs>
507 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
508 $EGREP "i386_set_gdt" >/dev/null 2>&1
510 libc_cv_mach_i386_gdt=yes
512 libc_cv_mach_i386_gdt=no
517 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_gdt" >&5
518 printf "%s\n" "$libc_cv_mach_i386_gdt" >&6; }
519 if test $libc_cv_mach_i386_gdt = yes; then
520 printf "%s\n" "#define HAVE_I386_SET_GDT 1" >>confdefs.h
524 CPPFLAGS=$OLD_CPPFLAGS