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
17 AC_ARG_ENABLE(sim-alignment,
18 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
19 [case "${enableval}" in
20 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
21 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
22 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
23 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
25 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
26 echo "Setting alignment flags = $sim_alignment" 6>&1
27 fi],[sim_alignment=""])dnl
30 AC_ARG_ENABLE(sim-assert,
31 [ --enable-sim-assert Specify whether to perform random assertions.],
32 [case "${enableval}" in
33 yes) sim_assert="-DWITH_ASSERT=1";;
34 no) sim_assert="-DWITH_ASSERT=0";;
35 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
37 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
38 echo "Setting assert flags = $sim_assert" 6>&1
39 fi],[sim_assert=""])dnl
42 AC_ARG_ENABLE(sim-bitsize,
43 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
44 [case "${enableval}" in
45 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
46 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
48 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
49 echo "Setting bitsize flags = $sim_bitsize" 6>&1
50 fi],[sim_bitsize=""])dnl
53 AC_ARG_ENABLE(sim-bswap,
54 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
55 [case "${enableval}" in
56 yes) sim_bswap="-DWITH_BSWAP=1";;
57 no) sim_bswap="-DWITH_BSWAP=0";;
58 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
60 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
61 echo "Setting bswap flags = $sim_bswap" 6>&1
62 fi],[sim_bswap=""])dnl
65 AC_ARG_ENABLE(sim-cflags,
66 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
67 [case "${enableval}" in
68 yes) sim_cflags="-O2 -fomit-frame-pointer";;
70 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
72 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
73 echo "Setting sim cflags = $sim_cflags" 6>&1
74 fi],[sim_cflags=""])dnl
77 AC_ARG_ENABLE(sim-config,
78 [ --enable-sim-config=file Override default config file],
79 [case "${enableval}" in
80 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
81 *) if test -f "${srcdir}/${enableval}"; then
82 sim_config="${enableval}";
83 elif test -f "${srcdir}/${enableval}-config.h"; then
84 sim_config="${enableval}-config.h"
86 AC_MSG_ERROR("Config file $enableval was not found");
87 sim_config=std-config.h
90 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
91 echo "Setting config flags = $sim_config" 6>&1
92 fi],[sim_config="std-config.h"
93 if test x"$silent" != x"yes"; then
94 echo "Setting config flags = $sim_config" 6>&1
98 AC_ARG_ENABLE(sim-decode-mechanism,
99 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
100 [case "${enableval}" in
101 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
102 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
103 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
104 sim_decode_mechanism="switch";;
106 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
107 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
108 fi],[sim_decode_mechanism=""
109 if test x"$silent" != x"yes"; then
110 echo "Setting decode mechanism flags = $sim_decode_mechanism"
114 AC_ARG_ENABLE(sim-default-model,
115 [ --enable-sim-default-model=which Specify default PowerPC to model.],
116 [case "${enableval}" in
117 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
118 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
120 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
121 echo "Setting default-model flags = $sim_default_model" 6>&1
122 fi],[sim_default_model=""])dnl
125 AC_ARG_ENABLE(sim-duplicate,
126 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
127 [case "${enableval}" in
130 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
132 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
133 echo "Setting duplicate flags = $sim_dup" 6>&1
135 if test x"$silent" != x"yes"; then
136 echo "Setting duplicate flags = $sim_dup" 6>&1
140 AC_ARG_ENABLE(sim-endian,
141 [ --enable-sim-endian=endian Specify target byte endian orientation.],
142 [case "${enableval}" in
143 yes) case "$target" in
144 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
145 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
146 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
148 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
149 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
150 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
151 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
153 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
154 echo "Setting endian flags = $sim_endian" 6>&1
155 fi],[sim_endian=""])dnl
158 AC_ARG_ENABLE(sim-env,
159 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
160 [case "${enableval}" in
161 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
162 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
163 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
164 no) sim_env="-DWITH_ENVIRONMENT=0";;
165 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
167 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
168 echo "Setting env flags = $sim_env" 6>&1
172 AC_ARG_ENABLE(sim-filter,
173 [ --enable-sim-filter=rule Specify filter rules.],
174 [case "${enableval}" in
175 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
177 *) sim_filter="-F $enableval";;
179 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
180 echo "Setting filter flags = $sim_filter" 6>&1
181 fi],[sim_filter="-F 32,f,o"
182 if test x"$silent" != x"yes"; then
183 echo "Setting filter flags = $sim_filter" 6>&1
187 AC_ARG_ENABLE(sim-float,
188 [ --enable-sim-float Specify whether to use host floating point or simulate.],
189 [case "${enableval}" in
190 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
191 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
192 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
194 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
195 echo "Setting float flags = $sim_float" 6>&1
196 fi],[sim_float=""])dnl
199 AC_ARG_ENABLE(sim-hardware,
200 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
201 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
202 case "${enableval}" in
204 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
205 ,*) hardware="${hardware}${enableval}";;
206 *,) hardware="${enableval}${hardware}";;
207 *) hardware="${enableval}"'';;
209 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
210 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
211 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
212 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
213 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
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"; then
217 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
221 AC_ARG_ENABLE(sim-hostbitsize,
222 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
223 [case "${enableval}" in
224 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
225 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
227 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
228 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
229 fi],[sim_hostbitsize=""])dnl
232 AC_ARG_ENABLE(sim-hostendian,
233 [ --enable-sim-hostendian=end Specify host byte endian orientation.],
234 [case "${enableval}" in
235 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
236 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
237 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
238 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
240 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
241 echo "Setting hostendian flags = $sim_hostendian" 6>&1
243 if test "x$cross_compiling" = "xno"; then
245 if test $ac_cv_c_bigendian = yes; then
246 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
248 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
251 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
255 AC_ARG_ENABLE(sim-icache,
256 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
258 case "${enableval}" in
259 yes) icache="1024"; sim_icache="-I $icache";;
260 no) sim_icache="-R";;
263 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
265 define) sim_icache="${sim_icache}R";;
266 semantic) sim_icache="${sim_icache}C";;
267 insn) sim_icache="${sim_icache}S";;
268 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
269 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
272 sim_icache="${sim_icache}I $icache";;
274 if test x"$silent" != x"yes" && test x"$icache" != x""; then
275 echo "Setting instruction cache size to $icache ($sim_icache)"
276 fi],[sim_icache="-CSRI 1024"
277 if test x"$silent" != x"yes"; then
278 echo "Setting instruction cache size to 1024 ($sim_icache)"
282 AC_ARG_ENABLE(sim-inline,
283 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
286 no) sim_inline="-DDEFAULT_INLINE=0";;
287 0) sim_inline="-DDEFAULT_INLINE=0";;
288 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
289 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
290 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
293 *_INLINE=*) new_flag="-D$x";;
294 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
295 *_INLINE) new_flag="-D$x=ALL_INLINE";;
296 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
298 if test x"$sim_inline" = x""; then
299 sim_inline="$new_flag"
301 sim_inline="$sim_inline $new_flag"
305 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
306 echo "Setting inline flags = $sim_inline" 6>&1
307 fi],[if test x"$GCC" != ""; then
308 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
309 if test x"$silent" != x"yes"; then
310 echo "Setting inline flags = $sim_inline" 6>&1
317 AC_ARG_ENABLE(sim-jump,
318 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
319 [case "${enableval}" in
322 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
324 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
325 echo "Setting jump flag = $sim_jump" 6>&1
327 if test x"$silent" != x"yes"; then
328 echo "Setting jump flag = $sim_jump" 6>&1
332 AC_ARG_ENABLE(sim-line-nr,
333 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
334 [case "${enableval}" in
335 yes) sim_line_nr="";;
336 no) sim_line_nr="-L";;
337 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
339 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
340 echo "Setting warning flags = $sim_line_nr" 6>&1
341 fi],[sim_line_nr=""])dnl
344 AC_ARG_ENABLE(sim-model,
345 [ --enable-sim-model=which Specify PowerPC to model.],
346 [case "${enableval}" in
347 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
348 *) sim_model="-DWITH_MODEL=${enableval}";;
350 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
351 echo "Setting model flags = $sim_model" 6>&1
352 fi],[sim_model=""])dnl
355 AC_ARG_ENABLE(sim-model-issue,
356 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
357 [case "${enableval}" in
358 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
359 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
360 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
362 if test x"$silent" != x"yes"; then
363 echo "Setting model-issue flags = $sim_model_issue" 6>&1
364 fi],[sim_model_issue=""])dnl
367 AC_ARG_ENABLE(sim-monitor,
368 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
369 [case "${enableval}" in
370 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
371 no) sim_monitor="-DWITH_MON=0";;
372 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
373 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
374 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
376 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
377 echo "Setting monitor flags = $sim_monitor" 6>&1
378 fi],[sim_monitor=""])dnl
381 AC_ARG_ENABLE(sim-opcode,
382 [ --enable-sim-opcode=which Override default opcode lookup.],
383 [case "${enableval}" in
384 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
385 *) if test -f "${srcdir}/${enableval}"; then
386 sim_opcode="${enableval}"
387 elif test -f "${srcdir}/dc-${enableval}"; then
388 sim_opcode="dc-${enableval}"
390 AC_MSG_ERROR("File $enableval is not an opcode rules file");
391 sim_opcode="dc-complex"
394 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
395 echo "Setting opcode flags = $sim_opcode" 6>&1
396 fi],[sim_opcode="dc-complex"
397 if test x"$silent" != x"yes"; then
398 echo "Setting opcode flags = $sim_opcode"
402 AC_ARG_ENABLE(sim-packages,
403 [ --enable-sim-packages=list Specify the packages to be included in the build.],
405 case "${enableval}" in
407 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
408 ,*) packages="${packages}${enableval}";;
409 *,) packages="${enableval}${packages}";;
410 *) packages="${enableval}"'';;
412 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
413 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
414 if test x"$silent" != x"yes" && test x"$packages" != x""; then
415 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
416 fi],[packages=disklabel
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"; then
420 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
424 AC_ARG_ENABLE(sim-regparm,
425 [ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
426 [case "${enableval}" in
427 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
428 no) sim_regparm="" ;;
429 yes) sim_regparm="-DWITH_REGPARM=3";;
430 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
432 if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
433 echo "Setting regparm flags = $sim_regparm" 6>&1
434 fi],[sim_regparm=""])dnl
437 AC_ARG_ENABLE(sim-reserved-bits,
438 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
439 [case "${enableval}" in
440 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
441 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
442 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
444 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
445 echo "Setting reserved flags = $sim_reserved" 6>&1
446 fi],[sim_reserved=""])dnl
449 AC_ARG_ENABLE(sim-smp,
450 [ --enable-sim-smp=n Specify number of processors to configure for.],
451 [case "${enableval}" in
452 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
453 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
454 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
456 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
457 echo "Setting smp flags = $sim_smp" 6>&1
458 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
459 if test x"$silent" != x"yes"; then
460 echo "Setting smp flags = $sim_smp" 6>&1
464 AC_ARG_ENABLE(sim-stdcall,
465 [ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
466 [case "${enableval}" in
467 no) sim_stdcall="" ;;
468 std*) sim_stdcall="-DWITH_STDCALL=1";;
469 yes) sim_stdcall="-DWITH_STDCALL=1";;
470 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
472 if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
473 echo "Setting function call flags = $sim_stdcall" 6>&1
474 fi],[sim_stdcall=""])dnl
477 AC_ARG_ENABLE(sim-stdio,
478 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
479 [case "${enableval}" in
480 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
481 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
482 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
484 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
485 echo "Setting stdio flags = $sim_stdio" 6>&1
486 fi],[sim_stdio=""])dnl
489 AC_ARG_ENABLE(sim-switch,
490 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
491 [case "${enableval}" in
492 yes) sim_switch="-s";;
494 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
496 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
497 echo "Setting switch flags = $sim_switch" 6>&1
499 if test x"$silent" != x"yes"; then
500 echo "Setting switch flags = $sim_switch" 6>&1
504 AC_ARG_ENABLE(sim-timebase,
505 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
506 [case "${enableval}" in
507 yes) sim_timebase="-DWITH_TIME_BASE=1";;
508 no) sim_timebase="-DWITH_TIME_BASE=0";;
509 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
511 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
512 echo "Setting timebase flags = $sim_timebase" 6>&1
513 fi],[sim_timebase=""])dnl
516 AC_ARG_ENABLE(sim-trace,
517 [ --enable-sim-trace Specify whether tracing is supported.],
518 [case "${enableval}" in
519 yes) sim_trace="-DWITH_TRACE=1";;
520 no) sim_trace="-DWITH_TRACE=0";;
521 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
523 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
524 echo "Setting trace flags = $sim_trace" 6>&1
525 fi],[sim_trace=""])dnl
528 AC_ARG_ENABLE(sim-warnings,
529 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
530 [case "${enableval}" in
531 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
532 no) sim_warnings="-w";;
533 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
535 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
536 echo "Setting warning flags = $sim_warnings" 6>&1
537 fi],[sim_warnings=""])dnl
540 AC_ARG_ENABLE(sim-xor-endian,
541 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
542 [case "${enableval}" in
543 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
544 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
545 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
547 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
548 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
549 fi],[sim_xor_endian=""])dnl
552 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
556 . ${srcdir}/../../bfd/configure.host
558 AC_CONFIG_HEADER(config.h:config.in)
573 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)
575 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)
578 dnl Figure out what type of termio/termios support there is
580 AC_MSG_CHECKING(for struct termios)
581 AC_CACHE_VAL(ac_cv_termios_struct,
582 [AC_TRY_COMPILE([#include <sys/types.h>
583 #include <sys/termios.h>],
584 [static struct termios x;
590 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
591 AC_MSG_RESULT($ac_cv_termios_struct)
592 if test $ac_cv_termios_struct = yes; then
593 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
596 if test "$ac_cv_termios_struct" = "yes"; then
597 AC_MSG_CHECKING(for c_line field in struct termios)
598 AC_CACHE_VAL(ac_cv_termios_cline,
599 [AC_TRY_COMPILE([#include <sys/types.h>
600 #include <sys/termios.h>],
601 [static struct termios x; x.c_line = 0;],
602 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
604 AC_MSG_RESULT($ac_cv_termios_cline)
605 if test $ac_cv_termios_cline = yes; then
606 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
609 ac_cv_termios_cline=no
612 if test "$ac_cv_termios_struct" != "yes"; then
613 AC_MSG_CHECKING(for struct termio)
614 AC_CACHE_VAL(ac_cv_termio_struct,
615 [AC_TRY_COMPILE([#include <sys/types.h>
616 #include <sys/termio.h>],
617 [static struct termio x;
623 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
624 AC_MSG_RESULT($ac_cv_termio_struct)
625 if test $ac_cv_termio_struct = yes; then
626 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
629 ac_cv_termio_struct=no
632 if test "$ac_cv_termio_struct" = "yes"; then
633 AC_MSG_CHECKING(for c_line field in struct termio)
634 AC_CACHE_VAL(ac_cv_termio_cline,
635 [AC_TRY_COMPILE([#include <sys/types.h>
636 #include <sys/termio.h>],
637 [static struct termio x; x.c_line = 0;],
638 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
640 AC_MSG_RESULT($ac_cv_termio_cline)
641 if test $ac_cv_termio_cline = yes; then
642 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
645 ac_cv_termio_cline=no
648 dnl Figure out if /dev/zero exists or not
650 AC_MSG_CHECKING(for /dev/zero)
651 AC_CACHE_VAL(ac_cv_devzero,
652 [AC_TRY_RUN([#include <fcntl.h>
656 int fd = open ("/dev/zero", O_RDONLY);
659 for (i = 0; i < sizeof (buf); i++)
661 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
663 for (i = 0; i < sizeof (buf); i++)
667 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
668 AC_MSG_RESULT($ac_cv_devzero)
669 if test $ac_cv_devzero = yes; then
670 sim_devzero="-DHAVE_DEVZERO"
675 dnl Figure out if we are in the new Cygnus tree with a common directory or not
676 AC_MSG_CHECKING(for common simulator directory)
677 if test -f "${srcdir}/../common/callback.c"; then
679 sim_callback="callback.o targ-map.o"
680 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
687 AC_SUBST(CC_FOR_BUILD)
694 AC_SUBST(sim_warnings)
695 AC_SUBST(sim_line_nr)
700 AC_SUBST(sim_decode_mechanism)
711 AC_SUBST(sim_regparm)
712 AC_SUBST(sim_stdcall)
713 AC_SUBST(sim_xor_endian)
714 AC_SUBST(sim_hostendian)
716 AC_SUBST(sim_igen_smp)
717 AC_SUBST(sim_bitsize)
718 AC_SUBST(sim_hostbitsize)
720 AC_SUBST(sim_timebase)
721 AC_SUBST(sim_alignment)
725 AC_SUBST(sim_reserved)
726 AC_SUBST(sim_monitor)
728 AC_SUBST(sim_default_model)
729 AC_SUBST(sim_model_issue)
732 AC_SUBST(sim_devzero)
733 AC_SUBST(sim_callback)
734 AC_SUBST(sim_targ_vals)
737 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])