1 dnl Process this file with autoconf to produce a configure script.
3 sinclude(../common/acinclude.m4)
8 # Put a plausible default for CC_FOR_BUILD in Makefile.
9 if test "x$cross_compiling" = "xno"; then
14 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
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.
19 ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
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_MSG_CHECKING([whether to enable sim asserts])
37 AC_ARG_ENABLE(sim-assert,
38 [ --enable-sim-assert Specify whether to perform random assertions.],
39 [case "${enableval}" in
42 *) AC_MSG_ERROR([--enable-sim-assert does not take a value]);;
44 AC_DEFINE_UNQUOTED([WITH_ASSERT], [$sim_assert], [Sim assert settings])
45 AC_MSG_RESULT($sim_assert)
48 AC_ARG_ENABLE(sim-bitsize,
49 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
50 [case "${enableval}" in
51 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
52 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
54 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
55 echo "Setting bitsize flags = $sim_bitsize" 6>&1
56 fi],[sim_bitsize=""])dnl
59 AC_ARG_ENABLE(sim-config,
60 [ --enable-sim-config=file Override default config file],
61 [case "${enableval}" in
62 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
63 *) if test -f "${srcdir}/${enableval}"; then
64 sim_config="${enableval}";
65 elif test -f "${srcdir}/${enableval}-config.h"; then
66 sim_config="${enableval}-config.h"
68 AC_MSG_ERROR("Config file $enableval was not found");
69 sim_config=std-config.h
72 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
73 echo "Setting config flags = $sim_config" 6>&1
74 fi],[sim_config="std-config.h"
75 if test x"$silent" != x"yes"; then
76 echo "Setting config flags = $sim_config" 6>&1
80 AC_ARG_ENABLE(sim-decode-mechanism,
81 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
82 [case "${enableval}" in
83 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
84 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
85 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
86 sim_decode_mechanism="switch";;
88 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
89 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
90 fi],[sim_decode_mechanism=""
91 if test x"$silent" != x"yes"; then
92 echo "Setting decode mechanism flags = $sim_decode_mechanism"
96 AC_ARG_ENABLE(sim-default-model,
97 [ --enable-sim-default-model=which Specify default PowerPC to model.],
98 [case "${enableval}" in
99 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
100 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
102 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
103 echo "Setting default-model flags = $sim_default_model" 6>&1
104 fi],[sim_default_model=""])dnl
107 AC_ARG_ENABLE(sim-duplicate,
108 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
109 [case "${enableval}" in
112 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
114 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
115 echo "Setting duplicate flags = $sim_dup" 6>&1
117 if test x"$silent" != x"yes"; then
118 echo "Setting duplicate flags = $sim_dup" 6>&1
122 AC_ARG_ENABLE(sim-endian,
123 [ --enable-sim-endian=endian Specify target byte endian orientation.],
124 [case "${enableval}" in
125 yes) case "$target" in
126 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
127 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
128 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
130 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
131 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
132 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
133 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
135 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
136 echo "Setting endian flags = $sim_endian" 6>&1
137 fi],[sim_endian=""])dnl
140 AC_MSG_CHECKING([default sim environment setting])
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="OPERATING_ENVIRONMENT";;
146 virtual | vea) sim_env="VIRTUAL_ENVIRONMENT";;
147 user | uea) sim_env="USER_ENVIRONMENT";;
149 *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-env]);;
151 AC_DEFINE_UNQUOTED([WITH_ENVIRONMENT], [$sim_env], [Sim default environment])
152 AC_MSG_RESULT($sim_env)
155 AC_ARG_ENABLE(sim-filter,
156 [ --enable-sim-filter=rule Specify filter rules.],
157 [case "${enableval}" in
158 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
160 *) sim_filter="-F $enableval";;
162 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
163 echo "Setting filter flags = $sim_filter" 6>&1
164 fi],[sim_filter="-F 32,f,o"
165 if test x"$silent" != x"yes"; then
166 echo "Setting filter flags = $sim_filter" 6>&1
170 AC_ARG_ENABLE(sim-float,
171 [ --enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.],
172 [case "${enableval}" in
173 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
174 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
175 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
176 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
177 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
179 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
180 echo "Setting float flags = $sim_float" 6>&1
183 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
184 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
189 AC_CACHE_CHECK([if union semun defined],
190 ac_cv_HAS_UNION_SEMUN,
192 #include <sys/types.h>
194 #include <sys/sem.h>],
196 [ac_cv_has_union_semun="yes"],
197 [ac_cv_has_union_semun="no"])
198 AC_MSG_RESULT($ac_cv_has_union_semun)
202 if test "$ac_cv_has_union_semun" = "yes"; then
203 AC_CACHE_CHECK(whether System V semaphores are supported,
208 #include <sys/types.h>
214 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
217 arg.val = 0; /* avoid implicit type cast to union */
218 if (semctl(id, 0, IPC_RMID, arg) == -1)
223 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
225 else # semun is not defined
226 AC_CACHE_CHECK(whether System V semaphores are supported,
231 #include <sys/types.h>
236 struct semid_ds *buf;
242 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
245 arg.val = 0; /* avoid implicit type cast to union */
246 if (semctl(id, 0, IPC_RMID, arg) == -1)
251 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
255 AC_CACHE_CHECK(whether System V shared memory is supported,
259 #include <sys/types.h>
263 int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
266 if (shmctl(id, IPC_RMID, 0) == -1)
271 ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
274 if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
275 sim_sysv_ipc_hw=",sem,shm";
280 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
281 AC_DEFINE(HAVE_UNION_SEMUN, 1,
282 [Define if union semun is defined in <sys/sem.h>])
286 AC_ARG_ENABLE(sim-hardware,
287 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
288 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
289 case "${enableval}" in
291 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
292 ,*) hardware="${hardware}${enableval}";;
293 *,) hardware="${enableval}${hardware}";;
294 *) hardware="${enableval}"'';;
296 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
297 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
298 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
299 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
300 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
301 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
302 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
303 if test x"$silent" != x"yes"; then
304 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
307 AC_ARG_ENABLE(sim-hostbitsize,
308 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
309 [case "${enableval}" in
310 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
311 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
313 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
314 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
315 fi],[sim_hostbitsize=""])dnl
318 AC_ARG_ENABLE(sim-hostendian,
319 [ --enable-sim-hostendian=end Specify host byte endian orientation.],
320 [case "${enableval}" in
321 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
322 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
323 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
324 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
326 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
327 echo "Setting hostendian flags = $sim_hostendian" 6>&1
329 if test "x$cross_compiling" = "xno"; then
331 if test $ac_cv_c_bigendian = yes; then
332 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
334 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
337 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
341 AC_ARG_ENABLE(sim-icache,
342 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
344 case "${enableval}" in
345 yes) icache="1024"; sim_icache="-I $icache";;
346 no) sim_icache="-R";;
349 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
351 define) sim_icache="${sim_icache}R";;
352 semantic) sim_icache="${sim_icache}C";;
353 insn) sim_icache="${sim_icache}S";;
354 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
355 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
358 sim_icache="${sim_icache}I $icache";;
360 if test x"$silent" != x"yes" && test x"$icache" != x""; then
361 echo "Setting instruction cache size to $icache ($sim_icache)"
362 fi],[sim_icache="-CSRI 1024"
363 if test x"$silent" != x"yes"; then
364 echo "Setting instruction cache size to 1024 ($sim_icache)"
368 AC_ARG_ENABLE(sim-inline,
369 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
372 no) sim_inline="-DDEFAULT_INLINE=0";;
373 0) sim_inline="-DDEFAULT_INLINE=0";;
374 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
375 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
376 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
379 *_INLINE=*) new_flag="-D$x";;
380 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
381 *_INLINE) new_flag="-D$x=ALL_INLINE";;
382 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
384 if test x"$sim_inline" = x""; then
385 sim_inline="$new_flag"
387 sim_inline="$sim_inline $new_flag"
391 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
392 echo "Setting inline flags = $sim_inline" 6>&1
393 fi],[if test x"$GCC" != ""; then
394 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
395 if test x"$silent" != x"yes"; then
396 echo "Setting inline flags = $sim_inline" 6>&1
403 AC_ARG_ENABLE(sim-jump,
404 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
405 [case "${enableval}" in
408 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
410 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
411 echo "Setting jump flag = $sim_jump" 6>&1
413 if test x"$silent" != x"yes"; then
414 echo "Setting jump flag = $sim_jump" 6>&1
418 AC_ARG_ENABLE(sim-line-nr,
419 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
420 [case "${enableval}" in
421 yes) sim_line_nr="";;
422 no) sim_line_nr="-L";;
423 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
425 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
426 echo "Setting warning flags = $sim_line_nr" 6>&1
427 fi],[sim_line_nr=""])dnl
430 AC_ARG_ENABLE(sim-model,
431 [ --enable-sim-model=which Specify PowerPC to model.],
432 [case "${enableval}" in
433 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
434 *) sim_model="-DWITH_MODEL=${enableval}";;
436 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
437 echo "Setting model flags = $sim_model" 6>&1
438 fi],[sim_model=""])dnl
441 AC_ARG_ENABLE(sim-model-issue,
442 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
443 [case "${enableval}" in
444 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
445 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
446 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
448 if test x"$silent" != x"yes"; then
449 echo "Setting model-issue flags = $sim_model_issue" 6>&1
450 fi],[sim_model_issue=""])dnl
453 AC_ARG_ENABLE(sim-monitor,
454 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
455 [case "${enableval}" in
456 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
457 no) sim_monitor="-DWITH_MON=0";;
458 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
459 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
460 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
462 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
463 echo "Setting monitor flags = $sim_monitor" 6>&1
464 fi],[sim_monitor=""])dnl
467 AC_ARG_ENABLE(sim-opcode,
468 [ --enable-sim-opcode=which Override default opcode lookup.],
469 [case "${enableval}" in
470 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
471 *) if test -f "${srcdir}/${enableval}"; then
472 sim_opcode="${enableval}"
473 elif test -f "${srcdir}/dc-${enableval}"; then
474 sim_opcode="dc-${enableval}"
476 AC_MSG_ERROR("File $enableval is not an opcode rules file");
477 sim_opcode="dc-complex"
480 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
481 echo "Setting opcode flags = $sim_opcode" 6>&1
482 fi],[sim_opcode="dc-complex"
483 if test x"$silent" != x"yes"; then
484 echo "Setting opcode flags = $sim_opcode"
488 AC_ARG_ENABLE(sim-packages,
489 [ --enable-sim-packages=list Specify the packages to be included in the build.],
491 case "${enableval}" in
493 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
494 ,*) packages="${packages}${enableval}";;
495 *,) packages="${enableval}${packages}";;
496 *) packages="${enableval}"'';;
498 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
499 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
500 if test x"$silent" != x"yes" && test x"$packages" != x""; then
501 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
502 fi],[packages=disklabel
503 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
504 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
505 if test x"$silent" != x"yes"; then
506 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
510 AC_ARG_ENABLE(sim-reserved-bits,
511 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
512 [case "${enableval}" in
513 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
514 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
515 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
517 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
518 echo "Setting reserved flags = $sim_reserved" 6>&1
519 fi],[sim_reserved=""])dnl
522 AC_ARG_ENABLE(sim-smp,
523 [ --enable-sim-smp=n Specify number of processors to configure for.],
524 [case "${enableval}" in
525 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
526 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
527 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
529 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
530 echo "Setting smp flags = $sim_smp" 6>&1
531 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
532 if test x"$silent" != x"yes"; then
533 echo "Setting smp flags = $sim_smp" 6>&1
537 AC_MSG_CHECKING([for sim stdio debug behavior])
539 AC_ARG_ENABLE(sim-stdio,
540 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
541 [case "${enableval}" in
542 yes) sim_stdio="DO_USE_STDIO";;
543 no) sim_stdio="DONT_USE_STDIO";;
544 *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-stdio]);;
546 AC_DEFINE_UNQUOTED([WITH_STDIO], [$sim_stdio], [How to route I/O])
547 AC_MSG_RESULT($sim_stdio)
550 AC_ARG_ENABLE(sim-switch,
551 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
552 [case "${enableval}" in
553 yes) sim_switch="-s";;
555 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
557 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
558 echo "Setting switch flags = $sim_switch" 6>&1
560 if test x"$silent" != x"yes"; then
561 echo "Setting switch flags = $sim_switch" 6>&1
565 AC_ARG_ENABLE(sim-timebase,
566 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
567 [case "${enableval}" in
568 yes) sim_timebase="-DWITH_TIME_BASE=1";;
569 no) sim_timebase="-DWITH_TIME_BASE=0";;
570 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
572 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
573 echo "Setting timebase flags = $sim_timebase" 6>&1
574 fi],[sim_timebase=""])dnl
577 AC_MSG_CHECKING([for sim trace settings])
579 AC_ARG_ENABLE(sim-trace,
580 [ --enable-sim-trace Specify whether tracing is supported.],
581 [case "${enableval}" in
584 *) AC_MSG_ERROR([--enable-sim-trace does not take a value]);;
586 AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings])
587 AC_MSG_RESULT($sim_trace)
590 AC_ARG_ENABLE(sim-warnings,
591 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
592 [case "${enableval}" in
593 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
594 no) sim_warnings="-w";;
595 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
597 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
598 echo "Setting warning flags = $sim_warnings" 6>&1
599 fi],[sim_warnings=""])dnl
602 AC_ARG_ENABLE(sim-xor-endian,
603 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
604 [case "${enableval}" in
605 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
606 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
607 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
609 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
610 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
611 fi],[sim_xor_endian=""])dnl
614 ACX_PKGVERSION([GDB])
615 ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
616 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
617 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
622 # BFD conditionally uses zlib, so we must link it in if libbfd does, by
623 # using the same condition.
626 # BFD uses libdl when when plugins enabled.
629 . ${srcdir}/../../bfd/configure.host
633 AC_DEFINE(USE_WIN32API, 1,
634 [Define if we should use the Windows API, instead of the
635 POSIX API. On Windows, we use the Windows API when
636 building for MinGW, but the POSIX API when building
641 AC_CONFIG_HEADER(config.h:config.in)
656 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)
658 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)
661 dnl Figure out what type of termio/termios support there is
663 AC_MSG_CHECKING(for struct termios)
664 AC_CACHE_VAL(ac_cv_termios_struct,
665 [AC_TRY_COMPILE([#include <sys/types.h>
666 #include <sys/termios.h>],
667 [static struct termios x;
673 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
674 AC_MSG_RESULT($ac_cv_termios_struct)
675 if test $ac_cv_termios_struct = yes; then
676 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
679 if test "$ac_cv_termios_struct" = "yes"; then
680 AC_MSG_CHECKING(for c_line field in struct termios)
681 AC_CACHE_VAL(ac_cv_termios_cline,
682 [AC_TRY_COMPILE([#include <sys/types.h>
683 #include <sys/termios.h>],
684 [static struct termios x; x.c_line = 0;],
685 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
687 AC_MSG_RESULT($ac_cv_termios_cline)
688 if test $ac_cv_termios_cline = yes; then
689 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
692 ac_cv_termios_cline=no
695 if test "$ac_cv_termios_struct" != "yes"; then
696 AC_MSG_CHECKING(for struct termio)
697 AC_CACHE_VAL(ac_cv_termio_struct,
698 [AC_TRY_COMPILE([#include <sys/types.h>
699 #include <sys/termio.h>],
700 [static struct termio x;
706 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
707 AC_MSG_RESULT($ac_cv_termio_struct)
708 if test $ac_cv_termio_struct = yes; then
709 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
712 ac_cv_termio_struct=no
715 if test "$ac_cv_termio_struct" = "yes"; then
716 AC_MSG_CHECKING(for c_line field in struct termio)
717 AC_CACHE_VAL(ac_cv_termio_cline,
718 [AC_TRY_COMPILE([#include <sys/types.h>
719 #include <sys/termio.h>],
720 [static struct termio x; x.c_line = 0;],
721 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
723 AC_MSG_RESULT($ac_cv_termio_cline)
724 if test $ac_cv_termio_cline = yes; then
725 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
728 ac_cv_termio_cline=no
731 dnl Check for struct statfs
732 AC_MSG_CHECKING(for struct statfs)
733 AC_CACHE_VAL(ac_cv_struct_statfs,
734 [AC_TRY_COMPILE([#include <sys/types.h>
735 #ifdef HAVE_SYS_PARAM_H
736 #include <sys/param.h>
738 #ifdef HAVE_SYS_MOUNT_H
739 #include <sys/mount.h>
741 #ifdef HAVE_SYS_VFS_H
744 #ifdef HAVE_SYS_STATFS_H
745 #include <sys/statfs.h>
747 [static struct statfs s;],
748 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
749 AC_MSG_RESULT($ac_cv_struct_statfs)
750 if test $ac_cv_struct_statfs = yes; then
751 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
752 [Define if struct statfs is defined in <sys/mount.h>])
755 AC_CHECK_TYPES(long long)
757 dnl Figure out if /dev/zero exists or not
759 AC_MSG_CHECKING(for /dev/zero)
760 AC_CACHE_VAL(ac_cv_devzero,
761 [AC_TRY_RUN([#include <fcntl.h>
765 int fd = open ("/dev/zero", O_RDONLY);
768 for (i = 0; i < sizeof (buf); i++)
770 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
772 for (i = 0; i < sizeof (buf); i++)
776 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
777 AC_MSG_RESULT($ac_cv_devzero)
778 if test $ac_cv_devzero = yes; then
779 sim_devzero="-DHAVE_DEVZERO"
784 dnl Figure out if we are in the new Cygnus tree with a common directory or not
785 AC_MSG_CHECKING(for common simulator directory)
786 if test -f "${srcdir}/../common/callback.c"; then
788 sim_callback="callback.o targ-map.o"
789 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
796 AC_MSG_CHECKING(for common simulator directory fpu implementation)
797 if test -f "${srcdir}/../common/sim-fpu.c"; then
799 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
807 # Since we run commands on the build system, we have to create a
808 # separate config header for the build system if build != host.
809 if test x$host = x$build; then
810 AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h])
817 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
818 *) realsrcdir=../${srcdir};;
820 saved_CFLAGS="${CFLAGS}"
821 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
822 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
823 ${realsrcdir}/configure \
824 --enable-languages=${enable_languages-all} \
825 --target=$target_alias --host=$build_alias --build=$build_alias
826 CFLAGS="${saved_CFLAGS}"
827 mv config.h ../build-config.h
832 dnl Check for exe extension
835 AC_SUBST(CC_FOR_BUILD)
836 AC_SUBST(CFLAGS_FOR_BUILD)
842 AC_SUBST(sim_warnings)
843 AC_SUBST(sim_line_nr)
848 AC_SUBST(sim_decode_mechanism)
858 AC_SUBST(sim_xor_endian)
859 AC_SUBST(sim_hostendian)
861 AC_SUBST(sim_igen_smp)
862 AC_SUBST(sim_bitsize)
863 AC_SUBST(sim_hostbitsize)
864 AC_SUBST(sim_timebase)
865 AC_SUBST(sim_alignment)
867 AC_SUBST(sim_reserved)
868 AC_SUBST(sim_monitor)
870 AC_SUBST(sim_default_model)
871 AC_SUBST(sim_model_issue)
873 AC_SUBST(sim_devzero)
874 AC_SUBST(sim_callback)
875 AC_SUBST(sim_targ_vals)
876 AC_SUBST(sim_fpu_cflags)
880 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])