aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1997-04-17 22:26:31 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1997-04-17 22:26:31 +0000
commit63ddb6bd72bc7bb7c541bcb7be876b91467c70f3 (patch)
tree72ade9000d14876a7ca44e41ee81ed1da09952d0 /sim/common
parentb57d4d17d64d0402e2b8faa74ae70d540e5e0b9c (diff)
downloadfsf-binutils-gdb-63ddb6bd72bc7bb7c541bcb7be876b91467c70f3.zip
fsf-binutils-gdb-63ddb6bd72bc7bb7c541bcb7be876b91467c70f3.tar.gz
fsf-binutils-gdb-63ddb6bd72bc7bb7c541bcb7be876b91467c70f3.tar.bz2
* aclocal.m4: Check for headers time.h, sys/time.h, sys/resource.h.
Check for functions getrusage, time. * sim-basics.h (SIM_ELAPSED_TIME): New typedef. (sim_elapsed_time_get, sim_elapsed_time_since): Add prototypes. * sim-utils.c: #include time.h, sys/time.h, sys/resource.h if able. (sim_elapsed_time_get, sim_elapsed_time_since): New functions.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog7
-rw-r--r--sim/common/aclocal.m410
-rw-r--r--sim/common/sim-basics.h8
3 files changed, 23 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 22df2d5..f285cb1 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,12 @@
Thu Apr 17 02:25:11 1997 Doug Evans <dje@canuck.cygnus.com>
+ * aclocal.m4: Check for headers time.h, sys/time.h, sys/resource.h.
+ Check for functions getrusage, time.
+ * sim-basics.h (SIM_ELAPSED_TIME): New typedef.
+ (sim_elapsed_time_get, sim_elapsed_time_since): Add prototypes.
+ * sim-utils.c: #include time.h, sys/time.h, sys/resource.h if able.
+ (sim_elapsed_time_get, sim_elapsed_time_since): New functions.
+
* sim-utils.c (sim_copy_argv, sim_analyze_program): New functions.
* sim-options.c, sim-options.h: New files.
diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index 2e4e5a9..68896d0 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -30,7 +30,6 @@ AC_PROG_CC
AC_PROG_INSTALL
# Put a plausible default for CC_FOR_BUILD in Makefile.
-AC_C_CROSS
if test "x$cross_compiling" = "xno"; then
CC_FOR_BUILD='$(CC)'
else
@@ -45,7 +44,10 @@ AC_SUBST(AR)
AC_PROG_RANLIB
# Check for common headers.
-AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h)
+# FIXME: Seems to me this can cause problems for i386-windows hosts.
+# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
+AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h)
+AC_CHECK_FUNCS(getrusage time)
. ${srcdir}/../../bfd/configure.host
@@ -130,6 +132,10 @@ fi],[sim_trace=""])dnl
AC_SUBST(sim_trace)
+dnl Types used by common code
+AC_TYPE_SIGNAL
+
+
dnl These are available to append to as desired.
sim_link_files=
sim_link_links=
diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h
index f3db0e0..00f83a1 100644
--- a/sim/common/sim-basics.h
+++ b/sim/common/sim-basics.h
@@ -65,6 +65,14 @@ void *zalloc (unsigned long size);
void zfree(void*);
+/* Utilities for elapsed time reporting. */
+/* Opaque type, known only inside sim_elapsed_time_foo fns. */
+typedef unsigned long SIM_ELAPSED_TIME;
+/* Get reference point for future call to sim_time_elapsed. */
+SIM_ELAPSED_TIME sim_elapsed_time_get (void);
+/* Elapsed time in milliseconds since START. */
+unsigned long sim_elapsed_time_since (SIM_ELAPSED_TIME start);
+
/* Global types that code manipulates */