1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_MACRO_DIRS([../.. ../../config])
8 AC_ARG_ENABLE(sim-bitsize,
9 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
10 [case "${enableval}" in
11 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
12 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
14 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
15 echo "Setting bitsize flags = $sim_bitsize" 6>&1
16 fi],[sim_bitsize=""])dnl
19 AC_ARG_ENABLE(sim-config,
20 [ --enable-sim-config=file Override default config file],
21 [case "${enableval}" in
22 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
23 *) if test -f "${srcdir}/${enableval}"; then
24 sim_config="${enableval}";
25 elif test -f "${srcdir}/${enableval}-config.h"; then
26 sim_config="${enableval}-config.h"
28 AC_MSG_ERROR("Config file $enableval was not found");
29 sim_config=std-config.h
32 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
33 echo "Setting config flags = $sim_config" 6>&1
34 fi],[sim_config="std-config.h"
35 if test x"$silent" != x"yes"; then
36 echo "Setting config flags = $sim_config" 6>&1
40 AC_ARG_ENABLE(sim-decode-mechanism,
41 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
42 [case "${enableval}" in
43 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
44 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
45 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
46 sim_decode_mechanism="switch";;
48 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
49 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
50 fi],[sim_decode_mechanism=""
51 if test x"$silent" != x"yes"; then
52 echo "Setting decode mechanism flags = $sim_decode_mechanism"
56 AC_ARG_ENABLE(sim-default-model,
57 [ --enable-sim-default-model=which Specify default PowerPC to model.],
58 [case "${enableval}" in
59 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
60 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
62 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
63 echo "Setting default-model flags = $sim_default_model" 6>&1
64 fi],[sim_default_model=""])dnl
67 AC_ARG_ENABLE(sim-duplicate,
68 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
69 [case "${enableval}" in
72 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
74 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
75 echo "Setting duplicate flags = $sim_dup" 6>&1
77 if test x"$silent" != x"yes"; then
78 echo "Setting duplicate flags = $sim_dup" 6>&1
82 AC_ARG_ENABLE(sim-filter,
83 [ --enable-sim-filter=rule Specify filter rules.],
84 [case "${enableval}" in
85 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
87 *) sim_filter="-F $enableval";;
89 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
90 echo "Setting filter flags = $sim_filter" 6>&1
91 fi],[sim_filter="-F 32,f,o"
92 if test x"$silent" != x"yes"; then
93 echo "Setting filter flags = $sim_filter" 6>&1
97 AC_ARG_ENABLE(sim-float,
98 [ --enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.],
99 [case "${enableval}" in
100 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
101 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
102 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
103 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
104 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
106 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
107 echo "Setting float flags = $sim_float" 6>&1
110 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
111 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
116 AC_CACHE_CHECK([if union semun defined],
117 ac_cv_HAS_UNION_SEMUN,
119 #include <sys/types.h>
121 #include <sys/sem.h>],
123 [ac_cv_has_union_semun="yes"],
124 [ac_cv_has_union_semun="no"])
125 AC_MSG_RESULT($ac_cv_has_union_semun)
129 if test "$ac_cv_has_union_semun" = "yes"; then
130 AC_CACHE_CHECK(whether System V semaphores are supported,
135 #include <sys/types.h>
141 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
144 arg.val = 0; /* avoid implicit type cast to union */
145 if (semctl(id, 0, IPC_RMID, arg) == -1)
150 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
152 else # semun is not defined
153 AC_CACHE_CHECK(whether System V semaphores are supported,
158 #include <sys/types.h>
163 struct semid_ds *buf;
169 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
172 arg.val = 0; /* avoid implicit type cast to union */
173 if (semctl(id, 0, IPC_RMID, arg) == -1)
178 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
182 AC_CACHE_CHECK(whether System V shared memory is supported,
186 #include <sys/types.h>
190 int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
193 if (shmctl(id, IPC_RMID, 0) == -1)
198 ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
201 if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
202 sim_sysv_ipc_hw=",sem,shm";
207 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
208 AC_DEFINE(HAVE_UNION_SEMUN, 1,
209 [Define if union semun is defined in <sys/sem.h>])
213 AC_ARG_ENABLE(sim-hardware,
214 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
215 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
216 case "${enableval}" in
218 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
219 ,*) hardware="${hardware}${enableval}";;
220 *,) hardware="${enableval}${hardware}";;
221 *) hardware="${enableval}"'';;
223 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
224 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
225 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
226 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
227 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
228 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
229 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
230 if test x"$silent" != x"yes"; then
231 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-icache,
246 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
248 case "${enableval}" in
249 yes) icache="1024"; sim_icache="-I $icache";;
250 no) sim_icache="-R";;
253 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
255 define) sim_icache="${sim_icache}R";;
256 semantic) sim_icache="${sim_icache}C";;
257 insn) sim_icache="${sim_icache}S";;
258 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
259 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
262 sim_icache="${sim_icache}I $icache";;
264 if test x"$silent" != x"yes" && test x"$icache" != x""; then
265 echo "Setting instruction cache size to $icache ($sim_icache)"
266 fi],[sim_icache="-CSRI 1024"
267 if test x"$silent" != x"yes"; then
268 echo "Setting instruction cache size to 1024 ($sim_icache)"
272 AC_ARG_ENABLE(sim-inline,
273 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
276 no) sim_inline="-DDEFAULT_INLINE=0";;
277 0) sim_inline="-DDEFAULT_INLINE=0";;
278 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_C_INLINE";;
279 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
280 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
283 *_INLINE=*) new_flag="-D$x";;
284 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
285 *_INLINE) new_flag="-D$x=ALL_C_INLINE";;
286 *) new_flag="-D$x""_INLINE=ALL_C_INLINE";;
288 if test x"$sim_inline" = x""; then
289 sim_inline="$new_flag"
291 sim_inline="$sim_inline $new_flag"
295 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
296 echo "Setting inline flags = $sim_inline" 6>&1
297 fi],[if test x"$GCC" != ""; then
298 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
299 if test x"$silent" != x"yes"; then
300 echo "Setting inline flags = $sim_inline" 6>&1
307 AC_ARG_ENABLE(sim-jump,
308 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
309 [case "${enableval}" in
312 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
314 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
315 echo "Setting jump flag = $sim_jump" 6>&1
317 if test x"$silent" != x"yes"; then
318 echo "Setting jump flag = $sim_jump" 6>&1
322 AC_ARG_ENABLE(sim-line-nr,
323 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
324 [case "${enableval}" in
325 yes) sim_line_nr="";;
326 no) sim_line_nr="-L";;
327 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
329 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
330 echo "Setting warning flags = $sim_line_nr" 6>&1
331 fi],[sim_line_nr=""])dnl
334 AC_ARG_ENABLE(sim-model,
335 [ --enable-sim-model=which Specify PowerPC to model.],
336 [case "${enableval}" in
337 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
338 *) sim_model="-DWITH_MODEL=${enableval}";;
340 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
341 echo "Setting model flags = $sim_model" 6>&1
342 fi],[sim_model=""])dnl
345 AC_ARG_ENABLE(sim-model-issue,
346 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
347 [case "${enableval}" in
348 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
349 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
350 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
352 if test x"$silent" != x"yes"; then
353 echo "Setting model-issue flags = $sim_model_issue" 6>&1
354 fi],[sim_model_issue=""])dnl
357 AC_ARG_ENABLE(sim-monitor,
358 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
359 [case "${enableval}" in
360 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
361 no) sim_monitor="-DWITH_MON=0";;
362 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
363 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
364 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon");;
366 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
367 echo "Setting monitor flags = $sim_monitor" 6>&1
368 fi],[sim_monitor=""])dnl
371 AC_ARG_ENABLE(sim-opcode,
372 [ --enable-sim-opcode=which Override default opcode lookup.],
373 [case "${enableval}" in
374 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
375 *) if test -f "${srcdir}/${enableval}"; then
376 sim_opcode="${enableval}"
377 elif test -f "${srcdir}/dc-${enableval}"; then
378 sim_opcode="dc-${enableval}"
380 AC_MSG_ERROR("File $enableval is not an opcode rules file");
381 sim_opcode="dc-complex"
384 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
385 echo "Setting opcode flags = $sim_opcode" 6>&1
386 fi],[sim_opcode="dc-complex"
387 if test x"$silent" != x"yes"; then
388 echo "Setting opcode flags = $sim_opcode"
392 AC_ARG_ENABLE(sim-packages,
393 [ --enable-sim-packages=list Specify the packages to be included in the build.],
395 case "${enableval}" in
397 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
398 ,*) packages="${packages}${enableval}";;
399 *,) packages="${enableval}${packages}";;
400 *) packages="${enableval}"'';;
402 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
403 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
404 if test x"$silent" != x"yes" && test x"$packages" != x""; then
405 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
406 fi],[packages=disklabel
407 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
408 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
409 if test x"$silent" != x"yes"; then
410 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
414 AC_ARG_ENABLE(sim-reserved-bits,
415 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
416 [case "${enableval}" in
417 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
418 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
419 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
421 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
422 echo "Setting reserved flags = $sim_reserved" 6>&1
423 fi],[sim_reserved=""])dnl
426 AC_ARG_ENABLE(sim-smp,
427 [ --enable-sim-smp=n Specify number of processors to configure for.],
428 [case "${enableval}" in
429 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
430 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
431 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
433 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
434 echo "Setting smp flags = $sim_smp" 6>&1
435 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
436 if test x"$silent" != x"yes"; then
437 echo "Setting smp flags = $sim_smp" 6>&1
441 AC_ARG_ENABLE(sim-switch,
442 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
443 [case "${enableval}" in
444 yes) sim_switch="-s";;
446 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
448 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
449 echo "Setting switch flags = $sim_switch" 6>&1
451 if test x"$silent" != x"yes"; then
452 echo "Setting switch flags = $sim_switch" 6>&1
456 AC_ARG_ENABLE(sim-timebase,
457 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
458 [case "${enableval}" in
459 yes) sim_timebase="-DWITH_TIME_BASE=1";;
460 no) sim_timebase="-DWITH_TIME_BASE=0";;
461 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
463 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
464 echo "Setting timebase flags = $sim_timebase" 6>&1
465 fi],[sim_timebase=""])dnl
468 AC_ARG_ENABLE(sim-warnings,
469 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
470 [case "${enableval}" in
471 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
472 no) sim_warnings="-w";;
473 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
475 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
476 echo "Setting warning flags = $sim_warnings" 6>&1
477 fi],[sim_warnings=""])dnl
480 AC_ARG_ENABLE(sim-xor-endian,
481 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
482 [case "${enableval}" in
483 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
484 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
485 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
487 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
488 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
489 fi],[sim_xor_endian=""])dnl
494 AC_DEFINE(USE_WIN32API, 1,
495 [Define if we should use the Windows API, instead of the
496 POSIX API. On Windows, we use the Windows API when
497 building for MinGW, but the POSIX API when building
502 AC_CONFIG_HEADER(config.h:config.in)
505 dnl Figure out what type of termio/termios support there is
507 AC_MSG_CHECKING(for struct termios)
508 AC_CACHE_VAL(ac_cv_termios_struct,
509 [AC_TRY_COMPILE([#include <sys/types.h>
510 #include <sys/termios.h>],
511 [static struct termios x;
517 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
518 AC_MSG_RESULT($ac_cv_termios_struct)
519 if test $ac_cv_termios_struct = yes; then
520 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
523 if test "$ac_cv_termios_struct" = "yes"; then
524 AC_MSG_CHECKING(for c_line field in struct termios)
525 AC_CACHE_VAL(ac_cv_termios_cline,
526 [AC_TRY_COMPILE([#include <sys/types.h>
527 #include <sys/termios.h>],
528 [static struct termios x; x.c_line = 0;],
529 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
531 AC_MSG_RESULT($ac_cv_termios_cline)
532 if test $ac_cv_termios_cline = yes; then
533 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
536 ac_cv_termios_cline=no
539 if test "$ac_cv_termios_struct" != "yes"; then
540 AC_MSG_CHECKING(for struct termio)
541 AC_CACHE_VAL(ac_cv_termio_struct,
542 [AC_TRY_COMPILE([#include <sys/types.h>
543 #include <sys/termio.h>],
544 [static struct termio x;
550 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
551 AC_MSG_RESULT($ac_cv_termio_struct)
552 if test $ac_cv_termio_struct = yes; then
553 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
556 ac_cv_termio_struct=no
559 if test "$ac_cv_termio_struct" = "yes"; then
560 AC_MSG_CHECKING(for c_line field in struct termio)
561 AC_CACHE_VAL(ac_cv_termio_cline,
562 [AC_TRY_COMPILE([#include <sys/types.h>
563 #include <sys/termio.h>],
564 [static struct termio x; x.c_line = 0;],
565 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
567 AC_MSG_RESULT($ac_cv_termio_cline)
568 if test $ac_cv_termio_cline = yes; then
569 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
572 ac_cv_termio_cline=no
575 dnl Check for struct statfs
576 AC_MSG_CHECKING(for struct statfs)
577 AC_CACHE_VAL(ac_cv_struct_statfs,
578 [AC_TRY_COMPILE([#include <sys/types.h>
579 #ifdef HAVE_SYS_PARAM_H
580 #include <sys/param.h>
582 #ifdef HAVE_SYS_MOUNT_H
583 #include <sys/mount.h>
585 #ifdef HAVE_SYS_VFS_H
588 #ifdef HAVE_SYS_STATFS_H
589 #include <sys/statfs.h>
591 [static struct statfs s;],
592 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
593 AC_MSG_RESULT($ac_cv_struct_statfs)
594 if test $ac_cv_struct_statfs = yes; then
595 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
596 [Define if struct statfs is defined in <sys/mount.h>])
599 AC_CHECK_TYPES(long long)
601 dnl Figure out if /dev/zero exists or not
603 AC_MSG_CHECKING(for /dev/zero)
604 AC_CACHE_VAL(ac_cv_devzero,
605 [AC_TRY_RUN([#include <fcntl.h>
609 int fd = open ("/dev/zero", O_RDONLY);
612 for (i = 0; i < sizeof (buf); i++)
614 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
616 for (i = 0; i < sizeof (buf); i++)
620 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
621 AC_MSG_RESULT($ac_cv_devzero)
622 if test $ac_cv_devzero = yes; then
623 sim_devzero="-DHAVE_DEVZERO"
628 dnl Figure out if we are in the new Cygnus tree with a common directory or not
629 AC_MSG_CHECKING(for common simulator directory)
630 if test -f "${srcdir}/../common/callback.c"; then
632 sim_callback="callback.o targ-map.o"
633 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
640 AC_MSG_CHECKING(for common simulator directory fpu implementation)
641 if test -f "${srcdir}/../common/sim-fpu.c"; then
643 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
651 # Since we run commands on the build system, we have to create a
652 # separate config header for the build system if build != host.
653 if test x$host = x$build; then
654 AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h])
661 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
662 *) realsrcdir=../${srcdir};;
664 saved_CFLAGS="${CFLAGS}"
665 # Put a plausible default for CC_FOR_BUILD in Makefile.
666 if test "x$cross_compiling" = "xno"; then
671 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD-${CFLAGS}}" \
672 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
673 ${realsrcdir}/configure \
674 --enable-languages=${enable_languages-all} \
675 --target=$target_alias --host=$build_alias --build=$build_alias
676 CFLAGS="${saved_CFLAGS}"
677 mv config.h ../build-config.h
682 AC_SUBST(sim_warnings)
683 AC_SUBST(sim_line_nr)
688 AC_SUBST(sim_decode_mechanism)
697 AC_SUBST(sim_xor_endian)
699 AC_SUBST(sim_igen_smp)
700 AC_SUBST(sim_bitsize)
701 AC_SUBST(sim_hostbitsize)
702 AC_SUBST(sim_timebase)
704 AC_SUBST(sim_reserved)
705 AC_SUBST(sim_monitor)
707 AC_SUBST(sim_default_model)
708 AC_SUBST(sim_model_issue)
710 AC_SUBST(sim_devzero)
711 AC_SUBST(sim_callback)
712 AC_SUBST(sim_targ_vals)
713 AC_SUBST(sim_fpu_cflags)
717 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])