summaryrefslogtreecommitdiff
path: root/mcon/U/d_ftime.U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U/d_ftime.U')
-rw-r--r--mcon/U/d_ftime.U52
1 files changed, 37 insertions, 15 deletions
diff --git a/mcon/U/d_ftime.U b/mcon/U/d_ftime.U
index 2b08090..7a8a6d1 100644
--- a/mcon/U/d_ftime.U
+++ b/mcon/U/d_ftime.U
@@ -1,18 +1,18 @@
-?RCS: $Id: d_ftime.U 1 2006-08-24 12:32:52Z rmanfredi $
+?RCS: $Id: d_ftime.U 167 2013-05-08 17:58:00Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
-?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: d_ftime.U,v $
?RCS: Revision 3.0 1993/08/18 12:06:06 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
-?MAKE:d_ftime d_gettimeod: Inlibc Setvar
+?MAKE:d_ftime d_gettimeod: Trylink cat i_systimeb
?MAKE: -pick add $@ %<
?S:d_ftime:
?S: This variable conditionally defines the HAS_FTIME symbol, which indicates
@@ -58,17 +58,39 @@
?X:
?X: Give priority to gettimeofday(2) because timing is more accurate
?X:
-set gettimeofday d_gettimeod
-eval $inlibc
-case "$d_gettimeod" in
-"$undef")
- set ftime d_ftime
- eval $inlibc
- ;;
-*)
- val="$undef"; set d_ftime; eval $setvar
- ;;
-esac
+$cat >try.c <<EOC
+#include <sys/time.h>
+int main(void)
+{
+ static struct timeval tv;
+ static void *tz;
+ static int ret;
+ ret |= gettimeofday(&tv, tz);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=gettimeofday
+set d_gettimeod
+eval $trylink
+
+$cat >try.c <<EOC
+#include <sys/types.h>
+#$i_systimeb I_SYS_TIMEB
+#ifdef I_SYS_TIMEB
+#include <sys/timeb.h>
+#endif
+int main(void)
+{
+ static struct timeb t;
+ static int ret;
+ ret |= ftime(&t);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=ftime
+set d_ftime
+eval $trylink
+
case "$d_gettimeod$d_ftime" in
"$undef$undef")
echo " "