aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/configure
blob: 7238378796b317b829ad6f4881b98b318c77919d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
 
### Sanity checks for Mach header installation
ac_safe=`echo "mach/mach_types.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for mach/mach_types.h""... $ac_c" 1>&6
echo "configure:6: checking for mach/mach_types.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 11 "configure"
#include "confdefs.h"
#include <mach/mach_types.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: cannot find Mach headers" 1>&2; exit 1; }
fi

ac_safe=`echo "mach/mach_types.defs" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for mach/mach_types.defs""... $ac_c" 1>&6
echo "configure:40: checking for mach/mach_types.defs" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 45 "configure"
#include "confdefs.h"
#include <mach/mach_types.defs>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:50: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: cannot find Mach .defs files" 1>&2; exit 1; }
fi




echo $ac_n "checking for task_t in mach/mach_types.h""... $ac_c" 1>&6
echo "configure:76: checking for task_t in mach/mach_types.h" >&5
if eval "test \"`echo '$''{'libc_cv_mach_task_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 81 "configure"
#include "confdefs.h"
#include <mach/mach_types.h>
int main() {
extern task_t foo;
; return 0; }
EOF
if { (eval echo configure:88: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  libc_cv_mach_task_t=task_t
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  libc_cv_mach_task_t=task_port_t
fi
rm -f conftest*
fi

echo "$ac_t""$libc_cv_mach_task_t" 1>&6
if test $libc_cv_mach_task_t != task_t; then
  DEFINES="$DEFINES -Dtask_t=task_port_t"
fi
echo $ac_n "checking for thread_t in mach/mach_types.h""... $ac_c" 1>&6
echo "configure:105: checking for thread_t in mach/mach_types.h" >&5
if eval "test \"`echo '$''{'libc_cv_mach_thread_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 110 "configure"
#include "confdefs.h"
#include <mach/mach_types.h>
int main() {
extern thread_t foo;
; return 0; }
EOF
if { (eval echo configure:117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  libc_cv_mach_thread_t=thread_t
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  libc_cv_mach_thread_t=thread_port_t
fi
rm -f conftest*
fi

echo "$ac_t""$libc_cv_mach_thread_t" 1>&6
if test $libc_cv_mach_thread_t != thread_t; then
  DEFINES="$DEFINES -Dthread_t=thread_port_t"
fi

echo $ac_n "checking for creation_time in task_basic_info""... $ac_c" 1>&6
echo "configure:135: checking for creation_time in task_basic_info" >&5
if eval "test \"`echo '$''{'libc_cv_mach_task_creation_time'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 140 "configure"
#include "confdefs.h"
#include <mach/task_info.h>
int main() {

extern struct task_basic_info *i;
long s = i->creation_time.seconds;

; return 0; }
EOF
if { (eval echo configure:150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  libc_cv_mach_task_creation_time=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  libc_cv_mach_task_creation_time=no
fi
rm -f conftest*
fi

echo "$ac_t""$libc_cv_mach_task_creation_time" 1>&6
if test $libc_cv_mach_task_creation_time = no; then
  DEFINES="$DEFINES -DNO_CREATION_TIME=1"
fi

mach_interface_list=
for ifc in mach mach4 \
	   clock clock_priv host_priv host_security ledger lock_set \
	   processor processor_set task thread_act vm_map \
	   memory_object memory_object_default default_pager \
	   i386/mach_i386 \
	   ; do
  ac_safe=`echo "mach/${ifc}.defs" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for mach/${ifc}.defs""... $ac_c" 1>&6
echo "configure:176: checking for mach/${ifc}.defs" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 181 "configure"
#include "confdefs.h"
#include <mach/${ifc}.defs>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    mach_interface_list="$mach_interface_list $ifc"
else
  echo "$ac_t""no" 1>&6
fi

done
if test "x$mach_interface_list" = x; then
  { echo "configure: error: what manner of Mach is this?" 1>&2; exit 1; }
fi

echo $ac_n "checking for host_page_size in mach_host.defs""... $ac_c" 1>&6
echo "configure:213: checking for host_page_size in mach_host.defs" >&5
if eval "test \"`echo '$''{'libc_cv_mach_host_page_size'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 218 "configure"
#include "confdefs.h"
#include <mach/mach_host.defs>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "host_page_size" >/dev/null 2>&1; then
  rm -rf conftest*
  libc_cv_mach_host_page_size=yes
else
  rm -rf conftest*
  libc_cv_mach_host_page_size=no
fi
rm -f conftest*

fi

echo "$ac_t""$libc_cv_mach_host_page_size" 1>&6
if test $libc_cv_mach_host_page_size = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_HOST_PAGE_SIZE 1
EOF

fi

ac_safe=`echo "mach/machine/ndr_def.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for mach/machine/ndr_def.h""... $ac_c" 1>&6
echo "configure:244: checking for mach/machine/ndr_def.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 249 "configure"
#include "confdefs.h"
#include <mach/machine/ndr_def.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    DEFINES="$DEFINES -DNDR_DEF_HEADER='<mach/machine/ndr_def.h>'"
else
  echo "$ac_t""no" 1>&6
ac_safe=`echo "machine/ndr_def.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for machine/ndr_def.h""... $ac_c" 1>&6
echo "configure:275: checking for machine/ndr_def.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 280 "configure"
#include "confdefs.h"
#include <machine/ndr_def.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    DEFINES="$DEFINES -DNDR_DEF_HEADER='<machine/ndr_def.h>'"
else
  echo "$ac_t""no" 1>&6
fi

fi


echo $ac_n "checking for i386_io_perm_modify in mach_i386.defs""... $ac_c" 1>&6
echo "configure:310: checking for i386_io_perm_modify in mach_i386.defs" >&5
if eval "test \"`echo '$''{'libc_cv_mach_i386_ioports'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 315 "configure"
#include "confdefs.h"
#include <mach/i386/mach_i386.defs>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "i386_io_perm_modify" >/dev/null 2>&1; then
  rm -rf conftest*
  libc_cv_mach_i386_ioports=yes
else
  rm -rf conftest*
  libc_cv_mach_i386_ioports=no
fi
rm -f conftest*

fi

echo "$ac_t""$libc_cv_mach_i386_ioports" 1>&6
if test $libc_cv_mach_i386_ioports = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_I386_IO_PERM_MODIFY 1
EOF

fi