2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com>
[deliverable/binutils-gdb.git] / sim / common / acinclude.m4
index 2833d8e9e53c431846b3de782ae9e078a3031fc6..7f98903cc91324fb5918c0fed23d609493085a68 100644 (file)
 # Include global overrides and fixes for Autoconf.
 m4_include(../../config/override.m4)
 sinclude([../../config/zlib.m4])
+m4_include([../../config/plugins.m4])
+m4_include([../../libtool.m4])
+m4_include([../../ltoptions.m4])
+m4_include([../../ltsugar.m4])
+m4_include([../../ltversion.m4])
+m4_include([../../lt~obsolete.m4])
 sinclude([../../config/depstand.m4])
 
 AC_DEFUN([SIM_AC_COMMON],
@@ -29,6 +35,7 @@ AC_REQUIRE([AC_PROG_CC])
 # autoconf.info says this should be called right after AC_INIT.
 AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in)
 AC_CANONICAL_SYSTEM
+AC_USE_SYSTEM_EXTENSIONS
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 
@@ -46,6 +53,13 @@ AR=${AR-ar}
 AC_SUBST(AR)
 AC_PROG_RANLIB
 
+# Some of the common include files depend on bfd.h, and bfd.h checks
+# that config.h is included first by testing that the PACKAGE macro
+# is defined.
+PACKAGE=sim
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ])
+AC_SUBST(PACKAGE)
+
 # Dependency checking.
 ZW_CREATE_DEPDIR
 ZW_PROG_COMPILER_DEPENDENCIES([CC])
@@ -82,6 +96,12 @@ AC_CHECK_LIB(nsl, gethostbyname)
 # using the same condition.
 AM_ZLIB
 
+# BFD uses libdl when when plugins enabled.
+AC_PLUGINS
+AM_CONDITIONAL(PLUGINS, test "$plugins" = yes)
+LT_INIT([dlopen])
+AC_SUBST(lt_cv_dlopen_libs)
+
 . ${srcdir}/../../bfd/configure.host
 
 dnl Standard (and optional) simulator options.
@@ -583,12 +603,12 @@ AC_SUBST(sim_default_model)
 
 
 dnl --enable-sim-hardware is for users of the simulator
-dnl arg[1] Enable sim-hw by default? ("yes" or "no")
+dnl arg[1] Enable sim-hw by default? ("yes", "no", or "always")
 dnl arg[2] is a space separated list of devices that override the defaults
 dnl arg[3] is a space separated list of extra target specific devices.
 AC_DEFUN([SIM_AC_OPTION_HARDWARE],
 [
-if test x"[$1]" = x"yes"; then
+if test x"[$1]" != x"no"; then
   sim_hw_p=yes
 else
   sim_hw_p=no
@@ -627,11 +647,25 @@ else
       *) 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"
+       AC_DEFINE_UNQUOTED(
+         [HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.])
+       ;;
+  esac
+  AC_SUBST(SIM_DV_SOCKSER_O)
 fi
 if test x"$silent" != x"yes" && test "$sim_hw_p" = "yes"; then
   echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
 fi],[
 if test "$sim_hw_p" != yes; then
+  if test "[$1]" = "always"; then
+    AC_MSG_ERROR([Sorry, but this simulator requires that hardware support
+be enabled. Please configure without --disable-hw-support.])
+  fi
   sim_hw_objs=
   sim_hw_cflags="-DWITH_HW=0"
   sim_hw=
This page took 0.024274 seconds and 4 git commands to generate.