Mercurial > hg > octave-jordi > gnulib-hg
annotate m4/nanosleep.m4 @ 18070:d460ec17f09f
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Tue, 28 Jul 2015 13:57:32 -0700 |
parents | ab58d4870664 |
children |
rev | line source |
---|---|
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16828
diff
changeset
|
1 # serial 36 |
2052 | 2 |
3 dnl From Jim Meyering. | |
2066 | 4 dnl Check for the nanosleep function. |
5 dnl If not found, use the supplied replacement. | |
2052 | 6 dnl |
7 | |
17848 | 8 # Copyright (C) 1999-2001, 2003-2015 Free Software Foundation, Inc. |
6671
5a2089992925
* modules/gettime (Depends-on): Add extensions module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6275
diff
changeset
|
9 |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
10 # This file is free software; the Free Software Foundation |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
11 # gives unlimited permission to copy and/or distribute it, |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
12 # with or without modifications, as long as this notice is preserved. |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5016
diff
changeset
|
13 |
5016
7141ea4946af
Change jm_ to gl_ in AC_DEFINE'd names. Update all uses.
Jim Meyering <jim@meyering.net>
parents:
4910
diff
changeset
|
14 AC_DEFUN([gl_FUNC_NANOSLEEP], |
2052 | 15 [ |
16827
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
16 AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
17 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
18 |
6795
9dc5bb3f3359
* lib/nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6744
diff
changeset
|
19 dnl Persuade glibc and Solaris <time.h> to declare nanosleep. |
9dc5bb3f3359
* lib/nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6744
diff
changeset
|
20 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
9dc5bb3f3359
* lib/nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6744
diff
changeset
|
21 |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10245
diff
changeset
|
22 AC_CHECK_HEADERS_ONCE([sys/time.h]) |
12328
bf3fd58aaf19
nanosleep: improve port to mingw
Eric Blake <ebb9@byu.net>
parents:
12327
diff
changeset
|
23 AC_REQUIRE([gl_FUNC_SELECT]) |
6795
9dc5bb3f3359
* lib/nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6744
diff
changeset
|
24 |
2491
9108f5af9d61
(jm_FUNC_NANOSLEEP): Save and restore LIBS around
Jim Meyering <jim@meyering.net>
parents:
2267
diff
changeset
|
25 nanosleep_save_libs=$LIBS |
9108f5af9d61
(jm_FUNC_NANOSLEEP): Save and restore LIBS around
Jim Meyering <jim@meyering.net>
parents:
2267
diff
changeset
|
26 |
2065
e1a744db4db5
(jm_FUNC_NANOSLEEP): Search for nanosleep in -lrt
Jim Meyering <jim@meyering.net>
parents:
2055
diff
changeset
|
27 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. |
e1a744db4db5
(jm_FUNC_NANOSLEEP): Search for nanosleep in -lrt
Jim Meyering <jim@meyering.net>
parents:
2055
diff
changeset
|
28 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. |
12169
d9a855dec815
don't let environment settings perturb build
Jim Meyering <meyering@redhat.com>
parents:
11069
diff
changeset
|
29 LIB_NANOSLEEP= |
12182
8ba00f285749
m4: stylistic-only: hoist AC_SUBST to be adjacent to initialization
Jim Meyering <meyering@redhat.com>
parents:
12169
diff
changeset
|
30 AC_SUBST([LIB_NANOSLEEP]) |
4910 | 31 AC_SEARCH_LIBS([nanosleep], [rt posix4], |
32 [test "$ac_cv_search_nanosleep" = "none required" || | |
12169
d9a855dec815
don't let environment settings perturb build
Jim Meyering <meyering@redhat.com>
parents:
11069
diff
changeset
|
33 LIB_NANOSLEEP=$ac_cv_search_nanosleep]) |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
34 if test "x$ac_cv_search_nanosleep" != xno; then |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
35 dnl The system has a nanosleep function. |
2065
e1a744db4db5
(jm_FUNC_NANOSLEEP): Search for nanosleep in -lrt
Jim Meyering <jim@meyering.net>
parents:
2055
diff
changeset
|
36 |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
37 AC_REQUIRE([gl_MULTIARCH]) |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
38 if test $APPLE_UNIVERSAL_BUILD = 1; then |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16828
diff
changeset
|
39 # A universal build on Apple Mac OS X platforms. |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
40 # The test result would be 'no (mishandles large arguments)' in 64-bit |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
41 # mode but 'yes' in 32-bit mode. But we need a configuration result that |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
42 # is valid in both modes. |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
43 gl_cv_func_nanosleep='no (mishandles large arguments)' |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
44 fi |
11069
8488a80e49bc
nanosleep: skip configure test (fail it) for apple universal builds
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
45 |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
46 AC_CACHE_CHECK([for working nanosleep], |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
47 [gl_cv_func_nanosleep], |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
48 [ |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
49 AC_RUN_IFELSE( |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
50 [AC_LANG_SOURCE([[ |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
51 #include <errno.h> |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
52 #include <limits.h> |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
53 #include <signal.h> |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
54 #if HAVE_SYS_TIME_H |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
55 #include <sys/time.h> |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
56 #endif |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
57 #include <time.h> |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
58 #include <unistd.h> |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
59 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
60 #define TYPE_MAXIMUM(t) \ |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
61 ((t) (! TYPE_SIGNED (t) \ |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
62 ? (t) -1 \ |
14249
52b55b447c02
TYPE_MAXIMUM: avoid theoretically undefined behavior
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
63 : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) |
7237
119870bc83d7
Work around a bug in both the Linux and SunOS 64-bit kernels:
Paul Eggert <eggert@cs.ucla.edu>
parents:
7172
diff
changeset
|
64 |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
65 static void |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
66 check_for_SIGALRM (int sig) |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
67 { |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
68 if (sig != SIGALRM) |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
69 _exit (1); |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
70 } |
2052 | 71 |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
72 int |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
73 main () |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
74 { |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
75 static struct timespec ts_sleep; |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
76 static struct timespec ts_remaining; |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
77 static struct sigaction act; |
16827
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
78 /* Test for major problems first. */ |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
79 if (! nanosleep) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
80 return 2; |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
81 act.sa_handler = check_for_SIGALRM; |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
82 sigemptyset (&act.sa_mask); |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
83 sigaction (SIGALRM, &act, NULL); |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
84 ts_sleep.tv_sec = 0; |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
85 ts_sleep.tv_nsec = 1; |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
86 alarm (1); |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
87 if (nanosleep (&ts_sleep, NULL) != 0) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
88 return 3; |
16827
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
89 /* Test for a minor problem: the handling of large arguments. */ |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
90 ts_sleep.tv_sec = TYPE_MAXIMUM (time_t); |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
91 ts_sleep.tv_nsec = 999999999; |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
92 alarm (1); |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
93 if (nanosleep (&ts_sleep, &ts_remaining) != -1) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
94 return 4; |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
95 if (errno != EINTR) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
96 return 5; |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
97 if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
98 return 6; |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
99 return 0; |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
100 }]])], |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
101 [gl_cv_func_nanosleep=yes], |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
102 [case $? in dnl ( |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13134
diff
changeset
|
103 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl ( |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
104 *) gl_cv_func_nanosleep=no;; |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
105 esac], |
16827
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
106 [case "$host_os" in dnl (( |
16828
47595604fd62
nanosleep: Fix typo in comment.
Jim Meyering <meyering@redhat.com>
parents:
16827
diff
changeset
|
107 linux*) # Guess it halfway works when the kernel is Linux. |
16827
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
108 gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
109 *) # If we don't know, assume the worst. |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
110 gl_cv_func_nanosleep='guessing no' ;; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
111 esac |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
112 ]) |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
113 ]) |
16827
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
114 case "$gl_cv_func_nanosleep" in |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
115 *yes) |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
116 REPLACE_NANOSLEEP=0 |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
117 ;; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
118 *) |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
119 REPLACE_NANOSLEEP=1 |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
120 case "$gl_cv_func_nanosleep" in |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
121 *"mishandles large arguments"*) |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
122 AC_DEFINE([HAVE_BUG_BIG_NANOSLEEP], [1], |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
123 [Define to 1 if nanosleep mishandles large arguments.]) |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
124 ;; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
125 *) |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
126 # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP. |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
127 for ac_lib in $LIBSOCKET; do |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
128 case " $LIB_NANOSLEEP " in |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
129 *" $ac_lib "*) ;; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
130 *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
131 esac |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
132 done |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
133 ;; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
134 esac |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
135 ;; |
fa47ffe05247
nanosleep: Avoid guessing wrong when cross-compiling to Linux.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
136 esac |
13134
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
137 else |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
138 HAVE_NANOSLEEP=0 |
080377ada58c
nanosleep: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
139 fi |
2491
9108f5af9d61
(jm_FUNC_NANOSLEEP): Save and restore LIBS around
Jim Meyering <jim@meyering.net>
parents:
2267
diff
changeset
|
140 LIBS=$nanosleep_save_libs |
2052 | 141 ]) |
4108
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3486
diff
changeset
|
142 |
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3486
diff
changeset
|
143 # Prerequisites of lib/nanosleep.c. |
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3486
diff
changeset
|
144 AC_DEFUN([gl_PREREQ_NANOSLEEP], |
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3486
diff
changeset
|
145 [ |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10245
diff
changeset
|
146 AC_CHECK_HEADERS_ONCE([sys/select.h]) |
10245
18a5b4f796a2
Update after lib/sig-handler.h is no longer included by lib/sigprocmask.c.
Bruno Haible <bruno@clisp.org>
parents:
10230
diff
changeset
|
147 gl_PREREQ_SIG_HANDLER_H |
4108
c1d472db5c30
An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents:
3486
diff
changeset
|
148 ]) |