1 dnl Process this file with autoconf to produce a configure script.
4 sinclude(../common/acinclude.m4)
9 # Put a plausible default for CC_FOR_BUILD in Makefile.
10 if test "x$cross_compiling" = "xno"; then
15 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
17 dnl We don't use gettext, but bfd does. So we do the appropriate checks
18 dnl to see if there are intl libraries we should link against.
20 ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
23 AC_ARG_ENABLE(sim-alignment,
24 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
25 [case "${enableval}" in
26 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
27 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
28 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
29 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
31 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
32 echo "Setting alignment flags = $sim_alignment" 6>&1
33 fi],[sim_alignment=""])dnl
36 AC_MSG_CHECKING([whether to enable sim asserts])
38 AC_ARG_ENABLE(sim-assert,
39 [ --enable-sim-assert Specify whether to perform random assertions.],
40 [case "${enableval}" in
43 *) AC_MSG_ERROR([--enable-sim-assert does not take a value]);;
45 AC_DEFINE_UNQUOTED([WITH_ASSERT], [$sim_assert], [Sim assert settings])
46 AC_MSG_RESULT($sim_assert)
49 AC_ARG_ENABLE(sim-bitsize,
50 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
51 [case "${enableval}" in
52 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
53 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
55 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
56 echo "Setting bitsize flags = $sim_bitsize" 6>&1
57 fi],[sim_bitsize=""])dnl
60 AC_ARG_ENABLE(sim-config,
61 [ --enable-sim-config=file Override default config file],
62 [case "${enableval}" in
63 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
64 *) if test -f "${srcdir}/${enableval}"; then
65 sim_config="${enableval}";
66 elif test -f "${srcdir}/${enableval}-config.h"; then
67 sim_config="${enableval}-config.h"
69 AC_MSG_ERROR("Config file $enableval was not found");
70 sim_config=std-config.h
73 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
74 echo "Setting config flags = $sim_config" 6>&1
75 fi],[sim_config="std-config.h"
76 if test x"$silent" != x"yes"; then
77 echo "Setting config flags = $sim_config" 6>&1
81 AC_ARG_ENABLE(sim-decode-mechanism,
82 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
83 [case "${enableval}" in
84 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
85 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
86 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
87 sim_decode_mechanism="switch";;
89 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
90 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
91 fi],[sim_decode_mechanism=""
92 if test x"$silent" != x"yes"; then
93 echo "Setting decode mechanism flags = $sim_decode_mechanism"
97 AC_ARG_ENABLE(sim-default-model,
98 [ --enable-sim-default-model=which Specify default PowerPC to model.],
99 [case "${enableval}" in
100 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
101 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
103 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
104 echo "Setting default-model flags = $sim_default_model" 6>&1
105 fi],[sim_default_model=""])dnl
108 AC_ARG_ENABLE(sim-duplicate,
109 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
110 [case "${enableval}" in
113 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
115 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
116 echo "Setting duplicate flags = $sim_dup" 6>&1
118 if test x"$silent" != x"yes"; then
119 echo "Setting duplicate flags = $sim_dup" 6>&1
123 AC_ARG_ENABLE(sim-endian,
124 [ --enable-sim-endian=endian Specify target byte endian orientation.],
125 [case "${enableval}" in
126 yes) case "$target" in
127 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
128 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
129 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
131 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
132 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
133 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
134 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
136 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
137 echo "Setting endian flags = $sim_endian" 6>&1
138 fi],[sim_endian=""])dnl
141 AC_MSG_CHECKING([default sim environment setting])
143 AC_ARG_ENABLE(sim-env,
144 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
145 [case "${enableval}" in
146 operating | os | oea) sim_env="OPERATING_ENVIRONMENT";;
147 virtual | vea) sim_env="VIRTUAL_ENVIRONMENT";;
148 user | uea) sim_env="USER_ENVIRONMENT";;
150 *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-env]);;
152 AC_DEFINE_UNQUOTED([WITH_ENVIRONMENT], [$sim_env], [Sim default environment])
153 AC_MSG_RESULT($sim_env)
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 the target has hard, soft, altivec or e500 floating point.],
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 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
177 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
178 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
180 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
181 echo "Setting float flags = $sim_float" 6>&1
184 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
185 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
190 AC_CACHE_CHECK([if union semun defined],
191 ac_cv_HAS_UNION_SEMUN,
193 #include <sys/types.h>
195 #include <sys/sem.h>],
197 [ac_cv_has_union_semun="yes"],
198 [ac_cv_has_union_semun="no"])
199 AC_MSG_RESULT($ac_cv_has_union_semun)
203 if test "$ac_cv_has_union_semun" = "yes"; then
204 AC_CACHE_CHECK(whether System V semaphores are supported,
209 #include <sys/types.h>
215 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
218 arg.val = 0; /* avoid implicit type cast to union */
219 if (semctl(id, 0, IPC_RMID, arg) == -1)
224 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
226 else # semun is not defined
227 AC_CACHE_CHECK(whether System V semaphores are supported,
232 #include <sys/types.h>
237 struct semid_ds *buf;
243 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
246 arg.val = 0; /* avoid implicit type cast to union */
247 if (semctl(id, 0, IPC_RMID, arg) == -1)
252 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
256 AC_CACHE_CHECK(whether System V shared memory is supported,
260 #include <sys/types.h>
264 int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
267 if (shmctl(id, IPC_RMID, 0) == -1)
272 ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
275 if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
276 sim_sysv_ipc_hw=",sem,shm";
281 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
282 AC_DEFINE(HAVE_UNION_SEMUN, 1,
283 [Define if union semun is defined in <sys/sem.h>])
287 AC_ARG_ENABLE(sim-hardware,
288 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
289 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
290 case "${enableval}" in
292 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
293 ,*) hardware="${hardware}${enableval}";;
294 *,) hardware="${enableval}${hardware}";;
295 *) hardware="${enableval}"'';;
297 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
298 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
299 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
300 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
301 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
302 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
303 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
304 if test x"$silent" != x"yes"; then
305 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
308 AC_ARG_ENABLE(sim-hostbitsize,
309 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
310 [case "${enableval}" in
311 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
312 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
314 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
315 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
316 fi],[sim_hostbitsize=""])dnl
319 AC_ARG_ENABLE(sim-hostendian,
320 [ --enable-sim-hostendian=end Specify host byte endian orientation.],
321 [case "${enableval}" in
322 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
323 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
324 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
325 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
327 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
328 echo "Setting hostendian flags = $sim_hostendian" 6>&1
330 if test "x$cross_compiling" = "xno"; then
332 if test $ac_cv_c_bigendian = yes; then
333 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
335 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
338 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
342 AC_ARG_ENABLE(sim-icache,
343 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
345 case "${enableval}" in
346 yes) icache="1024"; sim_icache="-I $icache";;
347 no) sim_icache="-R";;
350 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
352 define) sim_icache="${sim_icache}R";;
353 semantic) sim_icache="${sim_icache}C";;
354 insn) sim_icache="${sim_icache}S";;
355 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
356 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
359 sim_icache="${sim_icache}I $icache";;
361 if test x"$silent" != x"yes" && test x"$icache" != x""; then
362 echo "Setting instruction cache size to $icache ($sim_icache)"
363 fi],[sim_icache="-CSRI 1024"
364 if test x"$silent" != x"yes"; then
365 echo "Setting instruction cache size to 1024 ($sim_icache)"
369 AC_ARG_ENABLE(sim-inline,
370 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
373 no) sim_inline="-DDEFAULT_INLINE=0";;
374 0) sim_inline="-DDEFAULT_INLINE=0";;
375 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
376 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
377 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
380 *_INLINE=*) new_flag="-D$x";;
381 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
382 *_INLINE) new_flag="-D$x=ALL_INLINE";;
383 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
385 if test x"$sim_inline" = x""; then
386 sim_inline="$new_flag"
388 sim_inline="$sim_inline $new_flag"
392 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
393 echo "Setting inline flags = $sim_inline" 6>&1
394 fi],[if test x"$GCC" != ""; then
395 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
396 if test x"$silent" != x"yes"; then
397 echo "Setting inline flags = $sim_inline" 6>&1
404 AC_ARG_ENABLE(sim-jump,
405 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
406 [case "${enableval}" in
409 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
411 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
412 echo "Setting jump flag = $sim_jump" 6>&1
414 if test x"$silent" != x"yes"; then
415 echo "Setting jump flag = $sim_jump" 6>&1
419 AC_ARG_ENABLE(sim-line-nr,
420 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
421 [case "${enableval}" in
422 yes) sim_line_nr="";;
423 no) sim_line_nr="-L";;
424 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
426 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
427 echo "Setting warning flags = $sim_line_nr" 6>&1
428 fi],[sim_line_nr=""])dnl
431 AC_ARG_ENABLE(sim-model,
432 [ --enable-sim-model=which Specify PowerPC to model.],
433 [case "${enableval}" in
434 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
435 *) sim_model="-DWITH_MODEL=${enableval}";;
437 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
438 echo "Setting model flags = $sim_model" 6>&1
439 fi],[sim_model=""])dnl
442 AC_ARG_ENABLE(sim-model-issue,
443 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
444 [case "${enableval}" in
445 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
446 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
447 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
449 if test x"$silent" != x"yes"; then
450 echo "Setting model-issue flags = $sim_model_issue" 6>&1
451 fi],[sim_model_issue=""])dnl
454 AC_ARG_ENABLE(sim-monitor,
455 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
456 [case "${enableval}" in
457 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
458 no) sim_monitor="-DWITH_MON=0";;
459 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
460 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
461 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
463 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
464 echo "Setting monitor flags = $sim_monitor" 6>&1
465 fi],[sim_monitor=""])dnl
468 AC_ARG_ENABLE(sim-opcode,
469 [ --enable-sim-opcode=which Override default opcode lookup.],
470 [case "${enableval}" in
471 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
472 *) if test -f "${srcdir}/${enableval}"; then
473 sim_opcode="${enableval}"
474 elif test -f "${srcdir}/dc-${enableval}"; then
475 sim_opcode="dc-${enableval}"
477 AC_MSG_ERROR("File $enableval is not an opcode rules file");
478 sim_opcode="dc-complex"
481 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
482 echo "Setting opcode flags = $sim_opcode" 6>&1
483 fi],[sim_opcode="dc-complex"
484 if test x"$silent" != x"yes"; then
485 echo "Setting opcode flags = $sim_opcode"
489 AC_ARG_ENABLE(sim-packages,
490 [ --enable-sim-packages=list Specify the packages to be included in the build.],
492 case "${enableval}" in
494 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
495 ,*) packages="${packages}${enableval}";;
496 *,) packages="${enableval}${packages}";;
497 *) packages="${enableval}"'';;
499 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
500 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
501 if test x"$silent" != x"yes" && test x"$packages" != x""; then
502 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
503 fi],[packages=disklabel
504 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
505 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
506 if test x"$silent" != x"yes"; then
507 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
511 AC_ARG_ENABLE(sim-reserved-bits,
512 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
513 [case "${enableval}" in
514 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
515 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
516 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
518 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
519 echo "Setting reserved flags = $sim_reserved" 6>&1
520 fi],[sim_reserved=""])dnl
523 AC_ARG_ENABLE(sim-smp,
524 [ --enable-sim-smp=n Specify number of processors to configure for.],
525 [case "${enableval}" in
526 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
527 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
528 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
530 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
531 echo "Setting smp flags = $sim_smp" 6>&1
532 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
533 if test x"$silent" != x"yes"; then
534 echo "Setting smp flags = $sim_smp" 6>&1
538 AC_MSG_CHECKING([for sim stdio debug behavior])
540 AC_ARG_ENABLE(sim-stdio,
541 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
542 [case "${enableval}" in
543 yes) sim_stdio="DO_USE_STDIO";;
544 no) sim_stdio="DONT_USE_STDIO";;
545 *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-stdio]);;
547 AC_DEFINE_UNQUOTED([WITH_STDIO], [$sim_stdio], [How to route I/O])
548 AC_MSG_RESULT($sim_stdio)
551 AC_ARG_ENABLE(sim-switch,
552 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
553 [case "${enableval}" in
554 yes) sim_switch="-s";;
556 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
558 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
559 echo "Setting switch flags = $sim_switch" 6>&1
561 if test x"$silent" != x"yes"; then
562 echo "Setting switch flags = $sim_switch" 6>&1
566 AC_ARG_ENABLE(sim-timebase,
567 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
568 [case "${enableval}" in
569 yes) sim_timebase="-DWITH_TIME_BASE=1";;
570 no) sim_timebase="-DWITH_TIME_BASE=0";;
571 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
573 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
574 echo "Setting timebase flags = $sim_timebase" 6>&1
575 fi],[sim_timebase=""])dnl
578 AC_MSG_CHECKING([for sim trace settings])
580 AC_ARG_ENABLE(sim-trace,
581 [ --enable-sim-trace Specify whether tracing is supported.],
582 [case "${enableval}" in
585 *) AC_MSG_ERROR([--enable-sim-trace does not take a value]);;
587 AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings])
588 AC_MSG_RESULT($sim_trace)
591 AC_ARG_ENABLE(sim-warnings,
592 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
593 [case "${enableval}" in
594 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
595 no) sim_warnings="-w";;
596 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
598 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
599 echo "Setting warning flags = $sim_warnings" 6>&1
600 fi],[sim_warnings=""])dnl
603 AC_ARG_ENABLE(sim-xor-endian,
604 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
605 [case "${enableval}" in
606 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
607 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
608 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
610 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
611 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
612 fi],[sim_xor_endian=""])dnl
615 ACX_PKGVERSION([GDB])
616 ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
617 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
618 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
623 # BFD conditionally uses zlib, so we must link it in if libbfd does, by
624 # using the same condition.
627 # BFD uses libdl when when plugins enabled.
630 . ${srcdir}/../../bfd/configure.host
634 AC_DEFINE(USE_WIN32API, 1,
635 [Define if we should use the Windows API, instead of the
636 POSIX API. On Windows, we use the Windows API when
637 building for MinGW, but the POSIX API when building
642 AC_CONFIG_HEADER(config.h:config.in)
657 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)
659 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)
662 dnl Figure out what type of termio/termios support there is
664 AC_MSG_CHECKING(for struct termios)
665 AC_CACHE_VAL(ac_cv_termios_struct,
666 [AC_TRY_COMPILE([#include <sys/types.h>
667 #include <sys/termios.h>],
668 [static struct termios x;
674 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
675 AC_MSG_RESULT($ac_cv_termios_struct)
676 if test $ac_cv_termios_struct = yes; then
677 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
680 if test "$ac_cv_termios_struct" = "yes"; then
681 AC_MSG_CHECKING(for c_line field in struct termios)
682 AC_CACHE_VAL(ac_cv_termios_cline,
683 [AC_TRY_COMPILE([#include <sys/types.h>
684 #include <sys/termios.h>],
685 [static struct termios x; x.c_line = 0;],
686 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
688 AC_MSG_RESULT($ac_cv_termios_cline)
689 if test $ac_cv_termios_cline = yes; then
690 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
693 ac_cv_termios_cline=no
696 if test "$ac_cv_termios_struct" != "yes"; then
697 AC_MSG_CHECKING(for struct termio)
698 AC_CACHE_VAL(ac_cv_termio_struct,
699 [AC_TRY_COMPILE([#include <sys/types.h>
700 #include <sys/termio.h>],
701 [static struct termio x;
707 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
708 AC_MSG_RESULT($ac_cv_termio_struct)
709 if test $ac_cv_termio_struct = yes; then
710 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
713 ac_cv_termio_struct=no
716 if test "$ac_cv_termio_struct" = "yes"; then
717 AC_MSG_CHECKING(for c_line field in struct termio)
718 AC_CACHE_VAL(ac_cv_termio_cline,
719 [AC_TRY_COMPILE([#include <sys/types.h>
720 #include <sys/termio.h>],
721 [static struct termio x; x.c_line = 0;],
722 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
724 AC_MSG_RESULT($ac_cv_termio_cline)
725 if test $ac_cv_termio_cline = yes; then
726 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
729 ac_cv_termio_cline=no
732 dnl Check for struct statfs
733 AC_MSG_CHECKING(for struct statfs)
734 AC_CACHE_VAL(ac_cv_struct_statfs,
735 [AC_TRY_COMPILE([#include <sys/types.h>
736 #ifdef HAVE_SYS_PARAM_H
737 #include <sys/param.h>
739 #ifdef HAVE_SYS_MOUNT_H
740 #include <sys/mount.h>
742 #ifdef HAVE_SYS_VFS_H
745 #ifdef HAVE_SYS_STATFS_H
746 #include <sys/statfs.h>
748 [static struct statfs s;],
749 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
750 AC_MSG_RESULT($ac_cv_struct_statfs)
751 if test $ac_cv_struct_statfs = yes; then
752 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
753 [Define if struct statfs is defined in <sys/mount.h>])
756 AC_CHECK_TYPES(long long)
758 dnl Figure out if /dev/zero exists or not
760 AC_MSG_CHECKING(for /dev/zero)
761 AC_CACHE_VAL(ac_cv_devzero,
762 [AC_TRY_RUN([#include <fcntl.h>
766 int fd = open ("/dev/zero", O_RDONLY);
769 for (i = 0; i < sizeof (buf); i++)
771 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
773 for (i = 0; i < sizeof (buf); i++)
777 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
778 AC_MSG_RESULT($ac_cv_devzero)
779 if test $ac_cv_devzero = yes; then
780 sim_devzero="-DHAVE_DEVZERO"
785 dnl Figure out if we are in the new Cygnus tree with a common directory or not
786 AC_MSG_CHECKING(for common simulator directory)
787 if test -f "${srcdir}/../common/callback.c"; then
789 sim_callback="callback.o targ-map.o"
790 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
797 AC_MSG_CHECKING(for common simulator directory fpu implementation)
798 if test -f "${srcdir}/../common/sim-fpu.c"; then
800 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
808 # Since we run commands on the build system, we have to create a
809 # separate config header for the build system if build != host.
810 if test x$host = x$build; then
811 AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h])
818 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
819 *) realsrcdir=../${srcdir};;
821 saved_CFLAGS="${CFLAGS}"
822 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
823 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
824 ${realsrcdir}/configure \
825 --enable-languages=${enable_languages-all} \
826 --target=$target_alias --host=$build_alias --build=$build_alias
827 CFLAGS="${saved_CFLAGS}"
828 mv config.h ../build-config.h
833 dnl Check for exe extension
836 AC_SUBST(CC_FOR_BUILD)
837 AC_SUBST(CFLAGS_FOR_BUILD)
843 AC_SUBST(sim_warnings)
844 AC_SUBST(sim_line_nr)
849 AC_SUBST(sim_decode_mechanism)
859 AC_SUBST(sim_xor_endian)
860 AC_SUBST(sim_hostendian)
862 AC_SUBST(sim_igen_smp)
863 AC_SUBST(sim_bitsize)
864 AC_SUBST(sim_hostbitsize)
865 AC_SUBST(sim_timebase)
866 AC_SUBST(sim_alignment)
868 AC_SUBST(sim_reserved)
869 AC_SUBST(sim_monitor)
871 AC_SUBST(sim_default_model)
872 AC_SUBST(sim_model_issue)
874 AC_SUBST(sim_devzero)
875 AC_SUBST(sim_callback)
876 AC_SUBST(sim_targ_vals)
877 AC_SUBST(sim_fpu_cflags)
881 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])