* modules/gethrxtime: New file.
[gnulib.git] / m4 / xnanosleep.m4
1 # xnanosleep.m4 serial 1
2 dnl Copyright (C) 2005 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl Written by Paul Eggert.
8
9 AC_DEFUN([gl_XNANOSLEEP],
10 [
11   AC_LIBSOURCES([xnanosleep.c, xnanosleep.h])
12   AC_LIBOBJ([xnanosleep])
13
14   dnl Prerequisites of lib/xnanosleep.c.
15   AC_REQUIRE([gl_PREREQ_GETHRXTIME])
16
17   LIB_XNANOSLEEP=
18   case $LIB_GETHRXTIME in
19   ?*)
20     AC_CACHE_CHECK([whether __linux__ is defined],
21       gl_cv_have___linux__,
22       [AC_EGREP_CPP([have___linux__],
23         [
24 #        ifdef __linux__
25           have___linux__
26 #        endif
27         ],
28         gl_cv_have___linux__=yes,
29         gl_cv_have___linux__=no)])
30     if test $gl_cv_have___linux__ = yes; then
31       LIB_XNANOSLEEP=$LIB_GETHRXTIME
32     fi;;
33   esac
34   AC_SUBST([LIB_XNANOSLEEP])
35 ])