7662740e7d2ce5a05835805ef200416198103647
[binutils-gdb.git] / sim / ppc / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.5)dnl
3 AC_INIT(Makefile.in)
4
5 AC_PROG_INSTALL
6 AC_PROG_CC
7
8 # Put a plausible default for CC_FOR_BUILD in Makefile.
9 AC_C_CROSS
10 if test "x$cross_compiling" = "xno"; then
11 CC_FOR_BUILD='$(CC)'
12 else
13 CC_FOR_BUILD=gcc
14 fi
15
16 AC_ARG_ENABLE(sim-cflags,
17 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
18 [case "${enableval}" in
19 yes) sim_cflags="-O2 -fomit-frame-pointer";;
20 no) sim_cflags="";;
21 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
22 esac
23 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
24 echo "Setting sim cflags = $sim_cflags" 6>&1
25 fi],[sim_cflags=""])dnl
26
27 AC_ARG_ENABLE(sim-warnings,
28 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
29 [case "${enableval}" in
30 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes";;
31 no) sim_warnings="-w";;
32 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
33 esac
34 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
35 echo "Setting warning flags = $sim_warnings" 6>&1
36 fi],[sim_warnings=""])dnl
37
38 AC_ARG_ENABLE(sim-line-nr,
39 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
40 [case "${enableval}" in
41 yes) sim_line_nr="";;
42 no) sim_line_nr="-L";;
43 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
44 esac
45 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
46 echo "Setting warning flags = $sim_line_nr" 6>&1
47 fi],[sim_line_nr=""])dnl
48
49 AC_ARG_ENABLE(sim-config,
50 [ --enable-sim-config=file Override default config file],
51 [case "${enableval}" in
52 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
53 *) if test -f "${srcdir}/${enableval}"; then
54 sim_config="${enableval}";
55 elif test -f "${srcdir}/${enableval}-config.h"; then
56 sim_config="${enableval}-config.h"
57 else
58 AC_MSG_ERROR("Config file $enableval was not found");
59 sim_config=std-config.h
60 fi;;
61 esac
62 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
63 echo "Setting config flags = $sim_config" 6>&1
64 fi],[sim_config="std-config.h"
65 if test x"$silent" != x"yes"; then
66 echo "Setting config flags = $sim_config" 6>&1
67 fi])dnl
68
69 AC_ARG_ENABLE(sim-opcode,
70 [ --enable-sim-opcode=which Override default opcode lookup.],
71 [case "${enableval}" in
72 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
73 *) if test -f "${srcdir}/${enableval}"; then
74 sim_opcode="${enableval}"
75 elif test -f "${srcdir}/ppc-opcode-${enableval}"; then
76 sim_opcode="ppc-opcode-${enableval}"
77 else
78 AC_MSG_ERROR("File $enableval is not an opcode rules file");
79 sim_opcode="ppc-opcode-complex"
80 fi;;
81 esac
82 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
83 echo "Setting opcode flags = $sim_opcode" 6>&1
84 fi],[sim_opcode="ppc-opcode-complex"
85 if test x"$silent" != x"yes"; then
86 echo "Setting opcode flags = $sim_opcode"
87 fi])dnl
88
89 AC_ARG_ENABLE(sim-switch,
90 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
91 [case "${enableval}" in
92 yes) sim_switch="-s";;
93 no) sim_switch="";;
94 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
95 esac
96 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
97 echo "Setting switch flags = $sim_switch" 6>&1
98 fi],[sim_switch="";
99 if test x"$silent" != x"yes"; then
100 echo "Setting switch flags = $sim_switch" 6>&1
101 fi])dnl
102
103 AC_ARG_ENABLE(sim-duplicate,
104 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
105 [case "${enableval}" in
106 yes) sim_dup="-E";;
107 no) sim_dup="";;
108 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
109 esac
110 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
111 echo "Setting duplicate flags = $sim_dup" 6>&1
112 fi],[sim_dup="-E"
113 if test x"$silent" != x"yes"; then
114 echo "Setting duplicate flags = $sim_dup" 6>&1
115 fi])dnl
116
117 AC_ARG_ENABLE(sim-jump,
118 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
119 [case "${enableval}" in
120 yes) sim_jump="-J";;
121 no) sim_jump="";;
122 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
123 esac
124 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
125 echo "Setting jump flag = $sim_jump" 6>&1
126 fi],[sim_jump="-E"
127 if test x"$silent" != x"yes"; then
128 echo "Setting jump flag = $sim_jump" 6>&1
129 fi])dnl
130
131 AC_ARG_ENABLE(sim-filter,
132 [ --enable-sim-filter=rule Specify filter rules.],
133 [case "${enableval}" in
134 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
135 no) sim_filter="";;
136 *) sim_filter="-F $enableval";;
137 esac
138 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
139 echo "Setting filter flags = $sim_filter" 6>&1
140 fi],[sim_filter="-F 32,f,o"
141 if test x"$silent" != x"yes"; then
142 echo "Setting filter flags = $sim_filter" 6>&1
143 fi])dnl
144
145 AC_ARG_ENABLE(sim-icache,
146 [ --enable-sim-icache=size Specify instruction cache size.],
147 [icache=""
148 case "${enableval}" in
149 yes) icache="1024"; sim_icache="-I $icache";;
150 no) sim_icache="";;
151 *) icache=1024
152 sim_icache="-"
153 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
154 case "$x" in
155 define) sim_icache="${sim_icache}R";;
156 semantic) sim_icache="${sim_icache}C";;
157 insn) sim_icache="${sim_icache}S";;
158 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
159 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
160 esac
161 done
162 sim_icache="${sim_icache}I $icache";;
163 esac
164 if test x"$silent" != x"yes" && test x"$icache" != x""; then
165 echo "Setting instruction cache size to $icache ($sim_icache)"
166 fi],[sim_icache="-CSI 1024"
167 if test x"$silent" != x"yes"; then
168 echo "Setting instruction cache size to 1024 ($sim_icache)"
169 fi])dnl
170
171 AC_ARG_ENABLE(sim-hardware,
172 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
173 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com"
174 case "${enableval}" in
175 yes) ;;
176 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
177 ,*) hardware="${hardware}${enableval}";;
178 *) hardware="${enableval}";;
179 esac
180 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
181 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
182 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
183 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
184 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com"
185 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
186 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
187 if test x"$silent" != x"yes"; then
188 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
189 fi])dnl
190
191
192 AC_ARG_ENABLE(sim-packages,
193 [ --enable-sim-packages=list Specify the packages to be included in the build.],
194 [packages=disklabel
195 case "${enableval}" in
196 yes) ;;
197 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
198 ,*) packages="${packages}${enableval}";;
199 *) packages="${enableval}"''
200 esac
201 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
202 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
203 if test x"$silent" != x"yes" && test x"$packages" != x""; then
204 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
205 fi],[packages=disklabel
206 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
207 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
208 if test x"$silent" != x"yes"; then
209 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
210 fi])dnl
211
212 AC_ARG_ENABLE(sim-inline,
213 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
214 [sim_inline=""
215 case "$enableval" in
216 no) sim_inline="-DDEFAULT_INLINE=0";;
217 0) sim_inline="-DDEFAULT_INLINE=0";;
218 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
219 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
220 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
221 new_flag=""
222 case "$x" in
223 *_INLINE=*) new_flag="-D$x";;
224 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
225 *_INLINE) new_flag="-D$x=ALL_INLINE";;
226 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
227 esac
228 if test x"$sim_inline" = x""; then
229 sim_inline="$new_flag"
230 else
231 sim_inline="$sim_inline $new_flag"
232 fi
233 done;;
234 esac
235 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
236 echo "Setting inline flags = $sim_inline" 6>&1
237 fi],[if test x"$GCC" != ""; then
238 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
239 if test x"$silent" != x"yes"; then
240 echo "Setting inline flags = $sim_inline" 6>&1
241 fi
242 else
243 sim_inline=""
244 fi])dnl
245
246 AC_ARG_ENABLE(sim-bswap,
247 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
248 [case "${enableval}" in
249 yes) sim_bswap="-DWITH_BSWAP=1";;
250 no) sim_bswap="-DWITH_BSWAP=0";;
251 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
252 esac
253 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
254 echo "Setting bswap flags = $sim_bswap" 6>&1
255 fi],[sim_bswap=""])dnl
256
257 AC_ARG_ENABLE(sim-endian,
258 [ --enable-sim-endian=endian Specify target byte endian orientation.],
259 [case "${enableval}" in
260 yes) case "$target" in
261 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
262 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
263 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
264 esac;;
265 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
266 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
267 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
268 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
269 esac
270 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
271 echo "Setting endian flags = $sim_endian" 6>&1
272 fi],[sim_endian=""])dnl
273
274 AC_ARG_ENABLE(sim-regparm,
275 [ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
276 [case "${enableval}" in
277 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
278 no) sim_regparm="" ;;
279 yes) sim_regparm="-DWITH_REGPARM=3";;
280 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
281 esac
282 if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
283 echo "Setting regparm flags = $sim_regparm" 6>&1
284 fi],[sim_regparm=""])dnl
285
286 AC_ARG_ENABLE(sim-stdcall,
287 [ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
288 [case "${enableval}" in
289 no) sim_stdcall="" ;;
290 std*) sim_stdcall="-DWITH_STDCALL=1";;
291 yes) sim_stdcall="-DWITH_STDCALL=1";;
292 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
293 esac
294 if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
295 echo "Setting function call flags = $sim_stdcall" 6>&1
296 fi],[sim_stdcall=""])dnl
297
298 AC_ARG_ENABLE(sim-hostendian,
299 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
300 [case "${enableval}" in
301 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
302 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
303 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
304 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
305 esac
306 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
307 echo "Setting hostendian flags = $sim_hostendian" 6>&1
308 fi],[
309 if test "x$cross_compiling" = "xno"; then
310 AC_C_BIGENDIAN
311 if test $ac_cv_c_bigendian = yes; then
312 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
313 else
314 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
315 fi
316 else
317 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
318 fi])dnl
319
320 AC_ARG_ENABLE(sim-smp,
321 [ --enable-sim-smp=n Specify number of processors to configure for.],
322 [case "${enableval}" in
323 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
324 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
325 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
326 esac
327 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
328 echo "Setting smp flags = $sim_smp" 6>&1
329 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
330 if test x"$silent" != x"yes"; then
331 echo "Setting smp flags = $sim_smp" 6>&1
332 fi])dnl
333
334 AC_ARG_ENABLE(sim-xor-endian,
335 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
336 [case "${enableval}" in
337 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
338 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
339 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
340 esac
341 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
342 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
343 fi],[sim_xor_endian=""])dnl
344
345 AC_ARG_ENABLE(sim-bitsize,
346 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
347 [case "${enableval}" in
348 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
349 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval, expected 32 or 64"); sim_bitsize="";;
350 esac
351 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
352 echo "Setting bitsize flags = $sim_bitsize" 6>&1
353 fi],[sim_bitsize=""])dnl
354
355 AC_ARG_ENABLE(sim-hostbitsize,
356 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
357 [case "${enableval}" in
358 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
359 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval, expected 32 or 64"); sim_hostbitsize="";;
360 esac
361 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
362 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
363 fi],[sim_hostbitsize=""])dnl
364
365 AC_ARG_ENABLE(sim-env,
366 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
367 [case "${enableval}" in
368 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
369 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
370 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
371 no) sim_env="-DWITH_ENVIRONMENT=0";;
372 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
373 esac
374 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
375 echo "Setting env flags = $sim_env" 6>&1
376 fi],[sim_env=""])dnl
377
378 AC_ARG_ENABLE(sim-timebase,
379 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
380 [case "${enableval}" in
381 yes) sim_timebase="-DWITH_TIME_BASE=1";;
382 no) sim_timebase="-DWITH_TIME_BASE=0";;
383 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
384 esac
385 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
386 echo "Setting timebase flags = $sim_timebase" 6>&1
387 fi],[sim_timebase=""])dnl
388
389 AC_ARG_ENABLE(sim-alignment,
390 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
391 [case "${enableval}" in
392 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
393 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
394 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
395 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
396 esac
397 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
398 echo "Setting alignment flags = $sim_alignment" 6>&1
399 fi],[sim_alignment=""])dnl
400
401 AC_ARG_ENABLE(sim-trace,
402 [ --enable-sim-trace Specify whether tracing is supported.],
403 [case "${enableval}" in
404 yes) sim_trace="-DWITH_TRACE=1";;
405 no) sim_trace="-DWITH_TRACE=0";;
406 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
407 esac
408 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
409 echo "Setting trace flags = $sim_trace" 6>&1
410 fi],[sim_trace=""])dnl
411
412 AC_ARG_ENABLE(sim-assert,
413 [ --enable-sim-assert Specify whether to perform random assertions.],
414 [case "${enableval}" in
415 yes) sim_assert="-DWITH_ASSERT=1";;
416 no) sim_assert="-DWITH_ASSERT=0";;
417 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
418 esac
419 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
420 echo "Setting assert flags = $sim_assert" 6>&1
421 fi],[sim_assert=""])dnl
422
423 AC_ARG_ENABLE(sim-reserved-bits,
424 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
425 [case "${enableval}" in
426 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
427 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
428 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
429 esac
430 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
431 echo "Setting reserved flags = $sim_reserved" 6>&1
432 fi],[sim_reserved=""])dnl
433
434 AC_ARG_ENABLE(sim-float,
435 [ --enable-sim-float Specify whether to use host floating point or simulate.],
436 [case "${enableval}" in
437 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
438 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
439 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
440 esac
441 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
442 echo "Setting float flags = $sim_float" 6>&1
443 fi],[sim_float=""])dnl
444
445 AC_ARG_ENABLE(sim-monitor,
446 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
447 [case "${enableval}" in
448 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
449 no) sim_monitor="-DWITH_MON=0";;
450 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
451 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
452 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
453 esac
454 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
455 echo "Setting monitor flags = $sim_monitor" 6>&1
456 fi],[sim_monitor=""])dnl
457
458 AC_ARG_ENABLE(sim-model,
459 [ --enable-sim-model=which Specify PowerPC to model.],
460 [case "${enableval}" in
461 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
462 *) sim_model="-DWITH_MODEL=${enableval}";;
463 esac
464 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
465 echo "Setting model flags = $sim_model" 6>&1
466 fi],[sim_model=""])dnl
467
468 AC_ARG_ENABLE(sim-default-model,
469 [ --enable-sim-default-model=which Specify default PowerPC to model.],
470 [case "${enableval}" in
471 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
472 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
473 esac
474 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
475 echo "Setting default-model flags = $sim_default_model" 6>&1
476 fi],[sim_model=""])dnl
477
478 AC_ARG_ENABLE(sim-model-issue,
479 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
480 [case "${enableval}" in
481 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
482 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
483 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
484 esac
485 if test x"$silent" != x"yes"; then
486 echo "Setting model-issue flags = $sim_model_issue" 6>&1
487 fi],[sim_model_issue=""])dnl
488
489 AC_ARG_ENABLE(sim-stdio,
490 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
491 [case "${enableval}" in
492 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
493 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
494 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
495 esac
496 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
497 echo "Setting stdio flags = $sim_stdio" 6>&1
498 fi],[sim_stdio=""])dnl
499
500 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
501 AC_CANONICAL_SYSTEM
502 AC_ARG_PROGRAM
503
504 . ${srcdir}/../../bfd/configure.host
505
506 AC_CONFIG_HEADER(config.h:config.in)
507
508 AC_STRUCT_ST_BLKSIZE
509 AC_STRUCT_ST_BLOCKS
510 AC_STRUCT_ST_RDEV
511 AC_STRUCT_TIMEZONE
512
513 AC_TYPE_GETGROUPS
514 AC_TYPE_MODE_T
515 AC_TYPE_OFF_T
516 AC_TYPE_PID_T
517 AC_TYPE_SIGNAL
518 AC_TYPE_SIZE_T
519 AC_TYPE_UID_T
520
521 AC_CHECK_FUNCS(access cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink)
522
523 AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h)
524 AC_HEADER_DIRENT
525
526 dnl Figure out what type of termio/termios support there is
527 sim_termio=""
528 AC_MSG_CHECKING(for struct termios)
529 AC_CACHE_VAL(ac_cv_termios_struct,
530 [AC_TRY_COMPILE([#include <sys/types.h>
531 #include <sys/termios.h>],
532 [static struct termios x;
533 x.c_iflag = 0;
534 x.c_oflag = 0;
535 x.c_cflag = 0;
536 x.c_lflag = 0;
537 x.c_cc[NCCS] = 0;],
538 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
539 AC_MSG_RESULT($ac_cv_termios_struct)
540 if test $ac_cv_termios_struct = yes; then
541 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
542 fi
543
544 if test "$ac_cv_termios_struct" = "yes"; then
545 AC_MSG_CHECKING(for c_line field in struct termios)
546 AC_CACHE_VAL(ac_cv_termios_cline,
547 [AC_TRY_COMPILE([#include <sys/types.h>
548 #include <sys/termios.h>],
549 [static struct termios x; x.c_line = 0;],
550 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
551
552 AC_MSG_RESULT($ac_cv_termios_cline)
553 if test $ac_cv_termios_cline = yes; then
554 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
555 fi
556 else
557 ac_cv_termios_cline=no
558 fi
559
560 if test "$ac_cv_termios_struct" != "yes"; then
561 AC_MSG_CHECKING(for struct termio)
562 AC_CACHE_VAL(ac_cv_termio_struct,
563 [AC_TRY_COMPILE([#include <sys/types.h>
564 #include <sys/termio.h>],
565 [static struct termio x;
566 x.c_iflag = 0;
567 x.c_oflag = 0;
568 x.c_cflag = 0;
569 x.c_lflag = 0;
570 x.c_cc[NCC] = 0;],
571 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
572 AC_MSG_RESULT($ac_cv_termio_struct)
573 if test $ac_cv_termio_struct = yes; then
574 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
575 fi
576 else
577 ac_cv_termio_struct=no
578 fi
579
580 if test "$ac_cv_termio_struct" = "yes"; then
581 AC_MSG_CHECKING(for c_line field in struct termio)
582 AC_CACHE_VAL(ac_cv_termio_cline,
583 [AC_TRY_COMPILE([#include <sys/types.h>
584 #include <sys/termio.h>],
585 [static struct termio x; x.c_line = 0;],
586 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
587
588 AC_MSG_RESULT($ac_cv_termio_cline)
589 if test $ac_cv_termio_cline = yes; then
590 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
591 fi
592 else
593 ac_cv_termio_cline=no
594 fi
595
596 dnl Figure out if /dev/zero exists or not
597 sim_devzero=""
598 AC_MSG_CHECKING(for /dev/zero)
599 AC_CACHE_VAL(ac_cv_devzero,
600 [AC_TRY_RUN([#include <fcntl.h>
601 main () {
602 char buf[2048];
603 int i;
604 int fd = open ("/dev/zero", O_RDONLY);
605 if (fd < 0)
606 return 1;
607 for (i = 0; i < sizeof (buf); i++)
608 buf[i] = 1;
609 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
610 return 1;
611 for (i = 0; i < sizeof (buf); i++)
612 if (buf[i])
613 return 1;
614 return 0;
615 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
616 AC_MSG_RESULT($ac_cv_devzero)
617 if test $ac_cv_devzero = yes; then
618 sim_devzero="-DHAVE_DEVZERO"
619 else
620 sim_devzero=""
621 fi
622
623 AC_SUBST(CC_FOR_BUILD)
624 AC_SUBST(CFLAGS)
625 AC_SUBST(HDEFINES)
626 AR=${AR-ar}
627 AC_SUBST(AR)
628 AC_PROG_RANLIB
629 AC_SUBST(sim_cflags)
630 AC_SUBST(sim_warnings)
631 AC_SUBST(sim_line_nr)
632 AC_SUBST(sim_config)
633 AC_SUBST(sim_opcode)
634 AC_SUBST(sim_switch)
635 AC_SUBST(sim_dup)
636 AC_SUBST(sim_jump)
637 AC_SUBST(sim_filter)
638 AC_SUBST(sim_icache)
639 AC_SUBST(sim_hw_src)
640 AC_SUBST(sim_hw_obj)
641 AC_SUBST(sim_pk_src)
642 AC_SUBST(sim_pk_obj)
643 AC_SUBST(sim_inline)
644 AC_SUBST(sim_bswap)
645 AC_SUBST(sim_endian)
646 AC_SUBST(sim_regparm)
647 AC_SUBST(sim_stdcall)
648 AC_SUBST(sim_xor_endian)
649 AC_SUBST(sim_hostendian)
650 AC_SUBST(sim_smp)
651 AC_SUBST(sim_igen_smp)
652 AC_SUBST(sim_bitsize)
653 AC_SUBST(sim_hostbitsize)
654 AC_SUBST(sim_env)
655 AC_SUBST(sim_timebase)
656 AC_SUBST(sim_alignment)
657 AC_SUBST(sim_float)
658 AC_SUBST(sim_trace)
659 AC_SUBST(sim_assert)
660 AC_SUBST(sim_reserved)
661 AC_SUBST(sim_monitor)
662 AC_SUBST(sim_model)
663 AC_SUBST(sim_default_model)
664 AC_SUBST(sim_model_issue)
665 AC_SUBST(sim_stdio)
666 AC_SUBST(sim_termio)
667 AC_SUBST(sim_devzero)
668
669 AC_OUTPUT(Makefile,
670 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])