Mercurial > gnulib
annotate m4/usleep.m4 @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
16811
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
1 # usleep.m4 serial 3 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16811
diff
changeset
|
2 dnl Copyright (C) 2009-2013 Free Software Foundation, Inc. |
12315 | 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 This macro intentionally does not check for select or nanosleep; | |
8 dnl both of those modules can require external libraries. | |
9 AC_DEFUN([gl_FUNC_USLEEP], | |
10 [ | |
11 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) | |
12 dnl usleep was required in POSIX 2001, but dropped as obsolete in | |
13 dnl POSIX 2008; therefore, it is not always exposed in headers. | |
14 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | |
16811
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
15 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles |
12315 | 16 AC_CHECK_FUNCS_ONCE([usleep]) |
17 AC_CHECK_TYPE([useconds_t], [], | |
18 [AC_DEFINE([useconds_t], [unsigned int], [Define to an unsigned 32-bit | |
19 type if <sys/types.h> lacks this type.])]) | |
20 if test $ac_cv_func_usleep = no; then | |
21 HAVE_USLEEP=0 | |
22 else | |
23 dnl POSIX allows implementations to reject arguments larger than | |
24 dnl 999999, but GNU guarantees it will work. | |
25 AC_CACHE_CHECK([whether usleep allows large arguments], | |
26 [gl_cv_func_usleep_works], | |
27 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ | |
28 #include <unistd.h> | |
29 ]], [[return !!usleep (1000000);]])], | |
30 [gl_cv_func_usleep_works=yes], [gl_cv_func_usleep_works=no], | |
16811
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
31 [case "$host_os" in |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
32 # Guess yes on glibc systems. |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
33 *-gnu*) gl_cv_func_usleep_works="guessing yes" ;; |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
34 # If we don't know, assume the worst. |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
35 *) gl_cv_func_usleep_works="guessing no" ;; |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
36 esac |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
37 ])]) |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
38 case "$gl_cv_func_usleep_works" in |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
39 *yes) ;; |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
40 *) |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
41 REPLACE_USLEEP=1 |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
42 ;; |
b187fc49964b
Avoid "guessing no" guesses when cross-compiling to glibc systems.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
43 esac |
12315 | 44 fi |
45 ]) |