2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com>
authorJoel Sherrill <joel.sherrill@oarcorp.com>
Sat, 23 Mar 2013 15:07:30 +0000 (15:07 +0000)
committerJoel Sherrill <joel.sherrill@oarcorp.com>
Sat, 23 Mar 2013 15:07:30 +0000 (15:07 +0000)
* configure.ac: Fail if dv-sockser.o not available.
Error when --disable-sim-hardware is specified.
* configure: Regenerated.

12 files changed:
sim/frv/ChangeLog
sim/frv/configure
sim/frv/configure.ac
sim/iq2000/ChangeLog
sim/iq2000/configure
sim/iq2000/configure.ac
sim/m32r/ChangeLog
sim/m32r/configure
sim/m32r/configure.ac
sim/sh64/ChangeLog
sim/sh64/configure
sim/sh64/configure.ac

index c9af6e88dc4cd6995be74a2d456eb1981a3ec7cb..0dded856dae20ae73167b42dac60b5962b744ed3 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>
+
+       * configure.ac: Fail if dv-sockser.o not available.
+       Error when --disable-sim-hardware is specified.
+       * configure: Regenerated.
+
 2012-06-15  Joel Brobecker  <brobecker@adacore.com>
 
        * config.in, configure: Regenerate.
index 84ee7836f00c3cc841513d0f18dbba1b8865e1f9..297873a67185429783e9221cdb962398b6623bd8 100755 (executable)
@@ -601,6 +601,7 @@ ac_includes_default="\
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 cgen_breaks
+SIM_DV_SOCKSER_O
 sim_trapdump
 cgen
 cgendir
@@ -769,6 +770,7 @@ enable_sim_default_model
 enable_sim_environment
 enable_cgen_maint
 enable_sim_trapdump
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1418,6 +1420,7 @@ Optional Features:
   --enable-sim-environment=environment Specify mixed, user, virtual or operating environment.
   --enable-cgen-maint=DIR    build cgen generated files
   --enable-sim-trapdump                Make unknown traps dump the registers
+  --enable-sim-hardware=LIST           Specify the hardware to be included in the build.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -12274,7 +12277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12277 "configure"
+#line 12280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12380,7 +12383,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12383 "configure"
+#line 12386 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+if test x"always" != x"no"; then
+  sim_hw_p=yes
+else
+  sim_hw_p=no
+fi
+if test """"; then
+  hardware=""""
+else
+  hardware="cfi core pal glue"
+fi
+hardware="$hardware """
+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;
+case "${enableval}" in
+  yes) sim_hw_p=yes;;
+  no)  sim_hw_p=no;;
+  ,*)   sim_hw_p=yes; hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+  *,)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+  *)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
+esac
+if test "$sim_hw_p" != yes; 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
+  SIM_DV_SOCKSER_O=""
+  case ${host} in
+    *mingw*) ;;
+    *) SIM_DV_SOCKSER_O="dv-sockser.o"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+
+fi
+if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+else
+
+if test "$sim_hw_p" != yes; then
+  if test "always" = "always"; then
+    as_fn_error "Sorry, but this simulator requires that hardware support
+be enabled. Please configure without --disable-hw-support." "$LINENO" 5
+  fi
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+fi
+if test x"$silent" != x"yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+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 test "${ac_cv_lib_m_log2+set}" = set; 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" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+esac
+
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       as_fn_error "Sorry, but hardware support in this simulator
+unconditionally relies on dv-sockser.o which is unavailable for your host.
+Please fix this simulator." "$LINENO" 5
+fi
+
+
 ac_sources="$sim_link_files"
 ac_dests="$sim_link_links"
 while test -n "$ac_sources"; do
index 7f2b7ed8d9fd03e4a02f1f9bfc032d1acb7c566f..68487abc2f3c867604ebaf5051354f3c1767d078 100644 (file)
@@ -28,4 +28,12 @@ if test x"$silent" != x"yes" && test x"$sim_trapdump" != x""; then
 fi],[sim_trapdump=""])dnl
 AC_SUBST(sim_trapdump)
 
+SIM_AC_OPTION_HARDWARE(always,"","")
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       AC_MSG_ERROR([Sorry, but hardware support in this simulator
+unconditionally relies on dv-sockser.o which is unavailable for your host.
+Please fix this simulator.])
+fi
+
 SIM_AC_OUTPUT
index 553c8ef9a45328749c914aed641e67bcff865207..b22b4f4c29b058665f8389b1fb3055c7bbe41be1 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>
+
+       * configure.ac: Fail if dv-sockser.o not available.
+       Error when --disable-sim-hardware is specified.
+       * configure: Regenerated.
+
 2012-06-15  Joel Brobecker  <brobecker@adacore.com>
 
        * config.in, configure: Regenerate.
index b70a129bc766c0cd317e8a16fcbfadd3b6a5e643..7eda691b1699eeb5412ad621f69ab64e9fc06efb 100755 (executable)
@@ -601,6 +601,7 @@ ac_includes_default="\
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 cgen_breaks
+SIM_DV_SOCKSER_O
 cgen
 cgendir
 CGEN_MAINT
@@ -768,6 +769,7 @@ enable_sim_default_model
 enable_sim_environment
 enable_sim_inline
 enable_cgen_maint
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1417,6 +1419,7 @@ Optional Features:
   --enable-sim-environment=environment Specify mixed, user, virtual or operating environment.
   --enable-sim-inline=inlines          Specify which functions should be inlined.
   --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]
@@ -12273,7 +12276,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12276 "configure"
+#line 12279 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12379,7 +12382,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12382 "configure"
+#line 12385 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+if test x"always" != x"no"; then
+  sim_hw_p=yes
+else
+  sim_hw_p=no
+fi
+if test """"; then
+  hardware=""""
+else
+  hardware="cfi core pal glue"
+fi
+hardware="$hardware """
+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;
+case "${enableval}" in
+  yes) sim_hw_p=yes;;
+  no)  sim_hw_p=no;;
+  ,*)   sim_hw_p=yes; hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+  *,)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+  *)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
+esac
+if test "$sim_hw_p" != yes; 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
+  SIM_DV_SOCKSER_O=""
+  case ${host} in
+    *mingw*) ;;
+    *) SIM_DV_SOCKSER_O="dv-sockser.o"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+
+fi
+if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+else
+
+if test "$sim_hw_p" != yes; then
+  if test "always" = "always"; then
+    as_fn_error "Sorry, but this simulator requires that hardware support
+be enabled. Please configure without --disable-hw-support." "$LINENO" 5
+  fi
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+fi
+if test x"$silent" != x"yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+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 test "${ac_cv_lib_m_log2+set}" = set; 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" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+esac
+
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       as_fn_error "Sorry, but hardware support in this simulator
+unconditionally relies on dv-sockser.o which is unavailable for your host.
+Please fix this simulator." "$LINENO" 5
+fi
+
+
 ac_sources="$sim_link_files"
 ac_dests="$sim_link_links"
 while test -n "$ac_sources"; do
index 2484b005588329709a944c7e170bc607d5f4ff08..38e0690916907fdf6a61e2c9fd45f0cb2e70ae4a 100644 (file)
@@ -14,4 +14,12 @@ SIM_AC_OPTION_ENVIRONMENT
 SIM_AC_OPTION_INLINE()
 SIM_AC_OPTION_CGEN_MAINT
 
+SIM_AC_OPTION_HARDWARE(always,"","")
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       AC_MSG_ERROR([Sorry, but hardware support in this simulator
+unconditionally relies on dv-sockser.o which is unavailable for your host.
+Please fix this simulator.])
+fi
+
 SIM_AC_OUTPUT
index e0cf4917bb1ac039da0fc29d8f18402a16b65c12..173993f2881dadbd2b731f27f54523b1f340276c 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>
+
+       * configure.ac: Fail if dv-sockser.o not available.
+       Error when --disable-sim-hardware is specified.
+       * configure: Regenerated.
+
 2012-06-15  Joel Brobecker  <brobecker@adacore.com>
 
        * config.in, configure: Regenerate.
index 40a109fcede2262694044b6d8a9ad5ec0af8625e..cfa7baeaecabf8f402d99bd8f59ce19c96a293ae 100755 (executable)
@@ -601,6 +601,7 @@ ac_includes_default="\
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 cgen_breaks
+SIM_DV_SOCKSER_O
 sim_extra_cflags
 traps_obj
 cgen
@@ -770,6 +771,7 @@ enable_sim_default_model
 enable_sim_environment
 enable_sim_inline
 enable_cgen_maint
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1419,6 +1421,7 @@ Optional Features:
   --enable-sim-environment=environment Specify mixed, user, virtual or operating environment.
   --enable-sim-inline=inlines          Specify which functions should be inlined.
   --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]
@@ -12275,7 +12278,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12278 "configure"
+#line 12281 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12381,7 +12384,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12384 "configure"
+#line 12387 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+if test x"always" != x"no"; then
+  sim_hw_p=yes
+else
+  sim_hw_p=no
+fi
+if test """"; then
+  hardware=""""
+else
+  hardware="cfi core pal glue"
+fi
+hardware="$hardware """
+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;
+case "${enableval}" in
+  yes) sim_hw_p=yes;;
+  no)  sim_hw_p=no;;
+  ,*)   sim_hw_p=yes; hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+  *,)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+  *)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
+esac
+if test "$sim_hw_p" != yes; 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
+  SIM_DV_SOCKSER_O=""
+  case ${host} in
+    *mingw*) ;;
+    *) SIM_DV_SOCKSER_O="dv-sockser.o"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+
+fi
+if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+else
+
+if test "$sim_hw_p" != yes; then
+  if test "always" = "always"; then
+    as_fn_error "Sorry, but this simulator requires that hardware support
+be enabled. Please configure without --disable-hw-support." "$LINENO" 5
+  fi
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+fi
+if test x"$silent" != x"yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+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 test "${ac_cv_lib_m_log2+set}" = set; 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" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+esac
+
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       as_fn_error "Sorry, but hardware support in this simulator unconditionally
+relies on dv-sockser.o which is unavailable for your host. Please fix this
+simulator." "$LINENO" 5
+fi
+
+
 
 ac_sources="$sim_link_files"
 ac_dests="$sim_link_links"
index fff2a2646a92525f21b6feb500d57f8b385016f5..f0422a2c3481887ee1872b362a15e24852b79937 100644 (file)
@@ -27,5 +27,13 @@ SIM_AC_OPTION_CGEN_MAINT
 AC_SUBST(traps_obj)
 AC_SUBST(sim_extra_cflags)
 
+SIM_AC_OPTION_HARDWARE(always,"","")
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       AC_MSG_ERROR([Sorry, but hardware support in this simulator unconditionally
+relies on dv-sockser.o which is unavailable for your host. Please fix this
+simulator.])
+fi
+
 
 SIM_AC_OUTPUT
index 25751be0a5fd664cdb2dfcb8345000e120779171..0ba5b2d9a0cdc4799cd8dff30059310a25b01a6f 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>
+
+       * configure.ac: Fail if dv-sockser.o not available.
+       Error when --disable-sim-hardware is specified.
+       * configure: Regenerated.
+
 2012-06-15  Joel Brobecker  <brobecker@adacore.com>
 
        * config.in, configure: Regenerate.
index fb8a72ddcaaf651545e6bdb4f7a09bf297804fc5..2577ba5c4b532ba1107a46671b9ce9ecf2d959de 100755 (executable)
@@ -601,6 +601,7 @@ ac_includes_default="\
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 cgen_breaks
+SIM_DV_SOCKSER_O
 cgen
 cgendir
 CGEN_MAINT
@@ -768,6 +769,7 @@ enable_sim_default_model
 enable_sim_environment
 enable_sim_inline
 enable_cgen_maint
+enable_sim_hardware
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1417,6 +1419,7 @@ Optional Features:
   --enable-sim-environment=environment Specify mixed, user, virtual or operating environment.
   --enable-sim-inline=inlines          Specify which functions should be inlined.
   --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]
@@ -12273,7 +12276,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12276 "configure"
+#line 12279 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12379,7 +12382,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12382 "configure"
+#line 12385 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 
 
 
+if test x"always" != x"no"; then
+  sim_hw_p=yes
+else
+  sim_hw_p=no
+fi
+if test """"; then
+  hardware=""""
+else
+  hardware="cfi core pal glue"
+fi
+hardware="$hardware """
+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;
+case "${enableval}" in
+  yes) sim_hw_p=yes;;
+  no)  sim_hw_p=no;;
+  ,*)   sim_hw_p=yes; hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
+  *,)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
+  *)   sim_hw_p=yes; hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
+esac
+if test "$sim_hw_p" != yes; 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
+  SIM_DV_SOCKSER_O=""
+  case ${host} in
+    *mingw*) ;;
+    *) SIM_DV_SOCKSER_O="dv-sockser.o"
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DV_SOCKSER 1
+_ACEOF
+
+       ;;
+  esac
+
+fi
+if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+else
+
+if test "$sim_hw_p" != yes; then
+  if test "always" = "always"; then
+    as_fn_error "Sorry, but this simulator requires that hardware support
+be enabled. Please configure without --disable-hw-support." "$LINENO" 5
+  fi
+  sim_hw_objs=
+  sim_hw_cflags="-DWITH_HW=0"
+  sim_hw=
+fi
+if test x"$silent" != x"yes"; then
+  echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
+fi
+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 test "${ac_cv_lib_m_log2+set}" = set; 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" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+;;
+esac
+
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       as_fn_error "Sorry, but hardware support in this simulator
+unconditionally relies on dv-sockser.o which is unavailable for your host.
+Please fix this simulator." "$LINENO" 5
+fi
+
+
 ac_sources="$sim_link_files"
 ac_dests="$sim_link_links"
 while test -n "$ac_sources"; do
@@ -15595,3 +15726,4 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
 
+
index d719ee08c4b91c2ecbee18cc126bc1457c2cce1e..1ce3e756c5c180e3aa8f5189cd1744f218fb8db6 100644 (file)
@@ -14,4 +14,13 @@ SIM_AC_OPTION_ENVIRONMENT
 SIM_AC_OPTION_INLINE()
 SIM_AC_OPTION_CGEN_MAINT
 
+SIM_AC_OPTION_HARDWARE(always,"","")
+
+if test -z "$SIM_DV_SOCKSER_O"; then
+       AC_MSG_ERROR([Sorry, but hardware support in this simulator
+unconditionally relies on dv-sockser.o which is unavailable for your host.
+Please fix this simulator.])
+fi
+
 SIM_AC_OUTPUT
+