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 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";;
21 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
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
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"`;;
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
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
42 no) sim_line_nr="-L";;
43 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
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
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"
58 AC_MSG_ERROR("Config file $enableval was not found");
59 sim_config=std-config.h
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
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}"
78 AC_MSG_ERROR("File $enableval is not an opcode rules file");
79 sim_opcode="ppc-opcode-complex"
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"
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";;
94 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
96 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
97 echo "Setting switch flags = $sim_switch" 6>&1
99 if test x"$silent" != x"yes"; then
100 echo "Setting switch flags = $sim_switch" 6>&1
103 AC_ARG_ENABLE(sim-duplicate,
104 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
105 [case "${enableval}" in
108 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
110 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
111 echo "Setting duplicate flags = $sim_dup" 6>&1
113 if test x"$silent" != x"yes"; then
114 echo "Setting duplicate flags = $sim_dup" 6>&1
117 AC_ARG_ENABLE(sim-jump,
118 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
119 [case "${enableval}" in
122 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
124 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
125 echo "Setting jump flag = $sim_jump" 6>&1
127 if test x"$silent" != x"yes"; then
128 echo "Setting jump flag = $sim_jump" 6>&1
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="";;
136 *) sim_filter="-F $enableval";;
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
145 AC_ARG_ENABLE(sim-icache,
146 [ --enable-sim-icache=size Specify instruction cache size.],
148 case "${enableval}" in
149 yes) icache="1024"; sim_icache="-I $icache";;
153 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
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="";;
162 sim_icache="${sim_icache}I $icache";;
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)"
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
176 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
177 ,*) hardware="${hardware}${enableval}";;
178 *) hardware="${enableval}";;
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"
192 AC_ARG_ENABLE(sim-packages,
193 [ --enable-sim-packages=list Specify the packages to be included in the build.],
195 case "${enableval}" in
197 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
198 ,*) packages="${packages}${enableval}";;
199 *) packages="${enableval}"''
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"
212 AC_ARG_ENABLE(sim-inline,
213 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
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
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";;
228 if test x"$sim_inline" = x""; then
229 sim_inline="$new_flag"
231 sim_inline="$sim_inline $new_flag"
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
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="";;
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
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";;
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="";;
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
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="";;
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
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="";;
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
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="";;
306 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
307 echo "Setting hostendian flags = $sim_hostendian" 6>&1
309 if test "x$cross_compiling" = "xno"; then
311 if test $ac_cv_c_bigendian = yes; then
312 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
314 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
317 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
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";;
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
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";;
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
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="";;
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
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="";;
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
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="";;
374 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
375 echo "Setting env flags = $sim_env" 6>&1
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="";;
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
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="";;
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
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="";;
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
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="";;
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
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="";;
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
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="";;
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
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="";;
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
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}";;
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
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}";;
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
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="";;
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
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="";;
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
500 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
504 . ${srcdir}/../../bfd/configure.host
506 AC_CONFIG_HEADER(config.h:config.in)
521 AC_CHECK_FUNCS(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)
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)
526 dnl Figure out what type of termio/termios support there is
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;
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"
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)])
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"
557 ac_cv_termios_cline=no
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;
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"
577 ac_cv_termio_struct=no
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)])
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"
593 ac_cv_termio_cline=no
596 dnl Figure out if /dev/zero exists or not
598 AC_MSG_CHECKING(for /dev/zero)
599 AC_CACHE_VAL(ac_cv_devzero,
600 [AC_TRY_RUN([#include <fcntl.h>
604 int fd = open ("/dev/zero", O_RDONLY);
607 for (i = 0; i < sizeof (buf); i++)
609 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
611 for (i = 0; i < sizeof (buf); i++)
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"
623 AC_SUBST(CC_FOR_BUILD)
630 AC_SUBST(sim_warnings)
631 AC_SUBST(sim_line_nr)
646 AC_SUBST(sim_regparm)
647 AC_SUBST(sim_stdcall)
648 AC_SUBST(sim_xor_endian)
649 AC_SUBST(sim_hostendian)
651 AC_SUBST(sim_igen_smp)
652 AC_SUBST(sim_bitsize)
653 AC_SUBST(sim_hostbitsize)
655 AC_SUBST(sim_timebase)
656 AC_SUBST(sim_alignment)
660 AC_SUBST(sim_reserved)
661 AC_SUBST(sim_monitor)
663 AC_SUBST(sim_default_model)
664 AC_SUBST(sim_model_issue)
667 AC_SUBST(sim_devzero)
670 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])