summaryrefslogtreecommitdiff
path: root/m4/nanosleep.m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-01-19 20:40:51 +0000
committerJim Meyering <jim@meyering.net>2000-01-19 20:40:51 +0000
commit9393315a069e23ae2e09eb595c6f4968d7118e50 (patch)
treedc8d18ae37aef2ea3cfcd31c2e0284ea00054d93 /m4/nanosleep.m4
parent7990f92f1585755f30bac1e58dbe5bc25c457a0d (diff)
downloadcoreutils-9393315a069e23ae2e09eb595c6f4968d7118e50.tar.xz
(jm_FUNC_NANOSLEEP): Include <sys/time.h>, too.
Use AC_HEADER_TIME. Volker Borchert reported that OpenBSD-2.3/sparc defines `struct timespec' in <sys/time.h>
Diffstat (limited to 'm4/nanosleep.m4')
-rw-r--r--m4/nanosleep.m415
1 files changed, 13 insertions, 2 deletions
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4
index 88cecd550..03958049e 100644
--- a/m4/nanosleep.m4
+++ b/m4/nanosleep.m4
@@ -13,8 +13,19 @@ AC_DEFUN(jm_FUNC_NANOSLEEP,
AC_CACHE_CHECK([whether nanosleep works],
jm_cv_func_nanosleep_works,
- [AC_TRY_RUN([
-# include <time.h>
+ [
+ AC_HEADER_TIME
+ AC_TRY_RUN([
+# if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+# else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+# endif
int
main ()