dnl
|
dnl
|
dnl Configure script for the OpenRISC 1000 simulator
|
dnl Configure script for the OpenRISC 1000 simulator
|
dnl
|
dnl
|
dnl report bugs to jrydberg@phx.pp.se
|
dnl report bugs to jrydberg@phx.pp.se
|
dnl
|
dnl
|
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
AC_INIT(cpu/or32/execute.c)
|
AC_INIT(cpu/or32/execute.c)
|
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
AM_INIT_AUTOMAKE(or1ksim, 1.3)
|
AM_INIT_AUTOMAKE(or1ksim, 1.3)
|
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
|
|
AC_REVISION([for or1ksim-1.2, version 2.14, from autoconf version] AC_ACVERSION)
|
AC_REVISION([for or1ksim-1.2, version 2.14, from autoconf version] AC_ACVERSION)
|
SIMVERSION=1.2
|
SIMVERSION=1.2
|
|
|
dnl make sure we are using a recent autoconf version
|
dnl make sure we are using a recent autoconf version
|
AC_PREREQ(2.10)
|
AC_PREREQ(2.10)
|
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
|
|
dnl yuck
|
dnl yuck
|
case "$target_cpu" in
|
case "$target_cpu" in
|
or32*) CPU_ARCH=or32;
|
or32*) CPU_ARCH=or32;
|
ARCH_ISA=OR32;;
|
ARCH_ISA=OR32;;
|
dlx*) CPU_ARCH=dlx;
|
dlx*) CPU_ARCH=dlx;
|
ARCH_ISA=DLX;;
|
ARCH_ISA=DLX;;
|
esac
|
esac
|
AC_SUBST(CPU_ARCH)
|
AC_SUBST(CPU_ARCH)
|
|
|
# We want these before the checks, so the checks can modify their values.
|
# We want these before the checks, so the checks can modify their values.
|
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
|
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
|
|
|
AC_PROG_CC
|
AC_PROG_CC
|
AC_MINIX
|
AC_MINIX
|
|
|
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
|
|
# If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
|
# If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
|
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2 -D$ARCH_ISA"
|
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2 -D$ARCH_ISA"
|
|
|
AC_PROG_GCC_TRADITIONAL
|
AC_PROG_GCC_TRADITIONAL
|
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
AC_CHECK_PROG(AR, ar, ar)
|
AC_CHECK_PROG(AR, ar, ar)
|
dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
|
dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
|
dnl This allows people to set it when running configure or make
|
dnl This allows people to set it when running configure or make
|
test -n "$ARFLAGS" || ARFLAGS="cr"
|
test -n "$ARFLAGS" || ARFLAGS="cr"
|
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
|
|
MAKE_SHELL=/bin/sh
|
MAKE_SHELL=/bin/sh
|
|
|
AC_SUBST(MAKE_SHELL)
|
AC_SUBST(MAKE_SHELL)
|
|
|
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
AC_HEADER_STAT
|
AC_HEADER_STAT
|
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
|
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
|
AC_FUNC_STRCOLL
|
AC_FUNC_STRCOLL
|
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \
|
AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \
|
sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
|
sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
|
termcap.h termios.h termio.h sys/file.h locale.h\
|
termcap.h termios.h termio.h sys/file.h locale.h\
|
net/ethernet.h)
|
net/ethernet.h)
|
|
|
dnl check for "long long" (added by Erez)
|
dnl check for "long long" (added by Erez)
|
AC_TRY_COMPILE(,[long long ll; unsigned long long ull;],AC_DEFINE(CC_HAS_LONG_LONG))
|
AC_TRY_COMPILE(,[long long ll; unsigned long long ull;],AC_DEFINE(CC_HAS_LONG_LONG))
|
|
|
dnl check for GNU readline
|
dnl check for GNU readline
|
AC_ARG_ENABLE(readline,
|
AC_ARG_ENABLE(readline,
|
[ --enable-readline Use GNU readline], AC_CHECK_LIB(readline, add_history))
|
[ --enable-readline Use GNU readline], AC_CHECK_LIB(readline, add_history))
|
|
|
dnl yuck
|
dnl yuck
|
case "$host_os" in
|
case "$host_os" in
|
aix*) prefer_curses=yes ;;
|
aix*) prefer_curses=yes ;;
|
esac
|
esac
|
|
|
case "$host_cpu" in
|
case "$host_cpu" in
|
*cray*) LOCAL_CFLAGS=-DCRAY ;;
|
*cray*) LOCAL_CFLAGS=-DCRAY ;;
|
esac
|
esac
|
|
|
case "$host_os" in
|
case "$host_os" in
|
isc*) LOCAL_CFLAGS=-Disc386 ;;
|
isc*) LOCAL_CFLAGS=-Disc386 ;;
|
esac
|
esac
|
|
|
case "$host_os" in
|
case "$host_os" in
|
solaris*) LIBS="-lsocket -lnsl" ;;
|
solaris*) LIBS="-lsocket -lnsl" ;;
|
esac
|
esac
|
|
|
dnl define options
|
dnl define options
|
|
|
AC_MSG_CHECKING(whether to enable profiling)
|
AC_MSG_CHECKING(whether to enable profiling)
|
AC_ARG_ENABLE(profiling,
|
AC_ARG_ENABLE(profiling,
|
[ --enable-profiling generate profiling code], [
|
[ --enable-profiling generate profiling code], [
|
case "$enableval" in
|
case "$enableval" in
|
yes) profile="-pg -a" ;;
|
yes) profile="-pg -a" ;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${enable_profiling-no})
|
AC_MSG_RESULT(${enable_profiling-no})
|
|
|
fast_sim="0"
|
fast_sim="0"
|
AC_MSG_CHECKING(whether to compile fsim)
|
AC_MSG_CHECKING(whether to compile fsim)
|
AC_ARG_ENABLE(fsim,
|
AC_ARG_ENABLE(fsim,
|
[ --enable-fsim compiles fsim, based on fast_config.c], [
|
[ --enable-fsim compiles fsim, based on fast_config.c], [
|
case "$enableval" in
|
case "$enableval" in
|
no) fast_sim="0" ;;
|
no) fast_sim="0" ;;
|
yes) fast_sim="1" ;;
|
yes) fast_sim="1" ;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${enable_fsim-no})
|
AC_MSG_RESULT(${enable_fsim-no})
|
|
|
simple_execution="0"
|
simple_execution="0"
|
AC_MSG_CHECKING(whether to use simple execution)
|
AC_MSG_CHECKING(whether to use simple execution)
|
AC_ARG_ENABLE(simple,
|
AC_ARG_ENABLE(simple,
|
[ --enable-simple compiles sim with simple execution], [
|
[ --enable-simple compiles sim with simple execution], [
|
case "$enableval" in
|
case "$enableval" in
|
no) simple_execution="0" ;;
|
no) simple_execution="0" ;;
|
yes) simple_execution="1" ;;
|
yes) simple_execution="1" ;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${enable_simple-no})
|
AC_MSG_RESULT(${enable_simple-no})
|
|
|
eth_phy="0"
|
eth_phy="0"
|
AC_MSG_CHECKING(whether to enable ethernet phy emulation)
|
AC_MSG_CHECKING(whether to enable ethernet phy emulation)
|
AC_ARG_ENABLE(ethphy,
|
AC_ARG_ENABLE(ethphy,
|
[ --enable-ethphy compiles sim with ethernet phy support], [
|
[ --enable-ethphy compiles sim with ethernet phy support], [
|
case "$enableval" in
|
case "$enableval" in
|
no) eth_phy="0" ;;
|
no) eth_phy="0" ;;
|
yes) eth_phy="1" ;;
|
yes) eth_phy="1" ;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${enable_eth_phy-no})
|
AC_MSG_RESULT(${enable_eth_phy-no})
|
|
|
|
|
raw_range_stats="0"
|
raw_range_stats="0"
|
AC_MSG_CHECKING(whether to use raw range stats)
|
AC_MSG_CHECKING(whether to use raw range stats)
|
AC_ARG_ENABLE(range_stats,
|
AC_ARG_ENABLE(range_stats,
|
[ --enable-range-stats Specifies, whether we should do register accesses over time analysis.], [
|
[ --enable-range-stats Specifies, whether we should do register accesses over time analysis.], [
|
case "$enableval" in
|
case "$enableval" in
|
no) raw_range_stats="0" ;;
|
no) raw_range_stats="0" ;;
|
yes) raw_range_stats="1" simple_execution="1" ;;
|
yes) raw_range_stats="1" simple_execution="1" ;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${enable_range_stats-no})
|
AC_MSG_RESULT(${enable_range_stats-no})
|
|
|
set_ov_flag="0"
|
set_ov_flag="0"
|
AC_MSG_CHECKING(whether instructions set overflow flag)
|
AC_MSG_CHECKING(whether instructions set overflow flag)
|
AC_ARG_ENABLE(ov_flag,
|
AC_ARG_ENABLE(ov_flag,
|
[ --enable-ov-flag Whether instructions set overflow flag.], [
|
[ --enable-ov-flag Whether instructions set overflow flag.], [
|
case "$enableval" in
|
case "$enableval" in
|
no) set_ov_flag="0" ;;
|
no) set_ov_flag="0" ;;
|
yes) set_ov_flag="1" ;;
|
yes) set_ov_flag="1" ;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${enable_ov_flag-no})
|
AC_MSG_RESULT(${enable_ov_flag-no})
|
|
|
set_arith_flag="0"
|
set_arith_flag="0"
|
AC_MSG_CHECKING(whether arithmethic instructions set flag)
|
AC_MSG_CHECKING(whether arithmethic instructions set flag)
|
AC_ARG_ENABLE(arith_flag,
|
AC_ARG_ENABLE(arith_flag,
|
[ --enable-arith-flag Whether arithmethic instructions setflag.], [
|
[ --enable-arith-flag Whether arithmethic instructions setflag.], [
|
case "$enableval" in
|
case "$enableval" in
|
no) set_arith_flag="0" ;;
|
no) set_arith_flag="0" ;;
|
yes) set_arith_flag="1" ;;
|
yes) set_arith_flag="1" ;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${enable_arith_flag-no})
|
AC_MSG_RESULT(${enable_arith_flag-no})
|
|
|
AC_DEFINE_UNQUOTED(FAST_SIM, $fast_sim)
|
AC_DEFINE_UNQUOTED(FAST_SIM, $fast_sim)
|
AC_DEFINE_UNQUOTED(RAW_RANGE_STATS, $raw_range_stats)
|
AC_DEFINE_UNQUOTED(RAW_RANGE_STATS, $raw_range_stats)
|
AC_DEFINE_UNQUOTED(SET_OV_FLAG, $set_ov_flag)
|
AC_DEFINE_UNQUOTED(SET_OV_FLAG, $set_ov_flag)
|
AC_DEFINE_UNQUOTED(ARITH_SET_FLAG, $set_arith_flag)
|
AC_DEFINE_UNQUOTED(ARITH_SET_FLAG, $set_arith_flag)
|
AC_DEFINE_UNQUOTED(HAVE_ETH_PHY, $eth_phy)
|
AC_DEFINE_UNQUOTED(HAVE_ETH_PHY, $eth_phy)
|
AC_DEFINE_UNQUOTED(SIMPLE_EXECUTION, $simple_execution)
|
AC_DEFINE_UNQUOTED(SIMPLE_EXECUTION, $simple_execution)
|
AM_CONDITIONAL(SIMPLE_EXECUTION, test x$simple_execution = x1)
|
AM_CONDITIONAL(SIMPLE_EXECUTION, test x$simple_execution = x1)
|
|
|
|
|
AC_MSG_CHECKING(for implementation-specific data)
|
AC_MSG_CHECKING(for implementation-specific data)
|
AC_ARG_ENABLE(impl,
|
AC_ARG_ENABLE(impl,
|
[ --enable-impl= use -specific environment
|
[ --enable-impl= use -specific environment
|
(one of: bender, mp3, default)], [
|
(one of: bender, mp3, default)], [
|
case "$enableval" in
|
case "$enableval" in
|
no|default) IMPL="DEFAULT" ;;
|
no|default) IMPL="DEFAULT" ;;
|
mp3) IMPL="MP3" ;;
|
mp3) IMPL="MP3" ;;
|
bender) IMPL="BENDER" ;;
|
bender) IMPL="BENDER" ;;
|
*)
|
*)
|
AC_MSG_RESULT(failed)
|
AC_MSG_RESULT(failed)
|
AC_MSG_ERROR([bad --enable-impl option])
|
AC_MSG_ERROR([bad --enable-impl option])
|
;;
|
;;
|
esac
|
esac
|
])
|
])
|
AC_MSG_RESULT(${IMPL=DEFAULT})
|
AC_MSG_RESULT(${IMPL=DEFAULT})
|
if test "$IMPL" = "DEFAULT"
|
if test "$IMPL" = "DEFAULT"
|
then
|
then
|
AC_MSG_WARN([using default environment])
|
AC_MSG_WARN([using default environment])
|
fi
|
fi
|
|
|
test -n "$profile" && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile"
|
test -n "$profile" && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile"
|
IMPL="-DIMPL_$IMPL"
|
IMPL="-DIMPL_$IMPL"
|
# CFLAGS="$CFLAGS -O4"
|
# CFLAGS="$CFLAGS -O4"
|
|
|
BUILD_DIR=`pwd`
|
BUILD_DIR=`pwd`
|
AC_SUBST(BUILD_DIR)
|
AC_SUBST(BUILD_DIR)
|
|
|
AC_SUBST(CFLAGS)
|
AC_SUBST(CFLAGS)
|
AC_SUBST(LOCAL_CFLAGS)
|
AC_SUBST(LOCAL_CFLAGS)
|
AC_SUBST(LOCAL_LDFLAGS)
|
AC_SUBST(LOCAL_LDFLAGS)
|
AC_SUBST(LOCAL_DEFS)
|
AC_SUBST(LOCAL_DEFS)
|
|
|
AC_SUBST(AR)
|
AC_SUBST(AR)
|
AC_SUBST(ARFLAGS)
|
AC_SUBST(ARFLAGS)
|
|
|
AC_SUBST(host_cpu)
|
AC_SUBST(host_cpu)
|
AC_SUBST(host_os)
|
AC_SUBST(host_os)
|
AC_SUBST(host)
|
AC_SUBST(host)
|
|
|
AC_SUBST(SUMVERSION)
|
AC_SUBST(SUMVERSION)
|
AC_SUBST(TERMCAP_LIB)
|
AC_SUBST(TERMCAP_LIB)
|
|
|
AC_DEFINE(HAS_EXECUTION)
|
AC_DEFINE(HAS_EXECUTION)
|
AC_DEFINE(HAS_DEBUG)
|
AC_DEFINE(HAS_DEBUG)
|
|
|
dnl yuck
|
dnl yuck
|
INCLUDES="-I\${top_srcdir} -I\${top_srcdir}/cpu/common -I\${top_srcdir}/cpu/or1k \
|
INCLUDES="-I\${top_srcdir} -I\${top_srcdir}/cpu/common -I\${top_srcdir}/cpu/or1k \
|
-I\${top_srcdir}/cpu/$CPU_ARCH -I\${top_srcdir}/cache -I\${top_srcdir}/mmu \
|
-I\${top_srcdir}/cpu/$CPU_ARCH -I\${top_srcdir}/cache -I\${top_srcdir}/mmu \
|
-I\${top_srcdir}/bpb -I\${top_srcdir}/peripheral -I\${top_srcdir}/tick \
|
-I\${top_srcdir}/bpb -I\${top_srcdir}/peripheral -I\${top_srcdir}/tick \
|
-I\${top_srcdir}/peripheral/channels \
|
-I\${top_srcdir}/peripheral/channels \
|
-I\${top_srcdir}/pm -I\${top_srcdir}/pic -I\${top_srcdir}/debug \
|
-I\${top_srcdir}/pm -I\${top_srcdir}/pic -I\${top_srcdir}/debug \
|
-I\${top_srcdir}/vapi -I\${top_srcdir}/support -I\${top_srcdir}/cuc"
|
-I\${top_srcdir}/vapi -I\${top_srcdir}/support -I\${top_srcdir}/cuc"
|
AC_SUBST(INCLUDES)
|
AC_SUBST(INCLUDES)
|
|
|
AC_OUTPUT([Makefile bpb/Makefile cache/Makefile cpu/Makefile
|
AC_OUTPUT([Makefile bpb/Makefile cache/Makefile cpu/Makefile
|
cpu/common/Makefile cpu/or32/Makefile cuc/Makefile
|
cpu/common/Makefile cpu/or32/Makefile cuc/Makefile
|
cpu/or1k/Makefile cpu/dlx/Makefile debug/Makefile
|
cpu/or1k/Makefile cpu/dlx/Makefile debug/Makefile
|
support/Makefile mmu/Makefile peripheral/Makefile tick/Makefile
|
support/Makefile mmu/Makefile peripheral/Makefile tick/Makefile
|
peripheral/channels/Makefile
|
peripheral/channels/Makefile
|
pm/Makefile pic/Makefile debug/Makefile vapi/Makefile],
|
pm/Makefile pic/Makefile vapi/Makefile],
|
[
|
[
|
# Makefile uses this timestamp file to record whether config.h is up to date.
|
# Makefile uses this timestamp file to record whether config.h is up to date.
|
echo > stamp-h
|
echo > stamp-h
|
])
|
])
|
|
|