1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_MACRO_DIRS([../.. ../../config])
8 dnl We don't use gettext, but bfd does. So we do the appropriate checks
9 dnl to see if there are intl libraries we should link against.
11 ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
14 AC_ARG_ENABLE(sim-bitsize,
15 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
16 [case "${enableval}" in
17 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
18 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
20 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
21 echo "Setting bitsize flags = $sim_bitsize" 6>&1
22 fi],[sim_bitsize=""])dnl
25 AC_ARG_ENABLE(sim-config,
26 [ --enable-sim-config=file Override default config file],
27 [case "${enableval}" in
28 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
29 *) if test -f "${srcdir}/${enableval}"; then
30 sim_config="${enableval}";
31 elif test -f "${srcdir}/${enableval}-config.h"; then
32 sim_config="${enableval}-config.h"
34 AC_MSG_ERROR("Config file $enableval was not found");
35 sim_config=std-config.h
38 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
39 echo "Setting config flags = $sim_config" 6>&1
40 fi],[sim_config="std-config.h"
41 if test x"$silent" != x"yes"; then
42 echo "Setting config flags = $sim_config" 6>&1
46 AC_ARG_ENABLE(sim-decode-mechanism,
47 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
48 [case "${enableval}" in
49 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
50 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
51 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
52 sim_decode_mechanism="switch";;
54 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
55 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
56 fi],[sim_decode_mechanism=""
57 if test x"$silent" != x"yes"; then
58 echo "Setting decode mechanism flags = $sim_decode_mechanism"
62 AC_ARG_ENABLE(sim-default-model,
63 [ --enable-sim-default-model=which Specify default PowerPC to model.],
64 [case "${enableval}" in
65 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
66 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
68 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
69 echo "Setting default-model flags = $sim_default_model" 6>&1
70 fi],[sim_default_model=""])dnl
73 AC_ARG_ENABLE(sim-duplicate,
74 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
75 [case "${enableval}" in
78 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
80 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
81 echo "Setting duplicate flags = $sim_dup" 6>&1
83 if test x"$silent" != x"yes"; then
84 echo "Setting duplicate flags = $sim_dup" 6>&1
88 AC_ARG_ENABLE(sim-filter,
89 [ --enable-sim-filter=rule Specify filter rules.],
90 [case "${enableval}" in
91 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
93 *) sim_filter="-F $enableval";;
95 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
96 echo "Setting filter flags = $sim_filter" 6>&1
97 fi],[sim_filter="-F 32,f,o"
98 if test x"$silent" != x"yes"; then
99 echo "Setting filter flags = $sim_filter" 6>&1
103 AC_ARG_ENABLE(sim-float,
104 [ --enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.],
105 [case "${enableval}" in
106 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
107 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
108 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
109 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
110 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
112 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
113 echo "Setting float flags = $sim_float" 6>&1
116 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
117 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
122 AC_CACHE_CHECK([if union semun defined],
123 ac_cv_HAS_UNION_SEMUN,
125 #include <sys/types.h>
127 #include <sys/sem.h>],
129 [ac_cv_has_union_semun="yes"],
130 [ac_cv_has_union_semun="no"])
131 AC_MSG_RESULT($ac_cv_has_union_semun)
135 if test "$ac_cv_has_union_semun" = "yes"; then
136 AC_CACHE_CHECK(whether System V semaphores are supported,
141 #include <sys/types.h>
147 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
150 arg.val = 0; /* avoid implicit type cast to union */
151 if (semctl(id, 0, IPC_RMID, arg) == -1)
156 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
158 else # semun is not defined
159 AC_CACHE_CHECK(whether System V semaphores are supported,
164 #include <sys/types.h>
169 struct semid_ds *buf;
175 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
178 arg.val = 0; /* avoid implicit type cast to union */
179 if (semctl(id, 0, IPC_RMID, arg) == -1)
184 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
188 AC_CACHE_CHECK(whether System V shared memory is supported,
192 #include <sys/types.h>
196 int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
199 if (shmctl(id, IPC_RMID, 0) == -1)
204 ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
207 if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
208 sim_sysv_ipc_hw=",sem,shm";
213 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
214 AC_DEFINE(HAVE_UNION_SEMUN, 1,
215 [Define if union semun is defined in <sys/sem.h>])
219 AC_ARG_ENABLE(sim-hardware,
220 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
221 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
222 case "${enableval}" in
224 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
225 ,*) hardware="${hardware}${enableval}";;
226 *,) hardware="${enableval}${hardware}";;
227 *) hardware="${enableval}"'';;
229 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
230 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
231 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
232 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
233 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
234 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
235 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
236 if test x"$silent" != x"yes"; then
237 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
240 AC_ARG_ENABLE(sim-hostbitsize,
241 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
242 [case "${enableval}" in
243 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
244 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
246 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
247 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
248 fi],[sim_hostbitsize=""])dnl
251 AC_ARG_ENABLE(sim-icache,
252 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
254 case "${enableval}" in
255 yes) icache="1024"; sim_icache="-I $icache";;
256 no) sim_icache="-R";;
259 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
261 define) sim_icache="${sim_icache}R";;
262 semantic) sim_icache="${sim_icache}C";;
263 insn) sim_icache="${sim_icache}S";;
264 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
265 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
268 sim_icache="${sim_icache}I $icache";;
270 if test x"$silent" != x"yes" && test x"$icache" != x""; then
271 echo "Setting instruction cache size to $icache ($sim_icache)"
272 fi],[sim_icache="-CSRI 1024"
273 if test x"$silent" != x"yes"; then
274 echo "Setting instruction cache size to 1024 ($sim_icache)"
278 AC_ARG_ENABLE(sim-inline,
279 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
282 no) sim_inline="-DDEFAULT_INLINE=0";;
283 0) sim_inline="-DDEFAULT_INLINE=0";;
284 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
285 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
286 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
289 *_INLINE=*) new_flag="-D$x";;
290 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
291 *_INLINE) new_flag="-D$x=ALL_INLINE";;
292 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
294 if test x"$sim_inline" = x""; then
295 sim_inline="$new_flag"
297 sim_inline="$sim_inline $new_flag"
301 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
302 echo "Setting inline flags = $sim_inline" 6>&1
303 fi],[if test x"$GCC" != ""; then
304 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
305 if test x"$silent" != x"yes"; then
306 echo "Setting inline flags = $sim_inline" 6>&1
313 AC_ARG_ENABLE(sim-jump,
314 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
315 [case "${enableval}" in
318 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
320 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
321 echo "Setting jump flag = $sim_jump" 6>&1
323 if test x"$silent" != x"yes"; then
324 echo "Setting jump flag = $sim_jump" 6>&1
328 AC_ARG_ENABLE(sim-line-nr,
329 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
330 [case "${enableval}" in
331 yes) sim_line_nr="";;
332 no) sim_line_nr="-L";;
333 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
335 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
336 echo "Setting warning flags = $sim_line_nr" 6>&1
337 fi],[sim_line_nr=""])dnl
340 AC_ARG_ENABLE(sim-model,
341 [ --enable-sim-model=which Specify PowerPC to model.],
342 [case "${enableval}" in
343 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
344 *) sim_model="-DWITH_MODEL=${enableval}";;
346 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
347 echo "Setting model flags = $sim_model" 6>&1
348 fi],[sim_model=""])dnl
351 AC_ARG_ENABLE(sim-model-issue,
352 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
353 [case "${enableval}" in
354 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
355 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
356 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
358 if test x"$silent" != x"yes"; then
359 echo "Setting model-issue flags = $sim_model_issue" 6>&1
360 fi],[sim_model_issue=""])dnl
363 AC_ARG_ENABLE(sim-monitor,
364 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
365 [case "${enableval}" in
366 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
367 no) sim_monitor="-DWITH_MON=0";;
368 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
369 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
370 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon");;
372 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
373 echo "Setting monitor flags = $sim_monitor" 6>&1
374 fi],[sim_monitor=""])dnl
377 AC_ARG_ENABLE(sim-opcode,
378 [ --enable-sim-opcode=which Override default opcode lookup.],
379 [case "${enableval}" in
380 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
381 *) if test -f "${srcdir}/${enableval}"; then
382 sim_opcode="${enableval}"
383 elif test -f "${srcdir}/dc-${enableval}"; then
384 sim_opcode="dc-${enableval}"
386 AC_MSG_ERROR("File $enableval is not an opcode rules file");
387 sim_opcode="dc-complex"
390 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
391 echo "Setting opcode flags = $sim_opcode" 6>&1
392 fi],[sim_opcode="dc-complex"
393 if test x"$silent" != x"yes"; then
394 echo "Setting opcode flags = $sim_opcode"
398 AC_ARG_ENABLE(sim-packages,
399 [ --enable-sim-packages=list Specify the packages to be included in the build.],
401 case "${enableval}" in
403 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
404 ,*) packages="${packages}${enableval}";;
405 *,) packages="${enableval}${packages}";;
406 *) packages="${enableval}"'';;
408 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
409 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
410 if test x"$silent" != x"yes" && test x"$packages" != x""; then
411 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
412 fi],[packages=disklabel
413 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
414 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
415 if test x"$silent" != x"yes"; then
416 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
420 AC_ARG_ENABLE(sim-reserved-bits,
421 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
422 [case "${enableval}" in
423 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
424 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
425 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
427 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
428 echo "Setting reserved flags = $sim_reserved" 6>&1
429 fi],[sim_reserved=""])dnl
432 AC_ARG_ENABLE(sim-smp,
433 [ --enable-sim-smp=n Specify number of processors to configure for.],
434 [case "${enableval}" in
435 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
436 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
437 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
439 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
440 echo "Setting smp flags = $sim_smp" 6>&1
441 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
442 if test x"$silent" != x"yes"; then
443 echo "Setting smp flags = $sim_smp" 6>&1
447 AC_ARG_ENABLE(sim-switch,
448 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
449 [case "${enableval}" in
450 yes) sim_switch="-s";;
452 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
454 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
455 echo "Setting switch flags = $sim_switch" 6>&1
457 if test x"$silent" != x"yes"; then
458 echo "Setting switch flags = $sim_switch" 6>&1
462 AC_ARG_ENABLE(sim-timebase,
463 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
464 [case "${enableval}" in
465 yes) sim_timebase="-DWITH_TIME_BASE=1";;
466 no) sim_timebase="-DWITH_TIME_BASE=0";;
467 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
469 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
470 echo "Setting timebase flags = $sim_timebase" 6>&1
471 fi],[sim_timebase=""])dnl
474 AC_ARG_ENABLE(sim-warnings,
475 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
476 [case "${enableval}" in
477 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
478 no) sim_warnings="-w";;
479 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
481 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
482 echo "Setting warning flags = $sim_warnings" 6>&1
483 fi],[sim_warnings=""])dnl
486 AC_ARG_ENABLE(sim-xor-endian,
487 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
488 [case "${enableval}" in
489 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
490 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
491 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
493 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
494 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
495 fi],[sim_xor_endian=""])dnl
500 AC_DEFINE(USE_WIN32API, 1,
501 [Define if we should use the Windows API, instead of the
502 POSIX API. On Windows, we use the Windows API when
503 building for MinGW, but the POSIX API when building
508 AC_CONFIG_HEADER(config.h:config.in)
511 dnl Figure out what type of termio/termios support there is
513 AC_MSG_CHECKING(for struct termios)
514 AC_CACHE_VAL(ac_cv_termios_struct,
515 [AC_TRY_COMPILE([#include <sys/types.h>
516 #include <sys/termios.h>],
517 [static struct termios x;
523 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
524 AC_MSG_RESULT($ac_cv_termios_struct)
525 if test $ac_cv_termios_struct = yes; then
526 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
529 if test "$ac_cv_termios_struct" = "yes"; then
530 AC_MSG_CHECKING(for c_line field in struct termios)
531 AC_CACHE_VAL(ac_cv_termios_cline,
532 [AC_TRY_COMPILE([#include <sys/types.h>
533 #include <sys/termios.h>],
534 [static struct termios x; x.c_line = 0;],
535 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
537 AC_MSG_RESULT($ac_cv_termios_cline)
538 if test $ac_cv_termios_cline = yes; then
539 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
542 ac_cv_termios_cline=no
545 if test "$ac_cv_termios_struct" != "yes"; then
546 AC_MSG_CHECKING(for struct termio)
547 AC_CACHE_VAL(ac_cv_termio_struct,
548 [AC_TRY_COMPILE([#include <sys/types.h>
549 #include <sys/termio.h>],
550 [static struct termio x;
556 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
557 AC_MSG_RESULT($ac_cv_termio_struct)
558 if test $ac_cv_termio_struct = yes; then
559 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
562 ac_cv_termio_struct=no
565 if test "$ac_cv_termio_struct" = "yes"; then
566 AC_MSG_CHECKING(for c_line field in struct termio)
567 AC_CACHE_VAL(ac_cv_termio_cline,
568 [AC_TRY_COMPILE([#include <sys/types.h>
569 #include <sys/termio.h>],
570 [static struct termio x; x.c_line = 0;],
571 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
573 AC_MSG_RESULT($ac_cv_termio_cline)
574 if test $ac_cv_termio_cline = yes; then
575 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
578 ac_cv_termio_cline=no
581 dnl Check for struct statfs
582 AC_MSG_CHECKING(for struct statfs)
583 AC_CACHE_VAL(ac_cv_struct_statfs,
584 [AC_TRY_COMPILE([#include <sys/types.h>
585 #ifdef HAVE_SYS_PARAM_H
586 #include <sys/param.h>
588 #ifdef HAVE_SYS_MOUNT_H
589 #include <sys/mount.h>
591 #ifdef HAVE_SYS_VFS_H
594 #ifdef HAVE_SYS_STATFS_H
595 #include <sys/statfs.h>
597 [static struct statfs s;],
598 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
599 AC_MSG_RESULT($ac_cv_struct_statfs)
600 if test $ac_cv_struct_statfs = yes; then
601 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
602 [Define if struct statfs is defined in <sys/mount.h>])
605 AC_CHECK_TYPES(long long)
607 dnl Figure out if /dev/zero exists or not
609 AC_MSG_CHECKING(for /dev/zero)
610 AC_CACHE_VAL(ac_cv_devzero,
611 [AC_TRY_RUN([#include <fcntl.h>
615 int fd = open ("/dev/zero", O_RDONLY);
618 for (i = 0; i < sizeof (buf); i++)
620 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
622 for (i = 0; i < sizeof (buf); i++)
626 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
627 AC_MSG_RESULT($ac_cv_devzero)
628 if test $ac_cv_devzero = yes; then
629 sim_devzero="-DHAVE_DEVZERO"
634 dnl Figure out if we are in the new Cygnus tree with a common directory or not
635 AC_MSG_CHECKING(for common simulator directory)
636 if test -f "${srcdir}/../common/callback.c"; then
638 sim_callback="callback.o targ-map.o"
639 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
646 AC_MSG_CHECKING(for common simulator directory fpu implementation)
647 if test -f "${srcdir}/../common/sim-fpu.c"; then
649 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
657 # Since we run commands on the build system, we have to create a
658 # separate config header for the build system if build != host.
659 if test x$host = x$build; then
660 AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h])
667 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
668 *) realsrcdir=../${srcdir};;
670 saved_CFLAGS="${CFLAGS}"
671 # Put a plausible default for CC_FOR_BUILD in Makefile.
672 if test "x$cross_compiling" = "xno"; then
677 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD-${CFLAGS}}" \
678 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
679 ${realsrcdir}/configure \
680 --enable-languages=${enable_languages-all} \
681 --target=$target_alias --host=$build_alias --build=$build_alias
682 CFLAGS="${saved_CFLAGS}"
683 mv config.h ../build-config.h
688 AC_SUBST(sim_warnings)
689 AC_SUBST(sim_line_nr)
694 AC_SUBST(sim_decode_mechanism)
703 AC_SUBST(sim_xor_endian)
705 AC_SUBST(sim_igen_smp)
706 AC_SUBST(sim_bitsize)
707 AC_SUBST(sim_hostbitsize)
708 AC_SUBST(sim_timebase)
710 AC_SUBST(sim_reserved)
711 AC_SUBST(sim_monitor)
713 AC_SUBST(sim_default_model)
714 AC_SUBST(sim_model_issue)
716 AC_SUBST(sim_devzero)
717 AC_SUBST(sim_callback)
718 AC_SUBST(sim_targ_vals)
719 AC_SUBST(sim_fpu_cflags)
723 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])