AC_PREREQ(2.3)dnl
AC_INIT(Makefile.in)
+AC_PROG_CC
+
+# Put a plausible default for CC_FOR_BUILD in Makefile.
+AC_C_CROSS
+if test "x$cross_compiling" = "xno"; then
+ CC_FOR_BUILD='$(CC)'
+else
+ CC_FOR_BUILD=gcc
+fi
+
AC_ARG_ENABLE(sim-cflags,
[ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
[case "${enableval}" in
esac
if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
echo "Setting switch flags = $sim_switch" 6>&1
-fi],[sim_switch="-s";
+fi],[sim_switch="";
if test x"$silent" != x"yes"; then
echo "Setting switch flags = $sim_switch" 6>&1
fi])dnl
[ --enable-sim-inline=inlines Specify which functions should be inlined.],
[sim_inline=""
case "$enableval" in
- no) sim_inline="-DDEFAULT_INLINE=0 -DINLINE=";;
+ no) sim_inline="-DDEFAULT_INLINE=0";;
0) sim_inline="-DDEFAULT_INLINE=0";;
yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
esac
if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
echo "Setting hostendian flags = $sim_hostendian" 6>&1
-fi],[sim_hostendian=""])dnl
+fi],[
+if test "x$cross_compiling" = "xno"; then
+ AC_C_BIGENDIAN
+ if test $ac_cv_c_bigendian = yes; then
+ sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
+ else
+ sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
+ fi
+else
+ sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
+fi])dnl
AC_ARG_ENABLE(sim-smp,
[ --enable-sim-smp=n Specify number of processors to configure for.],
esac
if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
echo "Setting smp flags = $sim_smp" 6>&1
-fi],[sim_smp="-DWITH_SMP=0"
+fi],[sim_smp="-DWITH_SMP=5"
if test x"$silent" != x"yes"; then
echo "Setting smp flags = $sim_smp" 6>&1
fi])dnl
yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
*) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
-esac],[sim_xor_endian=""])dnl
+esac
+if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
+ echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
+fi],[sim_xor_endian=""])dnl
AC_ARG_ENABLE(sim-bitsize,
[ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
[case "${enableval}" in
yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
+ 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
*) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
esac
if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
AC_ARG_ENABLE(sim-monitor,
[ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
[case "${enableval}" in
- yes) sim_mon="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
- no) sim_mon="-DWITH_MON=0";;
- instruction) sim_mon="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
- memory) sim_mon="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
+ yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
+ no) sim_monitor="-DWITH_MON=0";;
+ instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
+ memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
*) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
esac
-if test x"$silent" != x"yes" && test x"$sim_mon" != x""; then
- echo "Setting monitor flags = $sim_mon" 6>&1
-fi],[sim_mon=""])dnl
+if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
+ echo "Setting monitor flags = $sim_monitor" 6>&1
+fi],[sim_monitor=""])dnl
AC_ARG_ENABLE(sim-model,
[ --enable-sim-model=which Specify PowerPC to model.],
echo "Setting model-issue flags = $sim_model_issue" 6>&1
fi],[sim_model_issue=""])dnl
+AC_ARG_ENABLE(sim-stdio,
+[ --enable-sim-stdio Specify whether to use stdio for console input/output.],
+[case "${enableval}" in
+ yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
+ no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
+ *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
+esac
+if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
+ echo "Setting stdio flags = $sim_stdio" 6>&1
+fi],[sim_stdio=""])dnl
+
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AC_CONFIG_HEADER(config.h:config.in)
-AC_PROG_CC
+AC_SUBST(CC_FOR_BUILD)
AC_SUBST(CFLAGS)
AC_SUBST(HDEFINES)
AR=${AR-ar}
AC_SUBST(sim_model)
AC_SUBST(sim_default_model)
AC_SUBST(sim_model_issue)
+AC_SUBST(sim_stdio)
-AC_CHECK_FUNCS(getrusage)
-
-# Put a plausible default for CC_FOR_BUILD in Makefile.
-AC_C_CROSS
-if test "x$cross_compiling" = "xno"; then
- CC_FOR_BUILD='$(CC)'
-else
- CC_FOR_BUILD=gcc
-fi
-AC_SUBST(CC_FOR_BUILD)
+AC_STRUCT_ST_BLKSIZE
+AC_STRUCT_ST_BLOCKS
+AC_STRUCT_ST_RDEV
+AC_STRUCT_TIMEZONE
-AC_C_BIGENDIAN
-AC_SUBST(WORDS_BIGENDIAN)
+AC_CHECK_FUNCS(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)
-AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h)
+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)
+AC_HEADER_DIRENT
AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])