]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/mach/configure.in
* sysdeps/mach/hurd/times.c: Fix typo in last change.
[thirdparty/glibc.git] / sysdeps / mach / configure.in
1 sinclude(./aclocal.m4)dnl Autoconf lossage.
2 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
3
4 ### Sanity checks for Mach header installation
5 AC_CHECK_HEADER(mach/mach_types.h,, [AC_MSG_ERROR([cannot find Mach headers])])
6 AC_CHECK_HEADER(mach/mach_types.defs,, [dnl
7 AC_MSG_ERROR([cannot find Mach .defs files])])
8
9 dnl
10 dnl mach_TYPE_CHECK(foo_t, bar_t)
11 dnl
12 dnl Check if foo_t is defined by <mach/mach_types.h>.
13 dnl If not, compile with -Dfoo_t=bar_t.
14 dnl
15 AC_DEFUN([mach_TYPE_CHECK], [dnl
16 AC_CACHE_CHECK(for $1 in mach/mach_types.h, libc_cv_mach_$1,
17 AC_TRY_COMPILE([#include <mach/mach_types.h>], [extern $1 foo;],
18 libc_cv_mach_$1=$1, libc_cv_mach_$1=$2))
19 if test [$]libc_cv_mach_$1 != $1; then
20 DEFINES="$DEFINES -D$1=$2"
21 fi])
22
23 dnl
24 dnl OSF Mach has renamed these typedefs for some reason.
25 dnl
26 mach_TYPE_CHECK(task_t, task_port_t)
27 mach_TYPE_CHECK(thread_t, thread_port_t)
28
29 dnl
30 dnl The creation_time field is a GNU Mach addition the other variants lack.
31 dnl
32 AC_CACHE_CHECK(for creation_time in task_basic_info,
33 libc_cv_mach_task_creation_time, [dnl
34 AC_TRY_COMPILE([#include <mach/task_info.h>], [
35 extern struct task_basic_info *i;
36 long s = i->creation_time.seconds;
37 ], libc_cv_mach_task_creation_time=yes, libc_cv_mach_task_creation_time=no)])
38 if test $libc_cv_mach_task_creation_time = no; then
39 DEFINES="$DEFINES -DNO_CREATION_TIME=1"
40 fi
41
42 dnl
43 dnl The Darwin variant no longer has <mach/mach.defs>
44 dnl but instead has several constituent .defs files.
45 dnl In this scenario we will presume there is a <mach/mach_interface.h>
46 dnl that contains an #include for each constituent header file,
47 dnl but we don't do a check for that here because in a bare
48 dnl environment the compile against those headers will fail.
49 dnl
50 mach_interface_list=
51 for ifc in mach mach4 \
52 clock clock_priv host_priv host_security ledger lock_set \
53 processor processor_set task thread_act vm_map \
54 memory_object memory_object_default default_pager \
55 ; do
56 AC_CHECK_HEADER(mach/${ifc}.defs, [dnl
57 mach_interface_list="$mach_interface_list $ifc"])
58 done
59 if test "x$mach_interface_list" = x; then
60 AC_MSG_ERROR([what manner of Mach is this?])
61 fi
62
63 AC_CACHE_CHECK(for host_page_size in mach_host.defs,
64 libc_cv_mach_host_page_size, [dnl
65 AC_EGREP_HEADER(host_page_size, mach/mach_host.defs,
66 libc_cv_mach_host_page_size=yes,
67 libc_cv_mach_host_page_size=no)])
68 if test $libc_cv_mach_host_page_size = yes; then
69 AC_DEFINE([HAVE_HOST_PAGE_SIZE])
70 fi
71
72 AC_CHECK_HEADER(mach/machine/ndr_def.h, [dnl
73 DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"], [dnl
74 AC_CHECK_HEADER(machine/ndr_def.h, [dnl
75 DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"])])