1 dnl Process this file with autoconf to produce a configure script.
8 # Put a plausible default for CC_FOR_BUILD in Makefile.
10 if test "x$cross_compiling" = "xno"; then
16 dnl We don't use gettext, but bfd does. So we do the appropriate checks
17 dnl to see if there are intl libraries we should link against.
22 AC_ARG_ENABLE(sim-alignment,
23 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
24 [case "${enableval}" in
25 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
26 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
27 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
28 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
30 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
31 echo "Setting alignment flags = $sim_alignment" 6>&1
32 fi],[sim_alignment=""])dnl
35 AC_ARG_ENABLE(sim-assert,
36 [ --enable-sim-assert Specify whether to perform random assertions.],
37 [case "${enableval}" in
38 yes) sim_assert="-DWITH_ASSERT=1";;
39 no) sim_assert="-DWITH_ASSERT=0";;
40 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
42 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
43 echo "Setting assert flags = $sim_assert" 6>&1
44 fi],[sim_assert=""])dnl
47 AC_ARG_ENABLE(sim-bitsize,
48 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
49 [case "${enableval}" in
50 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
51 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
53 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
54 echo "Setting bitsize flags = $sim_bitsize" 6>&1
55 fi],[sim_bitsize=""])dnl
58 AC_ARG_ENABLE(sim-bswap,
59 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
60 [case "${enableval}" in
61 yes) sim_bswap="-DWITH_BSWAP=1";;
62 no) sim_bswap="-DWITH_BSWAP=0";;
63 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
65 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
66 echo "Setting bswap flags = $sim_bswap" 6>&1
67 fi],[sim_bswap=""])dnl
70 AC_ARG_ENABLE(sim-cflags,
71 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
72 [case "${enableval}" in
73 yes) sim_cflags="-O2 -fomit-frame-pointer";;
75 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
77 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
78 echo "Setting sim cflags = $sim_cflags" 6>&1
79 fi],[sim_cflags=""])dnl
82 AC_ARG_ENABLE(sim-config,
83 [ --enable-sim-config=file Override default config file],
84 [case "${enableval}" in
85 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
86 *) if test -f "${srcdir}/${enableval}"; then
87 sim_config="${enableval}";
88 elif test -f "${srcdir}/${enableval}-config.h"; then
89 sim_config="${enableval}-config.h"
91 AC_MSG_ERROR("Config file $enableval was not found");
92 sim_config=std-config.h
95 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
96 echo "Setting config flags = $sim_config" 6>&1
97 fi],[sim_config="std-config.h"
98 if test x"$silent" != x"yes"; then
99 echo "Setting config flags = $sim_config" 6>&1
103 AC_ARG_ENABLE(sim-decode-mechanism,
104 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
105 [case "${enableval}" in
106 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
107 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
108 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
109 sim_decode_mechanism="switch";;
111 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
112 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
113 fi],[sim_decode_mechanism=""
114 if test x"$silent" != x"yes"; then
115 echo "Setting decode mechanism flags = $sim_decode_mechanism"
119 AC_ARG_ENABLE(sim-default-model,
120 [ --enable-sim-default-model=which Specify default PowerPC to model.],
121 [case "${enableval}" in
122 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
123 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
125 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
126 echo "Setting default-model flags = $sim_default_model" 6>&1
127 fi],[sim_default_model=""])dnl
130 AC_ARG_ENABLE(sim-duplicate,
131 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
132 [case "${enableval}" in
135 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
137 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
138 echo "Setting duplicate flags = $sim_dup" 6>&1
140 if test x"$silent" != x"yes"; then
141 echo "Setting duplicate flags = $sim_dup" 6>&1
145 AC_ARG_ENABLE(sim-endian,
146 [ --enable-sim-endian=endian Specify target byte endian orientation.],
147 [case "${enableval}" in
148 yes) case "$target" in
149 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
150 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
151 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
153 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
154 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
155 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
156 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
158 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
159 echo "Setting endian flags = $sim_endian" 6>&1
160 fi],[sim_endian=""])dnl
163 AC_ARG_ENABLE(sim-env,
164 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
165 [case "${enableval}" in
166 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
167 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
168 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
169 no) sim_env="-DWITH_ENVIRONMENT=0";;
170 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
172 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
173 echo "Setting env flags = $sim_env" 6>&1
177 AC_ARG_ENABLE(sim-filter,
178 [ --enable-sim-filter=rule Specify filter rules.],
179 [case "${enableval}" in
180 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
182 *) sim_filter="-F $enableval";;
184 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
185 echo "Setting filter flags = $sim_filter" 6>&1
186 fi],[sim_filter="-F 32,f,o"
187 if test x"$silent" != x"yes"; then
188 echo "Setting filter flags = $sim_filter" 6>&1
192 AC_ARG_ENABLE(sim-float,
193 [ --enable-sim-float Specify whether to use host floating point or simulate.],
194 [case "${enableval}" in
195 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
196 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
197 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
199 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
200 echo "Setting float flags = $sim_float" 6>&1
201 fi],[sim_float=""])dnl
204 AC_ARG_ENABLE(sim-hardware,
205 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
206 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
207 case "${enableval}" in
209 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
210 ,*) hardware="${hardware}${enableval}";;
211 *,) hardware="${enableval}${hardware}";;
212 *) hardware="${enableval}"'';;
214 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
215 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
216 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
217 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
218 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
219 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
220 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
221 if test x"$silent" != x"yes"; then
222 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
226 AC_ARG_ENABLE(sim-hostbitsize,
227 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
228 [case "${enableval}" in
229 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
230 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
232 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
233 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
234 fi],[sim_hostbitsize=""])dnl
237 AC_ARG_ENABLE(sim-hostendian,
238 [ --enable-sim-hostendian=end Specify host byte endian orientation.],
239 [case "${enableval}" in
240 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
241 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
242 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
243 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
245 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
246 echo "Setting hostendian flags = $sim_hostendian" 6>&1
248 if test "x$cross_compiling" = "xno"; then
250 if test $ac_cv_c_bigendian = yes; then
251 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
253 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
256 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
260 AC_ARG_ENABLE(sim-icache,
261 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
263 case "${enableval}" in
264 yes) icache="1024"; sim_icache="-I $icache";;
265 no) sim_icache="-R";;
268 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
270 define) sim_icache="${sim_icache}R";;
271 semantic) sim_icache="${sim_icache}C";;
272 insn) sim_icache="${sim_icache}S";;
273 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
274 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
277 sim_icache="${sim_icache}I $icache";;
279 if test x"$silent" != x"yes" && test x"$icache" != x""; then
280 echo "Setting instruction cache size to $icache ($sim_icache)"
281 fi],[sim_icache="-CSRI 1024"
282 if test x"$silent" != x"yes"; then
283 echo "Setting instruction cache size to 1024 ($sim_icache)"
287 AC_ARG_ENABLE(sim-inline,
288 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
291 no) sim_inline="-DDEFAULT_INLINE=0";;
292 0) sim_inline="-DDEFAULT_INLINE=0";;
293 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
294 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
295 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
298 *_INLINE=*) new_flag="-D$x";;
299 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
300 *_INLINE) new_flag="-D$x=ALL_INLINE";;
301 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
303 if test x"$sim_inline" = x""; then
304 sim_inline="$new_flag"
306 sim_inline="$sim_inline $new_flag"
310 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
311 echo "Setting inline flags = $sim_inline" 6>&1
312 fi],[if test x"$GCC" != ""; then
313 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
314 if test x"$silent" != x"yes"; then
315 echo "Setting inline flags = $sim_inline" 6>&1
322 AC_ARG_ENABLE(sim-jump,
323 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
324 [case "${enableval}" in
327 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
329 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
330 echo "Setting jump flag = $sim_jump" 6>&1
332 if test x"$silent" != x"yes"; then
333 echo "Setting jump flag = $sim_jump" 6>&1
337 AC_ARG_ENABLE(sim-line-nr,
338 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
339 [case "${enableval}" in
340 yes) sim_line_nr="";;
341 no) sim_line_nr="-L";;
342 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
344 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
345 echo "Setting warning flags = $sim_line_nr" 6>&1
346 fi],[sim_line_nr=""])dnl
349 AC_ARG_ENABLE(sim-model,
350 [ --enable-sim-model=which Specify PowerPC to model.],
351 [case "${enableval}" in
352 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
353 *) sim_model="-DWITH_MODEL=${enableval}";;
355 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
356 echo "Setting model flags = $sim_model" 6>&1
357 fi],[sim_model=""])dnl
360 AC_ARG_ENABLE(sim-model-issue,
361 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
362 [case "${enableval}" in
363 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
364 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
365 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
367 if test x"$silent" != x"yes"; then
368 echo "Setting model-issue flags = $sim_model_issue" 6>&1
369 fi],[sim_model_issue=""])dnl
372 AC_ARG_ENABLE(sim-monitor,
373 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
374 [case "${enableval}" in
375 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
376 no) sim_monitor="-DWITH_MON=0";;
377 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
378 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
379 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
381 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
382 echo "Setting monitor flags = $sim_monitor" 6>&1
383 fi],[sim_monitor=""])dnl
386 AC_ARG_ENABLE(sim-opcode,
387 [ --enable-sim-opcode=which Override default opcode lookup.],
388 [case "${enableval}" in
389 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
390 *) if test -f "${srcdir}/${enableval}"; then
391 sim_opcode="${enableval}"
392 elif test -f "${srcdir}/dc-${enableval}"; then
393 sim_opcode="dc-${enableval}"
395 AC_MSG_ERROR("File $enableval is not an opcode rules file");
396 sim_opcode="dc-complex"
399 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
400 echo "Setting opcode flags = $sim_opcode" 6>&1
401 fi],[sim_opcode="dc-complex"
402 if test x"$silent" != x"yes"; then
403 echo "Setting opcode flags = $sim_opcode"
407 AC_ARG_ENABLE(sim-packages,
408 [ --enable-sim-packages=list Specify the packages to be included in the build.],
410 case "${enableval}" in
412 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
413 ,*) packages="${packages}${enableval}";;
414 *,) packages="${enableval}${packages}";;
415 *) packages="${enableval}"'';;
417 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
418 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
419 if test x"$silent" != x"yes" && test x"$packages" != x""; then
420 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
421 fi],[packages=disklabel
422 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
423 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
424 if test x"$silent" != x"yes"; then
425 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
429 AC_ARG_ENABLE(sim-regparm,
430 [ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
431 [case "${enableval}" in
432 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
433 no) sim_regparm="" ;;
434 yes) sim_regparm="-DWITH_REGPARM=3";;
435 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
437 if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
438 echo "Setting regparm flags = $sim_regparm" 6>&1
439 fi],[sim_regparm=""])dnl
442 AC_ARG_ENABLE(sim-reserved-bits,
443 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
444 [case "${enableval}" in
445 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
446 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
447 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
449 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
450 echo "Setting reserved flags = $sim_reserved" 6>&1
451 fi],[sim_reserved=""])dnl
454 AC_ARG_ENABLE(sim-smp,
455 [ --enable-sim-smp=n Specify number of processors to configure for.],
456 [case "${enableval}" in
457 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
458 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
459 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
461 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
462 echo "Setting smp flags = $sim_smp" 6>&1
463 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
464 if test x"$silent" != x"yes"; then
465 echo "Setting smp flags = $sim_smp" 6>&1
469 AC_ARG_ENABLE(sim-stdcall,
470 [ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
471 [case "${enableval}" in
472 no) sim_stdcall="" ;;
473 std*) sim_stdcall="-DWITH_STDCALL=1";;
474 yes) sim_stdcall="-DWITH_STDCALL=1";;
475 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
477 if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
478 echo "Setting function call flags = $sim_stdcall" 6>&1
479 fi],[sim_stdcall=""])dnl
482 AC_ARG_ENABLE(sim-stdio,
483 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
484 [case "${enableval}" in
485 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
486 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
487 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
489 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
490 echo "Setting stdio flags = $sim_stdio" 6>&1
491 fi],[sim_stdio=""])dnl
494 AC_ARG_ENABLE(sim-switch,
495 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
496 [case "${enableval}" in
497 yes) sim_switch="-s";;
499 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
501 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
502 echo "Setting switch flags = $sim_switch" 6>&1
504 if test x"$silent" != x"yes"; then
505 echo "Setting switch flags = $sim_switch" 6>&1
509 AC_ARG_ENABLE(sim-timebase,
510 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
511 [case "${enableval}" in
512 yes) sim_timebase="-DWITH_TIME_BASE=1";;
513 no) sim_timebase="-DWITH_TIME_BASE=0";;
514 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
516 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
517 echo "Setting timebase flags = $sim_timebase" 6>&1
518 fi],[sim_timebase=""])dnl
521 AC_ARG_ENABLE(sim-trace,
522 [ --enable-sim-trace Specify whether tracing is supported.],
523 [case "${enableval}" in
524 yes) sim_trace="-DWITH_TRACE=1";;
525 no) sim_trace="-DWITH_TRACE=0";;
526 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
528 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
529 echo "Setting trace flags = $sim_trace" 6>&1
530 fi],[sim_trace=""])dnl
533 AC_ARG_ENABLE(sim-warnings,
534 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
535 [case "${enableval}" in
536 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
537 no) sim_warnings="-w";;
538 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
540 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
541 echo "Setting warning flags = $sim_warnings" 6>&1
542 fi],[sim_warnings=""])dnl
545 AC_ARG_ENABLE(sim-xor-endian,
546 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
547 [case "${enableval}" in
548 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
549 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
550 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
552 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
553 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
554 fi],[sim_xor_endian=""])dnl
557 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
561 . ${srcdir}/../../bfd/configure.host
563 AC_CONFIG_HEADER(config.h:config.in)
578 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)
580 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)
583 dnl Figure out what type of termio/termios support there is
585 AC_MSG_CHECKING(for struct termios)
586 AC_CACHE_VAL(ac_cv_termios_struct,
587 [AC_TRY_COMPILE([#include <sys/types.h>
588 #include <sys/termios.h>],
589 [static struct termios x;
595 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
596 AC_MSG_RESULT($ac_cv_termios_struct)
597 if test $ac_cv_termios_struct = yes; then
598 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
601 if test "$ac_cv_termios_struct" = "yes"; then
602 AC_MSG_CHECKING(for c_line field in struct termios)
603 AC_CACHE_VAL(ac_cv_termios_cline,
604 [AC_TRY_COMPILE([#include <sys/types.h>
605 #include <sys/termios.h>],
606 [static struct termios x; x.c_line = 0;],
607 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
609 AC_MSG_RESULT($ac_cv_termios_cline)
610 if test $ac_cv_termios_cline = yes; then
611 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
614 ac_cv_termios_cline=no
617 if test "$ac_cv_termios_struct" != "yes"; then
618 AC_MSG_CHECKING(for struct termio)
619 AC_CACHE_VAL(ac_cv_termio_struct,
620 [AC_TRY_COMPILE([#include <sys/types.h>
621 #include <sys/termio.h>],
622 [static struct termio x;
628 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
629 AC_MSG_RESULT($ac_cv_termio_struct)
630 if test $ac_cv_termio_struct = yes; then
631 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
634 ac_cv_termio_struct=no
637 if test "$ac_cv_termio_struct" = "yes"; then
638 AC_MSG_CHECKING(for c_line field in struct termio)
639 AC_CACHE_VAL(ac_cv_termio_cline,
640 [AC_TRY_COMPILE([#include <sys/types.h>
641 #include <sys/termio.h>],
642 [static struct termio x; x.c_line = 0;],
643 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
645 AC_MSG_RESULT($ac_cv_termio_cline)
646 if test $ac_cv_termio_cline = yes; then
647 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
650 ac_cv_termio_cline=no
653 dnl Figure out if /dev/zero exists or not
655 AC_MSG_CHECKING(for /dev/zero)
656 AC_CACHE_VAL(ac_cv_devzero,
657 [AC_TRY_RUN([#include <fcntl.h>
661 int fd = open ("/dev/zero", O_RDONLY);
664 for (i = 0; i < sizeof (buf); i++)
666 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
668 for (i = 0; i < sizeof (buf); i++)
672 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
673 AC_MSG_RESULT($ac_cv_devzero)
674 if test $ac_cv_devzero = yes; then
675 sim_devzero="-DHAVE_DEVZERO"
680 dnl Figure out if we are in the new Cygnus tree with a common directory or not
681 AC_MSG_CHECKING(for common simulator directory)
682 if test -f "${srcdir}/../common/callback.c"; then
684 sim_callback="callback.o targ-map.o"
685 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
692 AC_SUBST(CC_FOR_BUILD)
699 AC_SUBST(sim_warnings)
700 AC_SUBST(sim_line_nr)
705 AC_SUBST(sim_decode_mechanism)
716 AC_SUBST(sim_regparm)
717 AC_SUBST(sim_stdcall)
718 AC_SUBST(sim_xor_endian)
719 AC_SUBST(sim_hostendian)
721 AC_SUBST(sim_igen_smp)
722 AC_SUBST(sim_bitsize)
723 AC_SUBST(sim_hostbitsize)
725 AC_SUBST(sim_timebase)
726 AC_SUBST(sim_alignment)
730 AC_SUBST(sim_reserved)
731 AC_SUBST(sim_monitor)
733 AC_SUBST(sim_default_model)
734 AC_SUBST(sim_model_issue)
737 AC_SUBST(sim_devzero)
738 AC_SUBST(sim_callback)
739 AC_SUBST(sim_targ_vals)
742 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])