OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [sim/] [common/] [common.m4] - Diff between revs 24 and 33

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 33
# This file contains common code used by all simulators.
# This file contains common code used by all simulators.
#
#
# common.m4 invokes AC macros used by all simulators and by the common
# common.m4 invokes AC macros used by all simulators and by the common
# directory.  It is intended to be included before any target specific
# directory.  It is intended to be included before any target specific
# stuff.  SIM_AC_OUTPUT is a cover function to AC_OUTPUT to generate
# stuff.  SIM_AC_OUTPUT is a cover function to AC_OUTPUT to generate
# the Makefile.  It is intended to be invoked last.
# the Makefile.  It is intended to be invoked last.
#
#
# The simulator's configure.in should look like:
# The simulator's configure.in should look like:
#
#
# dnl Process this file with autoconf to produce a configure script.
# dnl Process this file with autoconf to produce a configure script.
# AC_PREREQ(2.5)dnl
# AC_PREREQ(2.5)dnl
# AC_INIT(Makefile.in)
# AC_INIT(Makefile.in)
# AC_CONFIG_HEADER(config.h:config.in)
# AC_CONFIG_HEADER(config.h:config.in)
#
#
# sinclude(../common/aclocal.m4)
# sinclude(../common/aclocal.m4)
# sinclude(../common/common.m4)
# sinclude(../common/common.m4)
#
#
# ... target specific stuff ...
# ... target specific stuff ...
 
 
AC_CANONICAL_SYSTEM
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AC_ARG_PROGRAM
AC_PROG_CC
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_INSTALL
 
 
# Put a plausible default for CC_FOR_BUILD in Makefile.
# Put a plausible default for CC_FOR_BUILD in Makefile.
if test "x$cross_compiling" = "xno"; then
if test "x$cross_compiling" = "xno"; then
  CC_FOR_BUILD='$(CC)'
  CC_FOR_BUILD='$(CC)'
else
else
  CC_FOR_BUILD=gcc
  CC_FOR_BUILD=gcc
fi
fi
AC_SUBST(CC_FOR_BUILD)
AC_SUBST(CC_FOR_BUILD)
 
 
AC_SUBST(CFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(HDEFINES)
AC_SUBST(HDEFINES)
AR=${AR-ar}
AR=${AR-ar}
AC_SUBST(AR)
AC_SUBST(AR)
AC_PROG_RANLIB
AC_PROG_RANLIB
 
 
dnl We don't use gettext, but bfd does.  So we do the appropriate checks
dnl We don't use gettext, but bfd does.  So we do the appropriate checks
dnl to see if there are intl libraries we should link against.
dnl to see if there are intl libraries we should link against.
ALL_LINGUAS=
ALL_LINGUAS=
ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
 
 
# Check for common headers.
# Check for common headers.
# FIXME: Seems to me this can cause problems for i386-windows hosts.
# FIXME: Seems to me this can cause problems for i386-windows hosts.
# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h)
AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h)
AC_CHECK_HEADERS(sys/time.h sys/resource.h)
AC_CHECK_HEADERS(sys/time.h sys/resource.h)
AC_CHECK_HEADERS(fcntl.h fpu_control.h)
AC_CHECK_HEADERS(fcntl.h fpu_control.h)
AC_CHECK_HEADERS(dlfcn.h errno.h sys/stat.h)
AC_CHECK_HEADERS(dlfcn.h errno.h sys/stat.h)
AC_CHECK_FUNCS(getrusage time sigaction __setfpucw)
AC_CHECK_FUNCS(getrusage time sigaction __setfpucw)
 
 
# Check for socket libraries
# Check for socket libraries
AC_CHECK_LIB(socket, bind)
AC_CHECK_LIB(socket, bind)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(nsl, gethostbyname)
 
 
. ${srcdir}/../../bfd/configure.host
. ${srcdir}/../../bfd/configure.host
 
 
dnl Standard (and optional) simulator options.
dnl Standard (and optional) simulator options.
dnl Eventually all simulators will support these.
dnl Eventually all simulators will support these.
dnl Do not add any here that cannot be supported by all simulators.
dnl Do not add any here that cannot be supported by all simulators.
dnl Do not add similar but different options to a particular simulator,
dnl Do not add similar but different options to a particular simulator,
dnl all shall eventually behave the same way.
dnl all shall eventually behave the same way.
 
 
 
 
dnl We don't use automake, but we still want to support
dnl We don't use automake, but we still want to support
dnl --enable-maintainer-mode.
dnl --enable-maintainer-mode.
USE_MAINTAINER_MODE=no
USE_MAINTAINER_MODE=no
AC_ARG_ENABLE(maintainer-mode,
AC_ARG_ENABLE(maintainer-mode,
[  --enable-maintainer-mode             Enable developer functionality.],
[  --enable-maintainer-mode             Enable developer functionality.],
[case "${enableval}" in
[case "${enableval}" in
  yes)  MAINT="" USE_MAINTAINER_MODE=yes ;;
  yes)  MAINT="" USE_MAINTAINER_MODE=yes ;;
  no)   MAINT="#" ;;
  no)   MAINT="#" ;;
  *)    AC_MSG_ERROR("--enable-maintainer-mode does not take a value"); MAINT="#" ;;
  *)    AC_MSG_ERROR("--enable-maintainer-mode does not take a value"); MAINT="#" ;;
esac
esac
if test x"$silent" != x"yes" && test x"$MAINT" = x""; then
if test x"$silent" != x"yes" && test x"$MAINT" = x""; then
  echo "Setting maintainer mode" 6>&1
  echo "Setting maintainer mode" 6>&1
fi],[MAINT="#"])dnl
fi],[MAINT="#"])dnl
AC_SUBST(MAINT)
AC_SUBST(MAINT)
 
 
 
 
dnl This is a generic option to enable special byte swapping
dnl This is a generic option to enable special byte swapping
dnl insns on *any* cpu.
dnl insns on *any* cpu.
AC_ARG_ENABLE(sim-bswap,
AC_ARG_ENABLE(sim-bswap,
[  --enable-sim-bswap                   Use Host specific BSWAP instruction.],
[  --enable-sim-bswap                   Use Host specific BSWAP instruction.],
[case "${enableval}" in
[case "${enableval}" in
  yes)  sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
  yes)  sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
  no)   sim_bswap="-DWITH_BSWAP=0";;
  no)   sim_bswap="-DWITH_BSWAP=0";;
  *)    AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
  *)    AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
esac
esac
if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
  echo "Setting bswap flags = $sim_bswap" 6>&1
  echo "Setting bswap flags = $sim_bswap" 6>&1
fi],[sim_bswap=""])dnl
fi],[sim_bswap=""])dnl
AC_SUBST(sim_bswap)
AC_SUBST(sim_bswap)
 
 
 
 
AC_ARG_ENABLE(sim-cflags,
AC_ARG_ENABLE(sim-cflags,
[  --enable-sim-cflags=opts             Extra CFLAGS for use in building simulator],
[  --enable-sim-cflags=opts             Extra CFLAGS for use in building simulator],
[case "${enableval}" in
[case "${enableval}" in
  yes)   sim_cflags="-O2 -fomit-frame-pointer";;
  yes)   sim_cflags="-O2 -fomit-frame-pointer";;
  trace) AC_MSG_ERROR("Please use --enable-sim-debug instead."); sim_cflags="";;
  trace) AC_MSG_ERROR("Please use --enable-sim-debug instead."); sim_cflags="";;
  no)    sim_cflags="";;
  no)    sim_cflags="";;
  *)     sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
  *)     sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
esac
if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
  echo "Setting sim cflags = $sim_cflags" 6>&1
  echo "Setting sim cflags = $sim_cflags" 6>&1
fi],[sim_cflags=""])dnl
fi],[sim_cflags=""])dnl
AC_SUBST(sim_cflags)
AC_SUBST(sim_cflags)
 
 
 
 
dnl --enable-sim-debug is for developers of the simulator
dnl --enable-sim-debug is for developers of the simulator
dnl the allowable values are work-in-progress
dnl the allowable values are work-in-progress
AC_ARG_ENABLE(sim-debug,
AC_ARG_ENABLE(sim-debug,
[  --enable-sim-debug=opts              Enable debugging flags],
[  --enable-sim-debug=opts              Enable debugging flags],
[case "${enableval}" in
[case "${enableval}" in
  yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
  yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
  no)  sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
  no)  sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
  *)   sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
  *)   sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
esac
esac
if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
  echo "Setting sim debug = $sim_debug" 6>&1
  echo "Setting sim debug = $sim_debug" 6>&1
fi],[sim_debug=""])dnl
fi],[sim_debug=""])dnl
AC_SUBST(sim_debug)
AC_SUBST(sim_debug)
 
 
 
 
dnl --enable-sim-stdio is for users of the simulator
dnl --enable-sim-stdio is for users of the simulator
dnl It determines if IO from the program is routed through STDIO (buffered)
dnl It determines if IO from the program is routed through STDIO (buffered)
AC_ARG_ENABLE(sim-stdio,
AC_ARG_ENABLE(sim-stdio,
[  --enable-sim-stdio                   Specify whether to use stdio for console input/output.],
[  --enable-sim-stdio                   Specify whether to use stdio for console input/output.],
[case "${enableval}" in
[case "${enableval}" in
  yes)  sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
  yes)  sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
  no)   sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
  no)   sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
  *)    AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
  *)    AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
esac
esac
if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
  echo "Setting stdio flags = $sim_stdio" 6>&1
  echo "Setting stdio flags = $sim_stdio" 6>&1
fi],[sim_stdio=""])dnl
fi],[sim_stdio=""])dnl
AC_SUBST(sim_stdio)
AC_SUBST(sim_stdio)
 
 
 
 
dnl --enable-sim-trace is for users of the simulator
dnl --enable-sim-trace is for users of the simulator
dnl The argument is either a bitmask of things to enable [exactly what is
dnl The argument is either a bitmask of things to enable [exactly what is
dnl up to the simulator], or is a comma separated list of names of tracing
dnl up to the simulator], or is a comma separated list of names of tracing
dnl elements to enable.  The latter is only supported on simulators that
dnl elements to enable.  The latter is only supported on simulators that
dnl use WITH_TRACE.
dnl use WITH_TRACE.
AC_ARG_ENABLE(sim-trace,
AC_ARG_ENABLE(sim-trace,
[  --enable-sim-trace=opts              Enable tracing flags],
[  --enable-sim-trace=opts              Enable tracing flags],
[case "${enableval}" in
[case "${enableval}" in
  yes)  sim_trace="-DTRACE=1 -DWITH_TRACE=-1";;
  yes)  sim_trace="-DTRACE=1 -DWITH_TRACE=-1";;
  no)   sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
  no)   sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
  [[-0-9]]*)
  [[-0-9]]*)
        sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
        sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
  [[a-z]]*)
  [[a-z]]*)
        sim_trace=""
        sim_trace=""
        for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
        for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
          if test x"$sim_trace" = x; then
          if test x"$sim_trace" = x; then
            sim_trace="-DWITH_TRACE='(TRACE_$x"
            sim_trace="-DWITH_TRACE='(TRACE_$x"
          else
          else
            sim_trace="${sim_trace}|TRACE_$x"
            sim_trace="${sim_trace}|TRACE_$x"
          fi
          fi
        done
        done
        sim_trace="$sim_trace)'" ;;
        sim_trace="$sim_trace)'" ;;
esac
esac
if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
  echo "Setting sim trace = $sim_trace" 6>&1
  echo "Setting sim trace = $sim_trace" 6>&1
fi],[sim_trace=""])dnl
fi],[sim_trace=""])dnl
AC_SUBST(sim_trace)
AC_SUBST(sim_trace)
 
 
 
 
dnl --enable-sim-profile
dnl --enable-sim-profile
dnl The argument is either a bitmask of things to enable [exactly what is
dnl The argument is either a bitmask of things to enable [exactly what is
dnl up to the simulator], or is a comma separated list of names of profiling
dnl up to the simulator], or is a comma separated list of names of profiling
dnl elements to enable.  The latter is only supported on simulators that
dnl elements to enable.  The latter is only supported on simulators that
dnl use WITH_PROFILE.
dnl use WITH_PROFILE.
AC_ARG_ENABLE(sim-profile,
AC_ARG_ENABLE(sim-profile,
[  --enable-sim-profile=opts            Enable profiling flags],
[  --enable-sim-profile=opts            Enable profiling flags],
[case "${enableval}" in
[case "${enableval}" in
  yes)  sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";;
  yes)  sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";;
  no)   sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";;
  no)   sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";;
  [[-0-9]]*)
  [[-0-9]]*)
        sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";;
        sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";;
  [[a-z]]*)
  [[a-z]]*)
        sim_profile=""
        sim_profile=""
        for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
        for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
          if test x"$sim_profile" = x; then
          if test x"$sim_profile" = x; then
            sim_profile="-DWITH_PROFILE='(PROFILE_$x"
            sim_profile="-DWITH_PROFILE='(PROFILE_$x"
          else
          else
            sim_profile="${sim_profile}|PROFILE_$x"
            sim_profile="${sim_profile}|PROFILE_$x"
          fi
          fi
        done
        done
        sim_profile="$sim_profile)'" ;;
        sim_profile="$sim_profile)'" ;;
esac
esac
if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
  echo "Setting sim profile = $sim_profile" 6>&1
  echo "Setting sim profile = $sim_profile" 6>&1
fi],[sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1"])dnl
fi],[sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1"])dnl
AC_SUBST(sim_profile)
AC_SUBST(sim_profile)
 
 
 
 
dnl Types used by common code
dnl Types used by common code
AC_TYPE_SIGNAL
AC_TYPE_SIGNAL
 
 
dnl Detect exe extension
dnl Detect exe extension
AC_EXEEXT
AC_EXEEXT
 
 
dnl These are available to append to as desired.
dnl These are available to append to as desired.
sim_link_files=
sim_link_files=
sim_link_links=
sim_link_links=
 
 
dnl Create tconfig.h either from simulator's tconfig.in or default one
dnl Create tconfig.h either from simulator's tconfig.in or default one
dnl in common.
dnl in common.
sim_link_links=tconfig.h
sim_link_links=tconfig.h
if test -f ${srcdir}/tconfig.in
if test -f ${srcdir}/tconfig.in
then
then
  sim_link_files=tconfig.in
  sim_link_files=tconfig.in
else
else
  sim_link_files=../common/tconfig.in
  sim_link_files=../common/tconfig.in
fi
fi
 
 
# targ-vals.def points to the libc macro description file.
# targ-vals.def points to the libc macro description file.
case "${target}" in
case "${target}" in
*-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
*-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
esac
esac
sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
sim_link_links="${sim_link_links} targ-vals.def"
sim_link_links="${sim_link_links} targ-vals.def"
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.