]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/mach/configure
* sysdeps/mach/hurd/times.c: Fix typo in last change.
[thirdparty/glibc.git] / sysdeps / mach / configure
CommitLineData
fb190a04 1
746f4007
RM
2### Sanity checks for Mach header installation
3ac_safe=`echo "mach/mach_types.h" | sed 'y%./+-%__p_%'`
4echo $ac_n "checking for mach/mach_types.h""... $ac_c" 1>&6
5echo "configure:6: checking for mach/mach_types.h" >&5
6if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7 echo $ac_n "(cached) $ac_c" 1>&6
8else
9 cat > conftest.$ac_ext <<EOF
10#line 11 "configure"
11#include "confdefs.h"
12#include <mach/mach_types.h>
13EOF
14ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15{ (eval echo configure:16: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
16ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
17if test -z "$ac_err"; then
18 rm -rf conftest*
19 eval "ac_cv_header_$ac_safe=yes"
20else
21 echo "$ac_err" >&5
22 echo "configure: failed program was:" >&5
23 cat conftest.$ac_ext >&5
24 rm -rf conftest*
25 eval "ac_cv_header_$ac_safe=no"
26fi
27rm -f conftest*
28fi
29if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
30 echo "$ac_t""yes" 1>&6
31 :
32else
33 echo "$ac_t""no" 1>&6
34{ echo "configure: error: cannot find Mach headers" 1>&2; exit 1; }
35fi
36
37ac_safe=`echo "mach/mach_types.defs" | sed 'y%./+-%__p_%'`
38echo $ac_n "checking for mach/mach_types.defs""... $ac_c" 1>&6
39echo "configure:40: checking for mach/mach_types.defs" >&5
40if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
41 echo $ac_n "(cached) $ac_c" 1>&6
42else
43 cat > conftest.$ac_ext <<EOF
44#line 45 "configure"
45#include "confdefs.h"
46#include <mach/mach_types.defs>
47EOF
48ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
49{ (eval echo configure:50: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
50ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
51if test -z "$ac_err"; then
52 rm -rf conftest*
53 eval "ac_cv_header_$ac_safe=yes"
54else
55 echo "$ac_err" >&5
56 echo "configure: failed program was:" >&5
57 cat conftest.$ac_ext >&5
58 rm -rf conftest*
59 eval "ac_cv_header_$ac_safe=no"
60fi
61rm -f conftest*
62fi
63if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
64 echo "$ac_t""yes" 1>&6
65 :
66else
67 echo "$ac_t""no" 1>&6
68{ echo "configure: error: cannot find Mach .defs files" 1>&2; exit 1; }
69fi
70
71
fb190a04
RM
72
73
74echo $ac_n "checking for task_t in mach/mach_types.h""... $ac_c" 1>&6
746f4007 75echo "configure:76: checking for task_t in mach/mach_types.h" >&5
fb190a04
RM
76if eval "test \"`echo '$''{'libc_cv_mach_task_t'+set}'`\" = set"; then
77 echo $ac_n "(cached) $ac_c" 1>&6
78else
79 cat > conftest.$ac_ext <<EOF
746f4007 80#line 81 "configure"
fb190a04
RM
81#include "confdefs.h"
82#include <mach/mach_types.h>
83int main() {
84extern task_t foo;
85; return 0; }
86EOF
746f4007 87if { (eval echo configure:88: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
fb190a04
RM
88 rm -rf conftest*
89 libc_cv_mach_task_t=task_t
90else
91 echo "configure: failed program was:" >&5
92 cat conftest.$ac_ext >&5
93 rm -rf conftest*
94 libc_cv_mach_task_t=task_port_t
95fi
96rm -f conftest*
97fi
98
99echo "$ac_t""$libc_cv_mach_task_t" 1>&6
100if test $libc_cv_mach_task_t != task_t; then
101 DEFINES="$DEFINES -Dtask_t=task_port_t"
102fi
103echo $ac_n "checking for thread_t in mach/mach_types.h""... $ac_c" 1>&6
746f4007 104echo "configure:105: checking for thread_t in mach/mach_types.h" >&5
fb190a04
RM
105if eval "test \"`echo '$''{'libc_cv_mach_thread_t'+set}'`\" = set"; then
106 echo $ac_n "(cached) $ac_c" 1>&6
107else
108 cat > conftest.$ac_ext <<EOF
746f4007 109#line 110 "configure"
fb190a04
RM
110#include "confdefs.h"
111#include <mach/mach_types.h>
112int main() {
113extern thread_t foo;
114; return 0; }
115EOF
746f4007 116if { (eval echo configure:117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
fb190a04
RM
117 rm -rf conftest*
118 libc_cv_mach_thread_t=thread_t
119else
120 echo "configure: failed program was:" >&5
121 cat conftest.$ac_ext >&5
122 rm -rf conftest*
123 libc_cv_mach_thread_t=thread_port_t
124fi
125rm -f conftest*
126fi
127
128echo "$ac_t""$libc_cv_mach_thread_t" 1>&6
129if test $libc_cv_mach_thread_t != thread_t; then
130 DEFINES="$DEFINES -Dthread_t=thread_port_t"
131fi
132
133echo $ac_n "checking for creation_time in task_basic_info""... $ac_c" 1>&6
746f4007 134echo "configure:135: checking for creation_time in task_basic_info" >&5
fb190a04
RM
135if eval "test \"`echo '$''{'libc_cv_mach_task_creation_time'+set}'`\" = set"; then
136 echo $ac_n "(cached) $ac_c" 1>&6
137else
138 cat > conftest.$ac_ext <<EOF
746f4007 139#line 140 "configure"
fb190a04
RM
140#include "confdefs.h"
141#include <mach/task_info.h>
142int main() {
143
144extern struct task_basic_info *i;
145long s = i->creation_time.seconds;
146
147; return 0; }
148EOF
746f4007 149if { (eval echo configure:150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
fb190a04
RM
150 rm -rf conftest*
151 libc_cv_mach_task_creation_time=yes
152else
153 echo "configure: failed program was:" >&5
154 cat conftest.$ac_ext >&5
155 rm -rf conftest*
156 libc_cv_mach_task_creation_time=no
157fi
158rm -f conftest*
159fi
160
161echo "$ac_t""$libc_cv_mach_task_creation_time" 1>&6
162if test $libc_cv_mach_task_creation_time = no; then
163 DEFINES="$DEFINES -DNO_CREATION_TIME=1"
164fi
746f4007
RM
165
166mach_interface_list=
167for ifc in mach mach4 \
3a2832a0 168 clock clock_priv host_priv host_security ledger lock_set \
746f4007
RM
169 processor processor_set task thread_act vm_map \
170 memory_object memory_object_default default_pager \
171 ; do
172 ac_safe=`echo "mach/${ifc}.defs" | sed 'y%./+-%__p_%'`
173echo $ac_n "checking for mach/${ifc}.defs""... $ac_c" 1>&6
174echo "configure:175: checking for mach/${ifc}.defs" >&5
175if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
176 echo $ac_n "(cached) $ac_c" 1>&6
177else
178 cat > conftest.$ac_ext <<EOF
179#line 180 "configure"
180#include "confdefs.h"
181#include <mach/${ifc}.defs>
182EOF
183ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
184{ (eval echo configure:185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
185ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
186if test -z "$ac_err"; then
187 rm -rf conftest*
188 eval "ac_cv_header_$ac_safe=yes"
189else
190 echo "$ac_err" >&5
191 echo "configure: failed program was:" >&5
192 cat conftest.$ac_ext >&5
193 rm -rf conftest*
194 eval "ac_cv_header_$ac_safe=no"
195fi
196rm -f conftest*
197fi
198if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
199 echo "$ac_t""yes" 1>&6
200 mach_interface_list="$mach_interface_list $ifc"
201else
202 echo "$ac_t""no" 1>&6
203fi
204
205done
206if test "x$mach_interface_list" = x; then
207 { echo "configure: error: what manner of Mach is this?" 1>&2; exit 1; }
208fi
209
210echo $ac_n "checking for host_page_size in mach_host.defs""... $ac_c" 1>&6
211echo "configure:212: checking for host_page_size in mach_host.defs" >&5
212if eval "test \"`echo '$''{'libc_cv_mach_host_page_size'+set}'`\" = set"; then
213 echo $ac_n "(cached) $ac_c" 1>&6
214else
215 cat > conftest.$ac_ext <<EOF
216#line 217 "configure"
217#include "confdefs.h"
218#include <mach/mach_host.defs>
219EOF
220if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
221 egrep "host_page_size" >/dev/null 2>&1; then
222 rm -rf conftest*
223 libc_cv_mach_host_page_size=yes
224else
225 rm -rf conftest*
226 libc_cv_mach_host_page_size=no
227fi
228rm -f conftest*
229
230fi
231
232echo "$ac_t""$libc_cv_mach_host_page_size" 1>&6
233if test $libc_cv_mach_host_page_size = yes; then
234 cat >> confdefs.h <<\EOF
235#define HAVE_HOST_PAGE_SIZE 1
236EOF
237
238fi
21297437
RM
239
240ac_safe=`echo "mach/machine/ndr_def.h" | sed 'y%./+-%__p_%'`
241echo $ac_n "checking for mach/machine/ndr_def.h""... $ac_c" 1>&6
242echo "configure:243: checking for mach/machine/ndr_def.h" >&5
243if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
244 echo $ac_n "(cached) $ac_c" 1>&6
245else
246 cat > conftest.$ac_ext <<EOF
247#line 248 "configure"
248#include "confdefs.h"
249#include <mach/machine/ndr_def.h>
250EOF
251ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
252{ (eval echo configure:253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
253ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
254if test -z "$ac_err"; then
255 rm -rf conftest*
256 eval "ac_cv_header_$ac_safe=yes"
257else
258 echo "$ac_err" >&5
259 echo "configure: failed program was:" >&5
260 cat conftest.$ac_ext >&5
261 rm -rf conftest*
262 eval "ac_cv_header_$ac_safe=no"
263fi
264rm -f conftest*
265fi
266if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
267 echo "$ac_t""yes" 1>&6
268 DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
269else
270 echo "$ac_t""no" 1>&6
271ac_safe=`echo "machine/ndr_def.h" | sed 'y%./+-%__p_%'`
272echo $ac_n "checking for machine/ndr_def.h""... $ac_c" 1>&6
273echo "configure:274: checking for machine/ndr_def.h" >&5
274if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
275 echo $ac_n "(cached) $ac_c" 1>&6
276else
277 cat > conftest.$ac_ext <<EOF
278#line 279 "configure"
279#include "confdefs.h"
280#include <machine/ndr_def.h>
281EOF
282ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
283{ (eval echo configure:284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
284ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
285if test -z "$ac_err"; then
286 rm -rf conftest*
287 eval "ac_cv_header_$ac_safe=yes"
288else
289 echo "$ac_err" >&5
290 echo "configure: failed program was:" >&5
291 cat conftest.$ac_ext >&5
292 rm -rf conftest*
293 eval "ac_cv_header_$ac_safe=no"
294fi
295rm -f conftest*
296fi
297if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
298 echo "$ac_t""yes" 1>&6
299 DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
300else
301 echo "$ac_t""no" 1>&6
302fi
303
304fi
305