Call "CST" a time zone abbreviation, not a name
[glibc.git] / sysdeps / mach / configure
blobb125d24f0568e15937fac5425f75a6dabe257c19
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
12 else
13   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14 /* end confdefs.h.  */
15 #include <$2>
16 _ACEOF
17 if ac_fn_c_try_cpp "$LINENO"; then :
18   eval "$3=yes"
19 else
20   eval "$3=no"
22 rm -f conftest.err conftest.i conftest.$ac_ext
24 eval 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
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
39 else
40   if test -n "$MIG"; then
41   ac_cv_prog_MIG="$MIG" # Let the user override the test.
42 else
43 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
44 for as_dir in $PATH
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
54 done
55   done
56 IFS=$as_save_IFS
60 MIG=$ac_cv_prog_MIG
61 if test -n "$MIG"; then
62   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIG" >&5
63 $as_echo "$MIG" >&6; }
64 else
65   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
66 $as_echo "no" >&6; }
71 if 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.
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
79 else
80   if test -n "$ac_ct_MIG"; then
81   ac_cv_prog_ac_ct_MIG="$ac_ct_MIG" # Let the user override the test.
82 else
83 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
84 for as_dir in $PATH
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
94 done
95   done
96 IFS=$as_save_IFS
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; }
104 else
105   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
106 $as_echo "no" >&6; }
109   if test "x$ac_ct_MIG" = x; then
110     MIG="MISSING"
111   else
112     case $cross_compiling:$ac_tool_warned in
113 yes:)
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 ;;
117 esac
118     MIG=$ac_ct_MIG
119   fi
120 else
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
128 MIG = $MIG"
130 OLD_CPPFLAGS=$CPPFLAGS
131 if test -n "$sysheaders"; then
132   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
135 ### Sanity checks for Mach header installation
136 CPPFLAGS="$CPPFLAGS -ffreestanding"
139 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.h" "ac_cv_header_mach_mach_types_h"
140 if test "x$ac_cv_header_mach_mach_types_h" = xyes; then :
142 else
143   as_fn_error $? "cannot find Mach headers" "$LINENO" 5
147 ac_fn_c_check_header_preproc "$LINENO" "mach/mach_types.defs" "ac_cv_header_mach_mach_types_defs"
148 if test "x$ac_cv_header_mach_mach_types_defs" = xyes; then :
150 else
151   as_fn_error $? "cannot find Mach .defs files" "$LINENO" 5
158 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for task_t in mach/mach_types.h" >&5
159 $as_echo_n "checking for task_t in mach/mach_types.h... " >&6; }
160 if ${libc_cv_mach_task_t+:} false; then :
161   $as_echo_n "(cached) " >&6
162 else
163   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
164 /* end confdefs.h.  */
165 #include <mach/mach_types.h>
167 main ()
169 extern task_t foo;
170   ;
171   return 0;
173 _ACEOF
174 if ac_fn_c_try_compile "$LINENO"; then :
175   libc_cv_mach_task_t=task_t
176 else
177   libc_cv_mach_task_t=task_port_t
179 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
181 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_t" >&5
182 $as_echo "$libc_cv_mach_task_t" >&6; }
183 if test $libc_cv_mach_task_t != task_t; then
184   DEFINES="$DEFINES -Dtask_t=task_port_t"
186 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread_t in mach/mach_types.h" >&5
187 $as_echo_n "checking for thread_t in mach/mach_types.h... " >&6; }
188 if ${libc_cv_mach_thread_t+:} false; then :
189   $as_echo_n "(cached) " >&6
190 else
191   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
192 /* end confdefs.h.  */
193 #include <mach/mach_types.h>
195 main ()
197 extern thread_t foo;
198   ;
199   return 0;
201 _ACEOF
202 if ac_fn_c_try_compile "$LINENO"; then :
203   libc_cv_mach_thread_t=thread_t
204 else
205   libc_cv_mach_thread_t=thread_port_t
207 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
209 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_thread_t" >&5
210 $as_echo "$libc_cv_mach_thread_t" >&6; }
211 if test $libc_cv_mach_thread_t != thread_t; then
212   DEFINES="$DEFINES -Dthread_t=thread_port_t"
215 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for creation_time in task_basic_info" >&5
216 $as_echo_n "checking for creation_time in task_basic_info... " >&6; }
217 if ${libc_cv_mach_task_creation_time+:} false; then :
218   $as_echo_n "(cached) " >&6
219 else
220   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
221 /* end confdefs.h.  */
222 #include <mach/task_info.h>
224 main ()
227 extern struct task_basic_info *i;
228 long s = i->creation_time.seconds;
230   ;
231   return 0;
233 _ACEOF
234 if ac_fn_c_try_compile "$LINENO"; then :
235   libc_cv_mach_task_creation_time=yes
236 else
237   libc_cv_mach_task_creation_time=no
239 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
241 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mach_task_creation_time" >&5
242 $as_echo "$libc_cv_mach_task_creation_time" >&6; }
243 if test $libc_cv_mach_task_creation_time = no; then
244   as_fn_error $? "you need Mach headers supporting task_info.creation_time" "$LINENO" 5
247 mach_interface_list=
248 for ifc in mach mach4 gnumach \
249            clock clock_priv host_priv host_security ledger lock_set \
250            processor processor_set task task_notify thread_act vm_map \
251            memory_object memory_object_default i386/mach_i386 x86_64/mach_i386 \
252            ; do
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"
260 done
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
269 else
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
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
284 case `"$ac_path_GREP" --version 2>&1` in
285 *GNU*)
286   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
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;;
308 esac
310       $ac_path_GREP_found && break 3
311     done
312   done
313   done
314 IFS=$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
318 else
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
332 else
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
340 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
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
350 case `"$ac_path_EGREP" --version 2>&1` in
351 *GNU*)
352   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
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;;
374 esac
376       $ac_path_EGREP_found && break 3
377     done
378   done
379   done
380 IFS=$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
384 else
385   ac_cv_path_EGREP=$EGREP
388    fi
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
399 else
400   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
401 /* end confdefs.h.  */
402 #include <mach/mach_host.defs>
404 _ACEOF
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
408 else
409   libc_cv_mach_host_page_size=no
411 rm -f conftest*
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>'"
424 else
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
439 else
440   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
441 /* end confdefs.h.  */
442 #include <mach/machine/mach_i386.defs>
444 _ACEOF
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
448 else
449   libc_cv_mach_i386_ioports=no
451 rm -f conftest*
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
465 else
466   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
467 /* end confdefs.h.  */
468 #include <mach/machine/mach_i386.defs>
470 _ACEOF
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
474 else
475   libc_cv_mach_i386_gdt=no
477 rm -f conftest*
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
488 CPPFLAGS=$OLD_CPPFLAGS