1 dnl Process this file with autoconf to produce a configure script.
2 sinclude(../common/aclocal.m4)
9 # 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 the target has hard, soft, altivec or e500 floating point.],
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 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
198 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
199 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
201 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
202 echo "Setting float flags = $sim_float" 6>&1
205 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
206 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
212 AC_ARG_ENABLE(sim-hardware,
213 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
214 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
215 case "${enableval}" in
217 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
218 ,*) hardware="${hardware}${enableval}";;
219 *,) hardware="${enableval}${hardware}";;
220 *) hardware="${enableval}"'';;
222 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
223 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
224 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
225 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
226 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
227 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
228 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
229 if test x"$silent" != x"yes"; then
230 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
234 AC_ARG_ENABLE(sim-hostbitsize,
235 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
236 [case "${enableval}" in
237 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
238 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
240 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
241 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
242 fi],[sim_hostbitsize=""])dnl
245 AC_ARG_ENABLE(sim-hostendian,
246 [ --enable-sim-hostendian=end Specify host byte endian orientation.],
247 [case "${enableval}" in
248 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
249 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
250 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
251 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
253 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
254 echo "Setting hostendian flags = $sim_hostendian" 6>&1
256 if test "x$cross_compiling" = "xno"; then
258 if test $ac_cv_c_bigendian = yes; then
259 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
261 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
264 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
268 AC_ARG_ENABLE(sim-icache,
269 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
271 case "${enableval}" in
272 yes) icache="1024"; sim_icache="-I $icache";;
273 no) sim_icache="-R";;
276 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
278 define) sim_icache="${sim_icache}R";;
279 semantic) sim_icache="${sim_icache}C";;
280 insn) sim_icache="${sim_icache}S";;
281 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
282 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
285 sim_icache="${sim_icache}I $icache";;
287 if test x"$silent" != x"yes" && test x"$icache" != x""; then
288 echo "Setting instruction cache size to $icache ($sim_icache)"
289 fi],[sim_icache="-CSRI 1024"
290 if test x"$silent" != x"yes"; then
291 echo "Setting instruction cache size to 1024 ($sim_icache)"
295 AC_ARG_ENABLE(sim-inline,
296 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
299 no) sim_inline="-DDEFAULT_INLINE=0";;
300 0) sim_inline="-DDEFAULT_INLINE=0";;
301 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
302 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
303 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
306 *_INLINE=*) new_flag="-D$x";;
307 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
308 *_INLINE) new_flag="-D$x=ALL_INLINE";;
309 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
311 if test x"$sim_inline" = x""; then
312 sim_inline="$new_flag"
314 sim_inline="$sim_inline $new_flag"
318 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
319 echo "Setting inline flags = $sim_inline" 6>&1
320 fi],[if test x"$GCC" != ""; then
321 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
322 if test x"$silent" != x"yes"; then
323 echo "Setting inline flags = $sim_inline" 6>&1
330 AC_ARG_ENABLE(sim-jump,
331 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
332 [case "${enableval}" in
335 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
337 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
338 echo "Setting jump flag = $sim_jump" 6>&1
340 if test x"$silent" != x"yes"; then
341 echo "Setting jump flag = $sim_jump" 6>&1
345 AC_ARG_ENABLE(sim-line-nr,
346 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
347 [case "${enableval}" in
348 yes) sim_line_nr="";;
349 no) sim_line_nr="-L";;
350 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
352 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
353 echo "Setting warning flags = $sim_line_nr" 6>&1
354 fi],[sim_line_nr=""])dnl
357 AC_ARG_ENABLE(sim-model,
358 [ --enable-sim-model=which Specify PowerPC to model.],
359 [case "${enableval}" in
360 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
361 *) sim_model="-DWITH_MODEL=${enableval}";;
363 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
364 echo "Setting model flags = $sim_model" 6>&1
365 fi],[sim_model=""])dnl
368 AC_ARG_ENABLE(sim-model-issue,
369 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
370 [case "${enableval}" in
371 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
372 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
373 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
375 if test x"$silent" != x"yes"; then
376 echo "Setting model-issue flags = $sim_model_issue" 6>&1
377 fi],[sim_model_issue=""])dnl
380 AC_ARG_ENABLE(sim-monitor,
381 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
382 [case "${enableval}" in
383 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
384 no) sim_monitor="-DWITH_MON=0";;
385 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
386 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
387 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
389 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
390 echo "Setting monitor flags = $sim_monitor" 6>&1
391 fi],[sim_monitor=""])dnl
394 AC_ARG_ENABLE(sim-opcode,
395 [ --enable-sim-opcode=which Override default opcode lookup.],
396 [case "${enableval}" in
397 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
398 *) if test -f "${srcdir}/${enableval}"; then
399 sim_opcode="${enableval}"
400 elif test -f "${srcdir}/dc-${enableval}"; then
401 sim_opcode="dc-${enableval}"
403 AC_MSG_ERROR("File $enableval is not an opcode rules file");
404 sim_opcode="dc-complex"
407 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
408 echo "Setting opcode flags = $sim_opcode" 6>&1
409 fi],[sim_opcode="dc-complex"
410 if test x"$silent" != x"yes"; then
411 echo "Setting opcode flags = $sim_opcode"
415 AC_ARG_ENABLE(sim-packages,
416 [ --enable-sim-packages=list Specify the packages to be included in the build.],
418 case "${enableval}" in
420 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
421 ,*) packages="${packages}${enableval}";;
422 *,) packages="${enableval}${packages}";;
423 *) packages="${enableval}"'';;
425 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
426 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
427 if test x"$silent" != x"yes" && test x"$packages" != x""; then
428 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
429 fi],[packages=disklabel
430 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
431 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
432 if test x"$silent" != x"yes"; then
433 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
437 AC_ARG_ENABLE(sim-regparm,
438 [ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
439 [case "${enableval}" in
440 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
441 no) sim_regparm="" ;;
442 yes) sim_regparm="-DWITH_REGPARM=3";;
443 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
445 if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
446 echo "Setting regparm flags = $sim_regparm" 6>&1
447 fi],[sim_regparm=""])dnl
450 AC_ARG_ENABLE(sim-reserved-bits,
451 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
452 [case "${enableval}" in
453 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
454 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
455 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
457 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
458 echo "Setting reserved flags = $sim_reserved" 6>&1
459 fi],[sim_reserved=""])dnl
462 AC_ARG_ENABLE(sim-smp,
463 [ --enable-sim-smp=n Specify number of processors to configure for.],
464 [case "${enableval}" in
465 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
466 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
467 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
469 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
470 echo "Setting smp flags = $sim_smp" 6>&1
471 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
472 if test x"$silent" != x"yes"; then
473 echo "Setting smp flags = $sim_smp" 6>&1
477 AC_ARG_ENABLE(sim-stdcall,
478 [ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
479 [case "${enableval}" in
480 no) sim_stdcall="" ;;
481 std*) sim_stdcall="-DWITH_STDCALL=1";;
482 yes) sim_stdcall="-DWITH_STDCALL=1";;
483 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
485 if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
486 echo "Setting function call flags = $sim_stdcall" 6>&1
487 fi],[sim_stdcall=""])dnl
490 AC_ARG_ENABLE(sim-stdio,
491 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
492 [case "${enableval}" in
493 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
494 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
495 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
497 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
498 echo "Setting stdio flags = $sim_stdio" 6>&1
499 fi],[sim_stdio=""])dnl
502 AC_ARG_ENABLE(sim-switch,
503 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
504 [case "${enableval}" in
505 yes) sim_switch="-s";;
507 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
509 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
510 echo "Setting switch flags = $sim_switch" 6>&1
512 if test x"$silent" != x"yes"; then
513 echo "Setting switch flags = $sim_switch" 6>&1
517 AC_ARG_ENABLE(sim-timebase,
518 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
519 [case "${enableval}" in
520 yes) sim_timebase="-DWITH_TIME_BASE=1";;
521 no) sim_timebase="-DWITH_TIME_BASE=0";;
522 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
524 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
525 echo "Setting timebase flags = $sim_timebase" 6>&1
526 fi],[sim_timebase=""])dnl
529 AC_ARG_ENABLE(sim-trace,
530 [ --enable-sim-trace Specify whether tracing is supported.],
531 [case "${enableval}" in
532 yes) sim_trace="-DWITH_TRACE=1";;
533 no) sim_trace="-DWITH_TRACE=0";;
534 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
536 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
537 echo "Setting trace flags = $sim_trace" 6>&1
538 fi],[sim_trace=""])dnl
541 AC_ARG_ENABLE(sim-warnings,
542 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
543 [case "${enableval}" in
544 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
545 no) sim_warnings="-w";;
546 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
548 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
549 echo "Setting warning flags = $sim_warnings" 6>&1
550 fi],[sim_warnings=""])dnl
553 AC_ARG_ENABLE(sim-xor-endian,
554 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
555 [case "${enableval}" in
556 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
557 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
558 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
560 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
561 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
562 fi],[sim_xor_endian=""])dnl
568 . ${srcdir}/../../bfd/configure.host
570 AC_CONFIG_HEADER(config.h:config.in)
585 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)
587 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 sys/vfs.h sys/statfs.h)
590 dnl Figure out what type of termio/termios support there is
592 AC_MSG_CHECKING(for struct termios)
593 AC_CACHE_VAL(ac_cv_termios_struct,
594 [AC_TRY_COMPILE([#include <sys/types.h>
595 #include <sys/termios.h>],
596 [static struct termios x;
602 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
603 AC_MSG_RESULT($ac_cv_termios_struct)
604 if test $ac_cv_termios_struct = yes; then
605 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
608 if test "$ac_cv_termios_struct" = "yes"; then
609 AC_MSG_CHECKING(for c_line field in struct termios)
610 AC_CACHE_VAL(ac_cv_termios_cline,
611 [AC_TRY_COMPILE([#include <sys/types.h>
612 #include <sys/termios.h>],
613 [static struct termios x; x.c_line = 0;],
614 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
616 AC_MSG_RESULT($ac_cv_termios_cline)
617 if test $ac_cv_termios_cline = yes; then
618 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
621 ac_cv_termios_cline=no
624 if test "$ac_cv_termios_struct" != "yes"; then
625 AC_MSG_CHECKING(for struct termio)
626 AC_CACHE_VAL(ac_cv_termio_struct,
627 [AC_TRY_COMPILE([#include <sys/types.h>
628 #include <sys/termio.h>],
629 [static struct termio x;
635 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
636 AC_MSG_RESULT($ac_cv_termio_struct)
637 if test $ac_cv_termio_struct = yes; then
638 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
641 ac_cv_termio_struct=no
644 if test "$ac_cv_termio_struct" = "yes"; then
645 AC_MSG_CHECKING(for c_line field in struct termio)
646 AC_CACHE_VAL(ac_cv_termio_cline,
647 [AC_TRY_COMPILE([#include <sys/types.h>
648 #include <sys/termio.h>],
649 [static struct termio x; x.c_line = 0;],
650 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
652 AC_MSG_RESULT($ac_cv_termio_cline)
653 if test $ac_cv_termio_cline = yes; then
654 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
657 ac_cv_termio_cline=no
660 dnl Check for struct statfs
661 AC_MSG_CHECKING(for struct statfs)
662 AC_CACHE_VAL(ac_cv_struct_statfs,
663 [AC_TRY_COMPILE([#include <sys/types.h>
664 #ifdef HAVE_SYS_PARAM_H
665 #include <sys/param.h>
667 #ifdef HAVE_SYS_MOUNT_H
668 #include <sys/mount.h>
670 #ifdef HAVE_SYS_VFS_H
673 #ifdef HAVE_SYS_STATFS_H
674 #include <sys/statfs.h>
676 [static struct statfs s;],
677 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
678 AC_MSG_RESULT($ac_cv_struct_statfs)
679 if test $ac_cv_struct_statfs = yes; then
680 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
681 [Define if struct statfs is defined in <sys/mount.h>])
684 AC_CHECK_TYPES(long long)
686 dnl Figure out if /dev/zero exists or not
688 AC_MSG_CHECKING(for /dev/zero)
689 AC_CACHE_VAL(ac_cv_devzero,
690 [AC_TRY_RUN([#include <fcntl.h>
694 int fd = open ("/dev/zero", O_RDONLY);
697 for (i = 0; i < sizeof (buf); i++)
699 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
701 for (i = 0; i < sizeof (buf); i++)
705 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
706 AC_MSG_RESULT($ac_cv_devzero)
707 if test $ac_cv_devzero = yes; then
708 sim_devzero="-DHAVE_DEVZERO"
713 dnl Figure out if we are in the new Cygnus tree with a common directory or not
714 AC_MSG_CHECKING(for common simulator directory)
715 if test -f "${srcdir}/../common/callback.c"; then
717 sim_callback="callback.o targ-map.o"
718 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
725 AC_MSG_CHECKING(for common simulator directory fpu implementation)
726 if test -f "${srcdir}/../common/sim-fpu.c"; then
728 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
736 dnl Check for exe extension
739 AC_SUBST(CC_FOR_BUILD)
746 AC_SUBST(sim_warnings)
747 AC_SUBST(sim_line_nr)
752 AC_SUBST(sim_decode_mechanism)
763 AC_SUBST(sim_regparm)
764 AC_SUBST(sim_stdcall)
765 AC_SUBST(sim_xor_endian)
766 AC_SUBST(sim_hostendian)
768 AC_SUBST(sim_igen_smp)
769 AC_SUBST(sim_bitsize)
770 AC_SUBST(sim_hostbitsize)
772 AC_SUBST(sim_timebase)
773 AC_SUBST(sim_alignment)
777 AC_SUBST(sim_reserved)
778 AC_SUBST(sim_monitor)
780 AC_SUBST(sim_default_model)
781 AC_SUBST(sim_model_issue)
784 AC_SUBST(sim_devzero)
785 AC_SUBST(sim_callback)
786 AC_SUBST(sim_targ_vals)
787 AC_SUBST(sim_fpu_cflags)
791 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])