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-default-model,
99 [ --enable-sim-default-model=which Specify default PowerPC to model.],
100 [case "${enableval}" in
101 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
102 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
104 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
105 echo "Setting default-model flags = $sim_default_model" 6>&1
106 fi],[sim_model=""])dnl
109 AC_ARG_ENABLE(sim-duplicate,
110 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
111 [case "${enableval}" in
114 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
116 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
117 echo "Setting duplicate flags = $sim_dup" 6>&1
119 if test x"$silent" != x"yes"; then
120 echo "Setting duplicate flags = $sim_dup" 6>&1
124 AC_ARG_ENABLE(sim-endian,
125 [ --enable-sim-endian=endian Specify target byte endian orientation.],
126 [case "${enableval}" in
127 yes) case "$target" in
128 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
129 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
130 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
132 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
133 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
134 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
135 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
137 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
138 echo "Setting endian flags = $sim_endian" 6>&1
139 fi],[sim_endian=""])dnl
142 AC_ARG_ENABLE(sim-env,
143 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
144 [case "${enableval}" in
145 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
146 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
147 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
148 no) sim_env="-DWITH_ENVIRONMENT=0";;
149 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
151 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
152 echo "Setting env flags = $sim_env" 6>&1
156 AC_ARG_ENABLE(sim-filter,
157 [ --enable-sim-filter=rule Specify filter rules.],
158 [case "${enableval}" in
159 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
161 *) sim_filter="-F $enableval";;
163 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
164 echo "Setting filter flags = $sim_filter" 6>&1
165 fi],[sim_filter="-F 32,f,o"
166 if test x"$silent" != x"yes"; then
167 echo "Setting filter flags = $sim_filter" 6>&1
171 AC_ARG_ENABLE(sim-float,
172 [ --enable-sim-float Specify whether to use host floating point or simulate.],
173 [case "${enableval}" in
174 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
175 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
176 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
178 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
179 echo "Setting float flags = $sim_float" 6>&1
180 fi],[sim_float=""])dnl
183 AC_ARG_ENABLE(sim-hardware,
184 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
185 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
186 case "${enableval}" in
188 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
189 ,*) hardware="${hardware}${enableval}";;
190 *,) hardware="${enableval}${hardware}";;
191 *) hardware="${enableval}"'';;
193 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
194 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
195 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
196 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
197 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
198 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
199 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
200 if test x"$silent" != x"yes"; then
201 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
205 AC_ARG_ENABLE(sim-hostbitsize,
206 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
207 [case "${enableval}" in
208 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
209 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
211 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
212 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
213 fi],[sim_hostbitsize=""])dnl
216 AC_ARG_ENABLE(sim-hostendian,
217 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
218 [case "${enableval}" in
219 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
220 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
221 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
222 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
224 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
225 echo "Setting hostendian flags = $sim_hostendian" 6>&1
227 if test "x$cross_compiling" = "xno"; then
229 if test $ac_cv_c_bigendian = yes; then
230 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
232 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
235 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
239 AC_ARG_ENABLE(sim-icache,
240 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
242 case "${enableval}" in
243 yes) icache="1024"; sim_icache="-I $icache";;
244 no) sim_icache="-R";;
247 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
249 define) sim_icache="${sim_icache}R";;
250 semantic) sim_icache="${sim_icache}C";;
251 insn) sim_icache="${sim_icache}S";;
252 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
253 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
256 sim_icache="${sim_icache}I $icache";;
258 if test x"$silent" != x"yes" && test x"$icache" != x""; then
259 echo "Setting instruction cache size to $icache ($sim_icache)"
260 fi],[sim_icache="-CSRI 1024"
261 if test x"$silent" != x"yes"; then
262 echo "Setting instruction cache size to 1024 ($sim_icache)"
266 AC_ARG_ENABLE(sim-inline,
267 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
270 no) sim_inline="-DDEFAULT_INLINE=0";;
271 0) sim_inline="-DDEFAULT_INLINE=0";;
272 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
273 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
274 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
277 *_INLINE=*) new_flag="-D$x";;
278 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
279 *_INLINE) new_flag="-D$x=ALL_INLINE";;
280 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
282 if test x"$sim_inline" = x""; then
283 sim_inline="$new_flag"
285 sim_inline="$sim_inline $new_flag"
289 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
290 echo "Setting inline flags = $sim_inline" 6>&1
291 fi],[if test x"$GCC" != ""; then
292 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
293 if test x"$silent" != x"yes"; then
294 echo "Setting inline flags = $sim_inline" 6>&1
301 AC_ARG_ENABLE(sim-jump,
302 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
303 [case "${enableval}" in
306 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
308 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
309 echo "Setting jump flag = $sim_jump" 6>&1
311 if test x"$silent" != x"yes"; then
312 echo "Setting jump flag = $sim_jump" 6>&1
316 AC_ARG_ENABLE(sim-line-nr,
317 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
318 [case "${enableval}" in
319 yes) sim_line_nr="";;
320 no) sim_line_nr="-L";;
321 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
323 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
324 echo "Setting warning flags = $sim_line_nr" 6>&1
325 fi],[sim_line_nr=""])dnl
328 AC_ARG_ENABLE(sim-model,
329 [ --enable-sim-model=which Specify PowerPC to model.],
330 [case "${enableval}" in
331 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
332 *) sim_model="-DWITH_MODEL=${enableval}";;
334 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
335 echo "Setting model flags = $sim_model" 6>&1
336 fi],[sim_model=""])dnl
339 AC_ARG_ENABLE(sim-model-issue,
340 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
341 [case "${enableval}" in
342 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
343 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
344 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
346 if test x"$silent" != x"yes"; then
347 echo "Setting model-issue flags = $sim_model_issue" 6>&1
348 fi],[sim_model_issue=""])dnl
351 AC_ARG_ENABLE(sim-monitor,
352 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
353 [case "${enableval}" in
354 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
355 no) sim_monitor="-DWITH_MON=0";;
356 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
357 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
358 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
360 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
361 echo "Setting monitor flags = $sim_monitor" 6>&1
362 fi],[sim_monitor=""])dnl
365 AC_ARG_ENABLE(sim-opcode,
366 [ --enable-sim-opcode=which Override default opcode lookup.],
367 [case "${enableval}" in
368 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
369 *) if test -f "${srcdir}/${enableval}"; then
370 sim_opcode="${enableval}"
371 elif test -f "${srcdir}/ppc-opcode-${enableval}"; then
372 sim_opcode="ppc-opcode-${enableval}"
374 AC_MSG_ERROR("File $enableval is not an opcode rules file");
375 sim_opcode="ppc-opcode-complex"
378 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
379 echo "Setting opcode flags = $sim_opcode" 6>&1
380 fi],[sim_opcode="ppc-opcode-complex"
381 if test x"$silent" != x"yes"; then
382 echo "Setting opcode flags = $sim_opcode"
386 AC_ARG_ENABLE(sim-packages,
387 [ --enable-sim-packages=list Specify the packages to be included in the build.],
389 case "${enableval}" in
391 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
392 ,*) packages="${packages}${enableval}";;
393 *,) packages="${enableval}${packages}";;
394 *) packages="${enableval}"'';;
396 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
397 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
398 if test x"$silent" != x"yes" && test x"$packages" != x""; then
399 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
400 fi],[packages=disklabel
401 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
402 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
403 if test x"$silent" != x"yes"; then
404 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
408 AC_ARG_ENABLE(sim-regparm,
409 [ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
410 [case "${enableval}" in
411 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
412 no) sim_regparm="" ;;
413 yes) sim_regparm="-DWITH_REGPARM=3";;
414 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
416 if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
417 echo "Setting regparm flags = $sim_regparm" 6>&1
418 fi],[sim_regparm=""])dnl
421 AC_ARG_ENABLE(sim-reserved-bits,
422 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
423 [case "${enableval}" in
424 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
425 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
426 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
428 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
429 echo "Setting reserved flags = $sim_reserved" 6>&1
430 fi],[sim_reserved=""])dnl
433 AC_ARG_ENABLE(sim-smp,
434 [ --enable-sim-smp=n Specify number of processors to configure for.],
435 [case "${enableval}" in
436 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
437 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
438 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
440 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
441 echo "Setting smp flags = $sim_smp" 6>&1
442 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
443 if test x"$silent" != x"yes"; then
444 echo "Setting smp flags = $sim_smp" 6>&1
448 AC_ARG_ENABLE(sim-stdcall,
449 [ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
450 [case "${enableval}" in
451 no) sim_stdcall="" ;;
452 std*) sim_stdcall="-DWITH_STDCALL=1";;
453 yes) sim_stdcall="-DWITH_STDCALL=1";;
454 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
456 if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
457 echo "Setting function call flags = $sim_stdcall" 6>&1
458 fi],[sim_stdcall=""])dnl
461 AC_ARG_ENABLE(sim-stdio,
462 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
463 [case "${enableval}" in
464 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
465 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
466 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
468 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
469 echo "Setting stdio flags = $sim_stdio" 6>&1
470 fi],[sim_stdio=""])dnl
473 AC_ARG_ENABLE(sim-switch,
474 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
475 [case "${enableval}" in
476 yes) sim_switch="-s";;
478 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
480 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
481 echo "Setting switch flags = $sim_switch" 6>&1
483 if test x"$silent" != x"yes"; then
484 echo "Setting switch flags = $sim_switch" 6>&1
488 AC_ARG_ENABLE(sim-timebase,
489 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
490 [case "${enableval}" in
491 yes) sim_timebase="-DWITH_TIME_BASE=1";;
492 no) sim_timebase="-DWITH_TIME_BASE=0";;
493 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
495 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
496 echo "Setting timebase flags = $sim_timebase" 6>&1
497 fi],[sim_timebase=""])dnl
500 AC_ARG_ENABLE(sim-trace,
501 [ --enable-sim-trace Specify whether tracing is supported.],
502 [case "${enableval}" in
503 yes) sim_trace="-DWITH_TRACE=1";;
504 no) sim_trace="-DWITH_TRACE=0";;
505 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
507 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
508 echo "Setting trace flags = $sim_trace" 6>&1
509 fi],[sim_trace=""])dnl
512 AC_ARG_ENABLE(sim-warnings,
513 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
514 [case "${enableval}" in
515 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
516 no) sim_warnings="-w";;
517 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
519 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
520 echo "Setting warning flags = $sim_warnings" 6>&1
521 fi],[sim_warnings=""])dnl
524 AC_ARG_ENABLE(sim-xor-endian,
525 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
526 [case "${enableval}" in
527 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
528 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
529 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
531 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
532 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
533 fi],[sim_xor_endian=""])dnl
536 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
540 . ${srcdir}/../../bfd/configure.host
542 AC_CONFIG_HEADER(config.h:config.in)
557 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)
559 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)
562 dnl Figure out what type of termio/termios support there is
564 AC_MSG_CHECKING(for struct termios)
565 AC_CACHE_VAL(ac_cv_termios_struct,
566 [AC_TRY_COMPILE([#include <sys/types.h>
567 #include <sys/termios.h>],
568 [static struct termios x;
574 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
575 AC_MSG_RESULT($ac_cv_termios_struct)
576 if test $ac_cv_termios_struct = yes; then
577 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
580 if test "$ac_cv_termios_struct" = "yes"; then
581 AC_MSG_CHECKING(for c_line field in struct termios)
582 AC_CACHE_VAL(ac_cv_termios_cline,
583 [AC_TRY_COMPILE([#include <sys/types.h>
584 #include <sys/termios.h>],
585 [static struct termios x; x.c_line = 0;],
586 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
588 AC_MSG_RESULT($ac_cv_termios_cline)
589 if test $ac_cv_termios_cline = yes; then
590 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
593 ac_cv_termios_cline=no
596 if test "$ac_cv_termios_struct" != "yes"; then
597 AC_MSG_CHECKING(for struct termio)
598 AC_CACHE_VAL(ac_cv_termio_struct,
599 [AC_TRY_COMPILE([#include <sys/types.h>
600 #include <sys/termio.h>],
601 [static struct termio x;
607 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
608 AC_MSG_RESULT($ac_cv_termio_struct)
609 if test $ac_cv_termio_struct = yes; then
610 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
613 ac_cv_termio_struct=no
616 if test "$ac_cv_termio_struct" = "yes"; then
617 AC_MSG_CHECKING(for c_line field in struct termio)
618 AC_CACHE_VAL(ac_cv_termio_cline,
619 [AC_TRY_COMPILE([#include <sys/types.h>
620 #include <sys/termio.h>],
621 [static struct termio x; x.c_line = 0;],
622 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
624 AC_MSG_RESULT($ac_cv_termio_cline)
625 if test $ac_cv_termio_cline = yes; then
626 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
629 ac_cv_termio_cline=no
632 dnl Figure out if /dev/zero exists or not
634 AC_MSG_CHECKING(for /dev/zero)
635 AC_CACHE_VAL(ac_cv_devzero,
636 [AC_TRY_RUN([#include <fcntl.h>
640 int fd = open ("/dev/zero", O_RDONLY);
643 for (i = 0; i < sizeof (buf); i++)
645 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
647 for (i = 0; i < sizeof (buf); i++)
651 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
652 AC_MSG_RESULT($ac_cv_devzero)
653 if test $ac_cv_devzero = yes; then
654 sim_devzero="-DHAVE_DEVZERO"
659 dnl Figure out if we are in the new Cygnus tree with a common directory or not
660 AC_MSG_CHECKING(for common simulator directory)
661 if test -f "${srcdir}/../common/callback.c"; then
663 sim_callback="callback.o targ-map.o"
664 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
671 AC_SUBST(CC_FOR_BUILD)
678 AC_SUBST(sim_warnings)
679 AC_SUBST(sim_line_nr)
694 AC_SUBST(sim_regparm)
695 AC_SUBST(sim_stdcall)
696 AC_SUBST(sim_xor_endian)
697 AC_SUBST(sim_hostendian)
699 AC_SUBST(sim_igen_smp)
700 AC_SUBST(sim_bitsize)
701 AC_SUBST(sim_hostbitsize)
703 AC_SUBST(sim_timebase)
704 AC_SUBST(sim_alignment)
708 AC_SUBST(sim_reserved)
709 AC_SUBST(sim_monitor)
711 AC_SUBST(sim_default_model)
712 AC_SUBST(sim_model_issue)
715 AC_SUBST(sim_devzero)
716 AC_SUBST(sim_callback)
717 AC_SUBST(sim_targ_vals)
720 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])