]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/common/acinclude.m4
sim: drop support for requiring hw support
[thirdparty/binutils-gdb.git] / sim / common / acinclude.m4
index 7f98903cc91324fb5918c0fed23d609493085a68..3e9fb2fe40a2f35723763311fd9d14f2f822a94d 100644 (file)
@@ -53,6 +53,9 @@ AR=${AR-ar}
 AC_SUBST(AR)
 AC_PROG_RANLIB
 
+dnl Pull in the target configuration file directly.
+AH_BOTTOM([#include "tconfig.h"])
+
 # Some of the common include files depend on bfd.h, and bfd.h checks
 # that config.h is included first by testing that the PACKAGE macro
 # is defined.
@@ -113,18 +116,7 @@ dnl all shall eventually behave the same way.
 
 dnl We don't use automake, but we still want to support
 dnl --enable-maintainer-mode.
-USE_MAINTAINER_MODE=no
-AC_ARG_ENABLE(maintainer-mode,
-[  --enable-maintainer-mode            Enable developer functionality.],
-[case "${enableval}" in
-  yes) MAINT="" USE_MAINTAINER_MODE=yes ;;
-  no)  MAINT="#" ;;
-  *)   AC_MSG_ERROR("--enable-maintainer-mode does not take a value"); MAINT="#" ;;
-esac
-if test x"$silent" != x"yes" && test x"$MAINT" = x""; then
-  echo "Setting maintainer mode" 6>&1
-fi],[MAINT="#"])dnl
-AC_SUBST(MAINT)
+AM_MAINTAINER_MODE
 
 
 dnl This is a generic option to enable special byte swapping
@@ -258,16 +250,6 @@ dnl These are available to append to as desired.
 sim_link_files=
 sim_link_links=
 
-dnl Create tconfig.h either from simulator's tconfig.in or default one
-dnl in common.
-sim_link_links=tconfig.h
-if test -f ${srcdir}/tconfig.in
-then
-  sim_link_files=tconfig.in
-else
-  sim_link_files=../common/tconfig.in
-fi
-
 # targ-vals.def points to the libc macro description file.
 case "${target}" in
 *-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
@@ -603,36 +585,39 @@ AC_SUBST(sim_default_model)
 
 
 dnl --enable-sim-hardware is for users of the simulator
-dnl arg[1] Enable sim-hw by default? ("yes", "no", or "always")
+dnl arg[1] Enable sim-hw by default? ("yes" or "no")
 dnl arg[2] is a space separated list of devices that override the defaults
 dnl arg[3] is a space separated list of extra target specific devices.
 AC_DEFUN([SIM_AC_OPTION_HARDWARE],
 [
 if test x"[$1]" != x"no"; then
-  sim_hw_p=yes
+  enable_sim_hardware=yes
 else
-  sim_hw_p=no
+  enable_sim_hardware=no
 fi
+
 if test "[$2]"; then
   hardware="[$2]"
 else
   hardware="cfi core pal glue"
 fi
 hardware="$hardware [$3]"
+
 sim_hw_cflags="-DWITH_HW=1"
 sim_hw="$hardware"
 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`"
+
 AC_ARG_ENABLE(sim-hardware,
-[  --enable-sim-hardware=LIST          Specify the hardware to be included in the build.],
-[
-case "${enableval}" in
-  yes) sim_hw_p=yes;;
-  no)  sim_hw_p=no;;
-  ,*)   sim_hw_p=yes; hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
-  *,)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
-  *)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
+  [AS_HELP_STRING([--enable-sim-hardware=LIST],
+                  [Specify the hardware to be included in the build.])])
+case ${enable_sim_hardware} in
+  yes|no) ;;
+  ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+  *,) hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+  *)  hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
 esac
-if test "$sim_hw_p" != yes; then
+
+if test "$enable_sim_hardware" = no; then
   sim_hw_objs=
   sim_hw_cflags="-DWITH_HW=0"
   sim_hw=
@@ -648,35 +633,24 @@ else
     esac
   done
   # mingw does not support sockser
-  SIM_DV_SOCKSER_O=""
   case ${host} in
     *mingw*) ;;
-    *) SIM_DV_SOCKSER_O="dv-sockser.o"
+    *) # TODO: We don't add dv-sockser to sim_hw as it is not a "real" device
+       # that you instatiate.  Instead, other code will call into it directly.
+       # At some point, we should convert it over.
+       sim_hw_objs="$sim_hw_objs dv-sockser.o"
        AC_DEFINE_UNQUOTED(
          [HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.])
        ;;
   esac
-  AC_SUBST(SIM_DV_SOCKSER_O)
-fi
-if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
-  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
-fi],[
-if test "$sim_hw_p" != yes; then
-  if test "[$1]" = "always"; then
-    AC_MSG_ERROR([Sorry, but this simulator requires that hardware support
-be enabled. Please configure without --disable-hw-support.])
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
   fi
-  sim_hw_objs=
-  sim_hw_cflags="-DWITH_HW=0"
-  sim_hw=
+  dnl Some devices require extra libraries.
+  case " $hardware " in
+    *" cfi "*) AC_CHECK_LIB(m, log2);;
+  esac
 fi
-if test x"$silent" != x"yes"; then
-  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
-fi])
-dnl Some devices require extra libraries.
-case " $hardware " in
-  *" cfi "*) AC_CHECK_LIB(m, log2);;
-esac
 ])
 AC_SUBST(sim_hw_cflags)
 AC_SUBST(sim_hw_objs)
@@ -870,20 +844,18 @@ if test "${ERROR_ON_WARNING}" = yes ; then
      true
 fi
 
-# The entries after -Wno-pointer-sign are disabled warnings which may
-# be enabled in the future, which can not currently be used to build
-# GDB.
-# NOTE: If you change this list, remember to update
-# gdb/doc/gdbint.texinfo.
 build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
--Wformat-nonliteral -Wno-pointer-sign \
+-Wpointer-sign \
 -Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts -Wmissing-prototypes"
+-Wno-switch -Wno-char-subscripts -Wmissing-prototypes
+-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
+-Wold-style-declaration -Wold-style-definition"
 
 # Enable -Wno-format by default when using gcc on mingw since many
 # GCC versions complain about %I64.
 case "${host}" in
   *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;;
+  *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
 esac
 
 AC_ARG_ENABLE(build-warnings,