]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: enable hardware support by default
authorMike Frysinger <vapier@gentoo.org>
Fri, 23 Apr 2021 20:24:27 +0000 (16:24 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 27 Apr 2021 02:30:55 +0000 (22:30 -0400)
Force this on for all ports.  We have a few common models that can
be used, so make them generally available.  If the port doesn't use
any hardware (the default), then behavior is unchanged.

96 files changed:
sim/ChangeLog
sim/aarch64/ChangeLog
sim/aarch64/aclocal.m4
sim/aarch64/config.in
sim/aarch64/configure
sim/arm/ChangeLog
sim/arm/aclocal.m4
sim/arm/config.in
sim/arm/configure
sim/avr/ChangeLog
sim/avr/aclocal.m4
sim/avr/config.in
sim/avr/configure
sim/bpf/ChangeLog
sim/bpf/aclocal.m4
sim/bpf/config.in
sim/bpf/configure
sim/cr16/ChangeLog
sim/cr16/aclocal.m4
sim/cr16/config.in
sim/cr16/configure
sim/d10v/ChangeLog
sim/d10v/aclocal.m4
sim/d10v/config.in
sim/d10v/configure
sim/erc32/ChangeLog
sim/erc32/aclocal.m4
sim/erc32/config.in
sim/erc32/configure
sim/example-synacor/ChangeLog
sim/example-synacor/aclocal.m4
sim/example-synacor/config.in
sim/example-synacor/configure
sim/frv/ChangeLog
sim/frv/configure
sim/frv/configure.ac
sim/ft32/ChangeLog
sim/ft32/aclocal.m4
sim/ft32/config.in
sim/ft32/configure
sim/h8300/ChangeLog
sim/h8300/aclocal.m4
sim/h8300/config.in
sim/h8300/configure
sim/iq2000/ChangeLog
sim/iq2000/configure
sim/iq2000/configure.ac
sim/m32c/ChangeLog
sim/m32c/aclocal.m4
sim/m32c/config.in
sim/m32c/configure
sim/m4/sim_ac_output.m4
sim/mcore/ChangeLog
sim/mcore/aclocal.m4
sim/mcore/config.in
sim/mcore/configure
sim/microblaze/ChangeLog
sim/microblaze/aclocal.m4
sim/microblaze/config.in
sim/microblaze/configure
sim/moxie/ChangeLog
sim/moxie/aclocal.m4
sim/moxie/config.in
sim/moxie/configure
sim/msp430/ChangeLog
sim/msp430/aclocal.m4
sim/msp430/config.in
sim/msp430/configure
sim/or1k/ChangeLog
sim/or1k/aclocal.m4
sim/or1k/config.in
sim/or1k/configure
sim/pru/ChangeLog
sim/pru/aclocal.m4
sim/pru/config.in
sim/pru/configure
sim/riscv/ChangeLog
sim/riscv/aclocal.m4
sim/riscv/config.in
sim/riscv/configure
sim/rl78/ChangeLog
sim/rl78/aclocal.m4
sim/rl78/config.in
sim/rl78/configure
sim/rx/ChangeLog
sim/rx/aclocal.m4
sim/rx/config.in
sim/rx/configure
sim/sh/ChangeLog
sim/sh/aclocal.m4
sim/sh/config.in
sim/sh/configure
sim/v850/ChangeLog
sim/v850/aclocal.m4
sim/v850/config.in
sim/v850/configure

index fdeed7d8f53b8fa363e1a333ac5cbbb26f2fd78d..51ca4926c733bf452ac22e84b732ae04e64d0fe7 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * m4/sim_ac_output.m4 (SIM_AC_OUTPUT): Require SIM_AC_OPTION_HARDWARE.
+
 2021-04-23  Mike Frysinger  <vapier@gentoo.org>
 
        * README-HACKING (SIM_AC_OPTION_HARDWARE): Delete first two args.
index 30257c2d8365f4a487ed2a70c10050df48ae198c..23736d6b842d96a3c9afb8c1cd38c74455b48de1 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 22d4678c12f7fb29d2d4a64177afca8eee76b4db..1d6a498f02033c350f75521b53f92676ae23375f 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index fbd977c3722c33c0a17668e69255a1a0dc2aec8a..c466deb6fefc485694ebea46a7336f431a455fef 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-26  Nick Clifton  <nickc@redhat.com>
 
        PR 22790
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 2a74bb745fe86ec0334042a913a2aa089693ab81..8cabf9261bffdcff1a8d3882ba65af82da0cde00 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index c8f51eb0c4eb641511c801909d95bcbc211c2d8e..9c53284bcfc1b6b700a161215aac70e5d13d7fd1 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index ae50e462452b599b5d2b2a2b2f8b823fae141916..5c43b2964dfe81036d3f381a96aba15e54f3b1d6 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 9021585021311399066ca8f389113f96c226065c..e5e223122bc2e224c8e2f63bc4990b108d36a9b3 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index 73a795c9e9d42d4a780eb983dfbeb71c83dc690c..e1659b4fa6a50fb1fdcb9ceb943e55f6344b5932 100644 (file)
@@ -118,6 +118,7 @@ m4_include([../m4/sim_ac_option_cgen_maint.m4])
 m4_include([../m4/sim_ac_option_default_model.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_scache.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 31e7c8209af47312058925cf7ffacd32b0a3d791..32b4a77529e0561f8a2417e06ad4ba00e85e937c 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_float
 cgen_breaks
 cgen
@@ -758,6 +755,9 @@ WERROR_CFLAGS
 WARN_CFLAGS
 sim_scache
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_default_model
 sim_bitsize
@@ -792,6 +792,7 @@ enable_werror
 enable_build_warnings
 enable_sim_build_warnings
 enable_cgen_maint
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1457,6 +1458,8 @@ Optional Features:
                           enable SIM specific build-time compiler warnings if
                           gcc is used
   --enable-cgen-maint=DIR build cgen generated files
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11196,7 +11199,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11199 "configure"
+#line 11202 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11302,7 +11305,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11305 "configure"
+#line 11308 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 4be46d603e85c70dd6eca1b8c7ae8fc416b6e440..2540c3734715aadf7820c8673e2f58ef4dc4f159 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * simops.c: Update includes.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index f0cfde9164b9f818aa3db1bdcb7b8d71a39c5f4f..b0d92cef4ab4a2a3a79757d5faa5e93a17556ab3 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12030,6 +12033,107 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 22d1e8fdf836c1207b7bb9df26f9e822865f3452..9945be49a8f502b025ec200b43ba84d0151da601 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index c02a02b8be93b3fbd8f804efb35ea1884eaa6394..3daef523520120dc2b19260f596224d9c5b6a09c 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12030,6 +12033,107 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 0a7d0339f028fe391106e72c23f8acbdd91e3c6f..a6d1cad82342b95581507d2a157db79202c2a9d3 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index db8c5cd5c13a55b9237fdafb2e8fa96a0dd38968..ed052697cd9edabca5799ff125f2bf7424474c75 100644 (file)
@@ -113,6 +113,7 @@ m4_include([../../lt~obsolete.m4])
 m4_include([../m4/sim_ac_common.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index eab6d868247a301fb4bf2c263f442a98457938df..a884ee7d2eaf015e4c3c0a8d203f3ef60ad535c2 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -761,7 +758,10 @@ PATH_SEPARATOR
 SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
-sim_inline'
+sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -786,6 +786,7 @@ with_bugurl
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1440,6 +1441,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11179,7 +11182,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11182 "configure"
+#line 11185 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11285,7 +11288,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11288 "configure"
+#line 11291 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index a5c868bb9ec3e5b16534fa34c8d4d15d7082452c..886509303d151879ea0e3d4b3bb62bf133d14ceb 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 7fab5fac9e1f505bc65a5257e7b9d008acdbac04..a5938bef338f03c91fef8f547aeeddd8b3ff944d 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12030,6 +12033,107 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index bc981ac1d1e48981b9ae7ff7c9df2a95bc2cc660..645239900f328b36e9cd92d6a37030ef0715e6ff 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete call.
+       * configure: Regenerate.
+
 2021-04-23  Mike Frysinger  <vapier@gentoo.org>
 
        * configure.ac (SIM_AC_OPTION_HARDWARE): Delete arguments.
index 30c7c817c13326402ebe88334fee24d5dd63faae..921f6221f6b5f9dc863676d873b99b23703fd8bc 100755 (executable)
@@ -12231,7 +12231,6 @@ fi
 fi
 
 
-
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 6588fe5e87e70b52655a6af5455b3ce94c3f894d..e5bbdbfba22815675b86746fc470ddf6ebaffb63 100644 (file)
@@ -27,6 +27,4 @@ if test x"$silent" != x"yes" && test x"$sim_trapdump" != x""; then
 fi],[sim_trapdump=""])dnl
 AC_SUBST(sim_trapdump)
 
-SIM_AC_OPTION_HARDWARE
-
 SIM_AC_OUTPUT
index 0a06ef30c8dc7d64e9c541c95fc0f8fe48bb12ea..6a2643622c8911c733f6f58c0f799f4ef6e48513 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 2f14e5a35bba53b8de8887b706619ae3d24e49db..d80f8f82e18059a752c7e1dc353cc512686573a5 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 0a02c9c7255eb4637ddcbba2c05ec4e94487dc7e..c3daaf4d7959eb86d459a6a044f35a845ba2eafa 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index fbed42af1edf4af05217658b5ecf7a757ccf2b1c..505aa8cf5f9323b599e294746d114dc239a25db6 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 682019b1e220d9b665453d742482da1237d45a8b..fd7bc25b626628759454b3ab2877c51d2985b012 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11184,7 +11187,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11187 "configure"
+#line 11190 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11290,7 +11293,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11293 "configure"
+#line 11296 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index addf3c6387cf893163854ca0f39504e33a1fcbfa..ffb7ab9da54d779bad063b2e4cabd683c20515f8 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * configure.ac (SIM_AC_OPTION_HARDWARE): Delete call.
+       * configure: Regenerate.
+
 2021-04-23  Mike Frysinger  <vapier@gentoo.org>
 
        * configure.ac (SIM_AC_OPTION_HARDWARE): Delete arguments.
index 21b500c807939cd5dc227bf16e278a4e24003548..0607bc6db7ffa5ea3c79872cce7cf6fb3c597c9d 100755 (executable)
@@ -12210,7 +12210,6 @@ fi
 fi
 
 
-
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index f21bc804bdd80113b45a0d3de1e84290bd19fe34..623fa192d74bb23298f72bda571ebe81269092e3 100644 (file)
@@ -11,6 +11,4 @@ SIM_AC_OPTION_DEFAULT_MODEL(iq2000)
 SIM_AC_OPTION_WARNINGS(no)
 SIM_AC_OPTION_CGEN_MAINT
 
-SIM_AC_OPTION_HARDWARE
-
 SIM_AC_OUTPUT
index 2919dc40bc7d972d839e9bf1156ff8d40327e759..c2991c60f86fc59db0a8e20ba744438d707c1941 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index db8c5cd5c13a55b9237fdafb2e8fa96a0dd38968..ed052697cd9edabca5799ff125f2bf7424474c75 100644 (file)
@@ -113,6 +113,7 @@ m4_include([../../lt~obsolete.m4])
 m4_include([../m4/sim_ac_common.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index aaa80a5fa2e41f41bc996a1dbf28b621bfd2e0d9..3b33610fa42e1a9eac9485f1add214c88c5edb04 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 2e2ed73de2c1970ecacee55a1bc14a90a3c5e5ca..c0fa44f22a19024af8ef0291c8d39779dae291ae 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -758,7 +755,10 @@ PATH_SEPARATOR
 SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
-sim_inline'
+sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -783,6 +783,7 @@ with_bugurl
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1437,6 +1438,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11181,7 +11184,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11184 "configure"
+#line 11187 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11287,7 +11290,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11290 "configure"
+#line 11293 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 9ec566d8acd20a96ee703cc874965350ad0e1d5a..b18f2540f70b9f11df1fe3cd8b46c025e3204f0e 100644 (file)
@@ -22,6 +22,7 @@ dnl the target's fragment at the appropriate points.
 AC_DEFUN([SIM_AC_OUTPUT],
 [dnl
 AC_REQUIRE([SIM_AC_OPTION_WARNINGS])dnl
+AC_REQUIRE([SIM_AC_OPTION_HARDWARE])dnl
 
 dnl Make @cgen_breaks@ non-null only if the sim uses CGEN.
 cgen_breaks=""
index 9e700dc130d9bebbf277337a15ccb167ee8a7ed5..815cd1a7c693ff15c44b6a5b928178b45f26b836 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 25f04f5db5d8a5c6520f24c732b5d9bc1b64a1f8..afd78ba045799d78ce3b4747e6751b613276c9b2 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 089c15a8db5d040483dfc56db8b73089b75499ce..5d6957b71011f7e5aa9abc358d30ed9ef7b067a0 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 2a74bb745fe86ec0334042a913a2aa089693ab81..8cabf9261bffdcff1a8d3882ba65af82da0cde00 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index ff2b8ebf3d525d664ed1f3350875e0a45a8e06a7..3e74d3fbd577eb6d56197f9306da193649eb6f47 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 23e04baa74bb0e38cd08ea2dee2826eda4f9bc27..0314c64751757a4a6b8bd1b9d4c8c15480a3c4b6 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -758,6 +755,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -786,6 +786,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1445,6 +1446,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11184,7 +11187,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11187 "configure"
+#line 11190 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11290,7 +11293,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11293 "configure"
+#line 11296 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12124,6 +12127,107 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index ed87e9f5af7e0e0d41427df15a220e8001baecd3..3d14ecbbd59fd73b2bf4701fb2bb3a29e25cf0b9 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index ae50e462452b599b5d2b2a2b2f8b823fae141916..5c43b2964dfe81036d3f381a96aba15e54f3b1d6 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index b4404f0114ff66fc5f36c07a813329443ca1d011..dd34d45653c856c79d95f31cf487d9fa5b5d5167 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index 73a795c9e9d42d4a780eb983dfbeb71c83dc690c..e1659b4fa6a50fb1fdcb9ceb943e55f6344b5932 100644 (file)
@@ -118,6 +118,7 @@ m4_include([../m4/sim_ac_option_cgen_maint.m4])
 m4_include([../m4/sim_ac_option_default_model.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_scache.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 4a7f8be385ce8e66075ebb78a03dbd52efa9ddab..9e2040e1969c9acbc3d0ebc9d23d03ec5ddc6e7d 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_float
 cgen_breaks
 cgen
@@ -758,6 +755,9 @@ WERROR_CFLAGS
 WARN_CFLAGS
 sim_scache
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_default_model
 sim_bitsize
@@ -792,6 +792,7 @@ enable_werror
 enable_build_warnings
 enable_sim_build_warnings
 enable_cgen_maint
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1457,6 +1458,8 @@ Optional Features:
                           enable SIM specific build-time compiler warnings if
                           gcc is used
   --enable-cgen-maint=DIR build cgen generated files
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11196,7 +11199,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11199 "configure"
+#line 11202 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11302,7 +11305,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11305 "configure"
+#line 11308 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 833dcc5f673483600833d2c4332e4e6c085c2c52..926fe2dd1ac0886d760ec50014036cc621f2f745 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index ae50e462452b599b5d2b2a2b2f8b823fae141916..5c43b2964dfe81036d3f381a96aba15e54f3b1d6 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 90abdf955a9370f5bf722e7b78e9c2bd110f621c..099391332151fb5cd7a76a68348d94b8194f6b56 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index bc1ef4630603fa492e000dcfda45d44755ad5b55..9710f3ff176f826948d3030a904f8176e4c9b746 100644 (file)
@@ -117,6 +117,7 @@ m4_include([../m4/sim_ac_option_bitsize.m4])
 m4_include([../m4/sim_ac_option_default_model.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 29f0c4ca380b1406a7d89efe3c3a8f7c58a197e1..96f4fff56a66ca6f9ec70428ca1f46ab8fa40049 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_scache
 sim_float
 cgen_breaks
@@ -755,6 +752,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_default_model
 sim_bitsize
@@ -787,6 +787,7 @@ enable_build_warnings
 enable_sim_build_warnings
 enable_sim_default_model
 enable_sim_bitsize
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1449,6 +1450,8 @@ Optional Features:
   --enable-sim-default-model=model
                           Specify default model to simulate
   --enable-sim-bitsize=N  Specify target bitsize (32 or 64)
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11188,7 +11191,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11191 "configure"
+#line 11194 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11294,7 +11297,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11297 "configure"
+#line 11300 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index b8d10b6ecc2bbc111fbfdb28b4d798d1eb0bb6e0..4adb625dbf1dcce3e4dd48235b59919ed6590d5f 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index db8c5cd5c13a55b9237fdafb2e8fa96a0dd38968..ed052697cd9edabca5799ff125f2bf7424474c75 100644 (file)
@@ -113,6 +113,7 @@ m4_include([../../lt~obsolete.m4])
 m4_include([../m4/sim_ac_common.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index a53a2b4099ad24806c0598da0b81849558026302..0a612701e3a8fbc0dd92646c277a75ebd1bb05f0 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -758,7 +755,10 @@ PATH_SEPARATOR
 SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
-sim_inline'
+sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -783,6 +783,7 @@ with_bugurl
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1437,6 +1438,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11176,7 +11179,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11179 "configure"
+#line 11182 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11282,7 +11285,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11285 "configure"
+#line 11288 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index bfb417dda00ce270f398dcbae65ec2b05b68e0d8..fbc8516152833fc363c2e846df742689386031c7 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index db8c5cd5c13a55b9237fdafb2e8fa96a0dd38968..ed052697cd9edabca5799ff125f2bf7424474c75 100644 (file)
@@ -113,6 +113,7 @@ m4_include([../../lt~obsolete.m4])
 m4_include([../m4/sim_ac_common.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 9d69487723e10a997ab0799575a0724de6af18d4..7cb68b3f535bb4db755a830917bb4286ec646c7c 100644 (file)
@@ -19,6 +19,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -34,6 +37,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 7a2f9eac6a30c1d50addbc3c00e64beb9103ef60..e227982e361cd43fa6e86f5dc63f70d253bd717a 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -758,7 +755,10 @@ PATH_SEPARATOR
 SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
-sim_inline'
+sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -785,6 +785,7 @@ enable_cycle_stats
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1442,6 +1443,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11181,7 +11184,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11184 "configure"
+#line 11187 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11287,7 +11290,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11290 "configure"
+#line 11293 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11973,6 +11976,107 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 98d1f35e63ccb28ba6d27dc8847c04e0c24b7159..d89fe2802f48917a4eb24052ad6311391ca2dc42 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * interp.c: Update includes.
index ddeb1f56430d367decc80af0fbb273adae8044dc..4300d0eac67d57c5e742a36ababf4a81a6d927a1 100644 (file)
@@ -115,6 +115,7 @@ m4_include([../m4/sim_ac_option_alignment.m4])
 m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
 m4_include([../m4/sim_ac_output.m4])
index 2416b7f038ccbbd15b3c8d917535e38d7ef9363a..8d37b72597d95f4deeb5d51f3d8fc9fb6bbf0ab7 100644 (file)
@@ -13,6 +13,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H
 
@@ -28,6 +31,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index 25f04f5db5d8a5c6520f24c732b5d9bc1b64a1f8..afd78ba045799d78ce3b4747e6751b613276c9b2 100755 (executable)
@@ -634,9 +634,6 @@ ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_reserved_bits
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -757,6 +754,9 @@ SHELL
 WERROR_CFLAGS
 WARN_CFLAGS
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_alignment'
 ac_subst_files=''
@@ -785,6 +785,7 @@ enable_sim_alignment
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1444,6 +1445,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11183,7 +11186,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11186 "configure"
+#line 11189 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11289,7 +11292,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11292 "configure"
+#line 11295 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
index 82a1d7452ec3df0e9409faa6767d29d1de2eb656..d46aa599e9fc7216995ececfa560bc12482d35a8 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-26  Mike Frysinger  <vapier@gentoo.org>
+
+       * aclocal.m4, config.in, configure: Regenerate.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
        * configure, config.in: Rebuild.
index a0d32d4c12ba362b801928a91b9ffb4b71890d54..02c11131338a000c815b2e8c87a86b29d60d39ed 100644 (file)
@@ -116,6 +116,7 @@ m4_include([../m4/sim_ac_option_assert.m4])
 m4_include([../m4/sim_ac_option_bitsize.m4])
 m4_include([../m4/sim_ac_option_endian.m4])
 m4_include([../m4/sim_ac_option_environment.m4])
+m4_include([../m4/sim_ac_option_hardware.m4])
 m4_include([../m4/sim_ac_option_inline.m4])
 m4_include([../m4/sim_ac_option_reserved_bits.m4])
 m4_include([../m4/sim_ac_option_warnings.m4])
index 1eb9e297ca902a229b44eb7fdc16fc78396cafb6..8249d7cbd87134b39bf32fa17e7f428bc1a4800f 100644 (file)
@@ -19,6 +19,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
+/* Define if dv-sockser is usable. */
+#undef HAVE_DV_SOCKSER
+
 /* Define to 1 if you have the `execv' function. */
 #undef HAVE_EXECV
 
@@ -43,6 +46,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
index aa74f6afbb851ebf944476ed7528c47885399d8d..d5941decb1eb23d2b756da4ea2a22eff3238c929 100755 (executable)
@@ -633,9 +633,6 @@ ac_header_list=
 ac_func_list=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
-sim_hw
-sim_hw_objs
-sim_hw_cflags
 sim_default_model
 sim_scache
 sim_float
@@ -756,6 +753,9 @@ WERROR_CFLAGS
 WARN_CFLAGS
 sim_reserved_bits
 sim_inline
+sim_hw
+sim_hw_objs
+sim_hw_cflags
 sim_endian
 sim_bitsize
 sim_alignment'
@@ -787,6 +787,7 @@ enable_sim_bitsize
 enable_werror
 enable_build_warnings
 enable_sim_build_warnings
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1450,6 +1451,8 @@ Optional Features:
   --enable-sim-build-warnings
                           enable SIM specific build-time compiler warnings if
                           gcc is used
+  --enable-sim-hardware=LIST
+                          Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -11196,7 +11199,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11199 "configure"
+#line 11202 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11302,7 +11305,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11305 "configure"
+#line 11308 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12135,6 +12138,107 @@ $as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; }
 fi
 
 
+hardware="cfi core pal glue "
+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'`"
+
+# Check whether --enable-sim-hardware was given.
+if test "${enable_sim_hardware+set}" = set; then :
+  enableval=$enable_sim_hardware;
+else
+  enable_sim_hardware="yes"
+fi
+
+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 "$enable_sim_hardware" = no; then
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+else
+  sim_hw_cflags="-DWITH_HW=1"
+  # remove duplicates
+  sim_hw=""
+  sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
+  for i in $hardware ; do
+    case " $sim_hw " in
+      *" $i "*) ;;
+      *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
+    esac
+  done
+  # mingw does not support sockser
+  case ${host} in
+    *mingw*) ;;
+    *) # 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"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+  if test x"$silent" != x"yes"; then
+    echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+  fi
+    case " $hardware " in
+    *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5
+$as_echo_n "checking for log2 in -lm... " >&6; }
+if ${ac_cv_lib_m_log2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char log2 ();
+int
+main ()
+{
+return log2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_log2=yes
+else
+  ac_cv_lib_m_log2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_log2" >&5
+$as_echo "$ac_cv_lib_m_log2" >&6; }
+if test "x$ac_cv_lib_m_log2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+  esac
+fi
+
+
 cgen_breaks=""
 if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";