1
2# ac_fn_c_check_header_preproc LINENO HEADER VAR
3# ----------------------------------------------
4# Tests whether HEADER is present, setting the cache variable VAR accordingly.
5ac_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; }
10if eval \${$3+:} false; then :
11  $as_echo_n "(cached) " >&6
12else
13  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14/* end confdefs.h.  */
15#include <$2>
16_ACEOF
17if ac_fn_c_try_cpp "$LINENO"; then :
18  eval "$3=yes"
19else
20  eval "$3=no"
21fi
22rm -f conftest.err conftest.i conftest.$ac_ext
23fi
24eval 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
32if 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.
34set 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; }
37if ${ac_cv_prog_MIG+:} false; then :
38  $as_echo_n "(cached) " >&6
39else
40  if test -n "$MIG"; then
41  ac_cv_prog_MIG="$MIG" # Let the user override the test.
42else
43as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
44for as_dir in $PATH
45do
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
54done
55  done
56IFS=$as_save_IFS
57
58fi
59fi
60MIG=$ac_cv_prog_MIG
61if test -n "$MIG"; then
62  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIG" >&5
63$as_echo "$MIG" >&6; }
64else
65  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
66$as_echo "no" >&6; }
67fi
68
69
70fi
71if 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.
74set 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; }
77if ${ac_cv_prog_ac_ct_MIG+:} false; then :
78  $as_echo_n "(cached) " >&6
79else
80  if test -n "$ac_ct_MIG"; then
81  ac_cv_prog_ac_ct_MIG="$ac_ct_MIG" # Let the user override the test.
82else
83as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
84for as_dir in $PATH
85do
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
94done
95  done
96IFS=$as_save_IFS
97
98fi
99fi
100ac_ct_MIG=$ac_cv_prog_ac_ct_MIG
101if 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; }
104else
105  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
106$as_echo "no" >&6; }
107fi
108
109  if test "x$ac_ct_MIG" = x; then
110    MIG="MISSING"
111  else
112    case $cross_compiling:$ac_tool_warned in
113yes:)
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;}
116ac_tool_warned=yes ;;
117esac
118    MIG=$ac_ct_MIG
119  fi
120else
121  MIG="$ac_cv_prog_MIG"
122fi
123
124if test "x$MIG" = xMISSING; then
125  as_fn_error $? "cannot find required build tool mig" "$LINENO" 5
126fi
127config_vars="$config_vars
128MIG = $MIG"
129
130if test -n "$sysheaders"; then
131  OLD_CPPFLAGS=$CPPFLAGS
132  CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
133fi
134
135### Sanity checks for Mach header installation
136
137
138ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h"
139if test "x$ac_cv_header_mach_mach_types_h" = xyes; then :
140
141else
142  as_fn_error $? "cannot find Mach headers" "$LINENO" 5
143fi
144
145
146ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.defs" "ac_cv_header_mach_mach_types_defs"
147if test "x$ac_cv_header_mach_mach_types_defs" = xyes; then :
148
149else
150  as_fn_error $? "cannot find Mach .defs files" "$LINENO" 5
151fi
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; }
159if ${libc_cv_mach_task_t+:} false; then :
160  $as_echo_n "(cached) " >&6
161else
162  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
163/* end confdefs.h.  */
164#include <mach/mach_types.h>
165int
166main ()
167{
168extern task_t foo;
169  ;
170  return 0;
171}
172_ACEOF
173if ac_fn_c_try_compile "$LINENO"; then :
174  libc_cv_mach_task_t=task_t
175else
176  libc_cv_mach_task_t=task_port_t
177fi
178rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
179fi
180{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_t" >&5
181$as_echo "$libc_cv_mach_task_t" >&6; }
182if test $libc_cv_mach_task_t != task_t; then
183  DEFINES="$DEFINES -Dtask_t=task_port_t"
184fi
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; }
187if ${libc_cv_mach_thread_t+:} false; then :
188  $as_echo_n "(cached) " >&6
189else
190  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
191/* end confdefs.h.  */
192#include <mach/mach_types.h>
193int
194main ()
195{
196extern thread_t foo;
197  ;
198  return 0;
199}
200_ACEOF
201if ac_fn_c_try_compile "$LINENO"; then :
202  libc_cv_mach_thread_t=thread_t
203else
204  libc_cv_mach_thread_t=thread_port_t
205fi
206rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
207fi
208{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_thread_t" >&5
209$as_echo "$libc_cv_mach_thread_t" >&6; }
210if test $libc_cv_mach_thread_t != thread_t; then
211  DEFINES="$DEFINES -Dthread_t=thread_port_t"
212fi
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; }
216if ${libc_cv_mach_task_creation_time+:} false; then :
217  $as_echo_n "(cached) " >&6
218else
219  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
220/* end confdefs.h.  */
221#include <mach/task_info.h>
222int
223main ()
224{
225
226extern struct task_basic_info *i;
227long s = i->creation_time.seconds;
228
229  ;
230  return 0;
231}
232_ACEOF
233if ac_fn_c_try_compile "$LINENO"; then :
234  libc_cv_mach_task_creation_time=yes
235else
236  libc_cv_mach_task_creation_time=no
237fi
238rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
239fi
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; }
242if test $libc_cv_mach_task_creation_time = no; then
243  as_fn_error $? "you need Mach headers supporting task_info.creation_time" "$LINENO" 5
244fi
245
246mach_interface_list=
247for 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`
254ac_fn_c_check_header_preproc "$LINENO" "mach/${ifc}.defs" "$as_ac_Header"
255if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
256    mach_interface_list="$mach_interface_list $ifc"
257fi
258
259
260done
261if test "x$mach_interface_list" = x; then
262  as_fn_error $? "what manner of Mach is this?" "$LINENO" 5
263fi
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; }
267if ${ac_cv_path_GREP+:} false; then :
268  $as_echo_n "(cached) " >&6
269else
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
274for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
275do
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
284case `"$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;;
308esac
309
310      $ac_path_GREP_found && break 3
311    done
312  done
313  done
314IFS=$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
318else
319  ac_cv_path_GREP=$GREP
320fi
321
322fi
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; }
330if ${ac_cv_path_EGREP+:} false; then :
331  $as_echo_n "(cached) " >&6
332else
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
340for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
341do
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
350case `"$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;;
374esac
375
376      $ac_path_EGREP_found && break 3
377    done
378  done
379  done
380IFS=$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
384else
385  ac_cv_path_EGREP=$EGREP
386fi
387
388   fi
389fi
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; }
397if ${libc_cv_mach_host_page_size+:} false; then :
398  $as_echo_n "(cached) " >&6
399else
400  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
401/* end confdefs.h.  */
402#include <mach/mach_host.defs>
403
404_ACEOF
405if (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
408else
409  libc_cv_mach_host_page_size=no
410fi
411rm -f conftest*
412
413fi
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; }
416if test $libc_cv_mach_host_page_size = yes; then
417  $as_echo "#define HAVE_HOST_PAGE_SIZE 1" >>confdefs.h
418
419fi
420
421ac_fn_c_check_header_preproc "$LINENO" "mach/machine/ndr_def.h" "ac_cv_header_mach_machine_ndr_def_h"
422if test "x$ac_cv_header_mach_machine_ndr_def_h" = xyes; then :
423    DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
424else
425  ac_fn_c_check_header_preproc "$LINENO" "machine/ndr_def.h" "ac_cv_header_machine_ndr_def_h"
426if test "x$ac_cv_header_machine_ndr_def_h" = xyes; then :
427    DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
428fi
429
430
431fi
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; }
437if ${libc_cv_mach_i386_ioports+:} false; then :
438  $as_echo_n "(cached) " >&6
439else
440  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
441/* end confdefs.h.  */
442#include <mach/i386/mach_i386.defs>
443
444_ACEOF
445if (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
448else
449  libc_cv_mach_i386_ioports=no
450fi
451rm -f conftest*
452
453fi
454{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_ioports" >&5
455$as_echo "$libc_cv_mach_i386_ioports" >&6; }
456if test $libc_cv_mach_i386_ioports = yes; then
457  $as_echo "#define HAVE_I386_IO_PERM_MODIFY 1" >>confdefs.h
458
459fi
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; }
463if ${libc_cv_mach_i386_gdt+:} false; then :
464  $as_echo_n "(cached) " >&6
465else
466  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
467/* end confdefs.h.  */
468#include <mach/i386/mach_i386.defs>
469
470_ACEOF
471if (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
474else
475  libc_cv_mach_i386_gdt=no
476fi
477rm -f conftest*
478
479fi
480{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_i386_gdt" >&5
481$as_echo "$libc_cv_mach_i386_gdt" >&6; }
482if test $libc_cv_mach_i386_gdt = yes; then
483  $as_echo "#define HAVE_I386_SET_GDT 1" >>confdefs.h
484
485fi
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; }
492if ${hurd_cv_mig_retcode+:} false; then :
493  $as_echo_n "(cached) " >&6
494else
495  cat > conftest.defs <<\EOF
496#include <mach/std_types.defs>
497#include <mach/mach_types.defs>
498subsystem foobar 1000;
499type reply_port_t = polymorphic | MACH_MSG_TYPE_PORT_SEND_ONCE
500	ctype: mach_port_t;
501simpleroutine foobar_reply (
502	reply_port: reply_port_t;
503	err: kern_return_t, RetCode);
504EOF
505if { 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
512else
513  hurd_cv_mig_retcode=no
514fi
515rm -f conftest*
516fi
517{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hurd_cv_mig_retcode" >&5
518$as_echo "$hurd_cv_mig_retcode" >&6; }
519if test $hurd_cv_mig_retcode = yes; then
520  $as_echo "#define HAVE_MIG_RETCODE 1" >>confdefs.h
521
522fi
523
524if test -n "$sysheaders"; then
525  CPPFLAGS=$OLD_CPPFLAGS
526fi
527