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