Mercurial > hg > octave-shane > gnulib-hg
annotate m4/remainderf-ieee.m4 @ 17627:4d899884c95c
m4: fix gl_TIMER_TIME() detection of threads on uClibc
The timer_time.m4 gl_TIMER_TIME function determines which libraries
need to be linked to get access to the timer function, generally -lrt
for Linux systems. On platforms where threads are used, librt
typically uses thread functions from libpthread.
However, the test to determine whether the platform has thread or not
is incorrect: it assumes that if the C library is uClibc, then threads
are not available. This is actually not true: uClibc has configurable
thread support, and when thread support is available, librt calls
libpthread functions.
This is important when static linking is used, because otherwise only
-lrt is used at link time, which fails because librt calls undefined
thread functions. Both -lrt and -lpthread must be passed.
This problem is fixed by making the uClibc thread detection a bit
smarter, thanks to the usage of the __HAS_NO_THREADS__ macro defined
in <bits/uClibc_config.h>, which itself is included by <features.h>.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> |
---|---|
date | Sat, 22 Feb 2014 00:41:38 +0100 |
parents | 344018b6e5d7 |
children |
rev | line source |
---|---|
16498
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 # remainderf-ieee.m4 serial 1 |
17587 | 2 dnl Copyright (C) 2012-2014 Free Software Foundation, Inc. |
16498
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 dnl This macro is in a separate file (not in remainder.m4 and not inlined in the |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 dnl module description), so that gl_FUNC_REMAINDERF can test whether 'aclocal' |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 dnl has found uses of this macro. |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 AC_DEFUN([gl_FUNC_REMAINDERF_IEEE], |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 [ |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 m4_divert_text([INIT_PREPARE], [gl_remainderf_required=ieee]) |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 AC_REQUIRE([gl_FUNC_REMAINDERF]) |
e04c5a489c44
remainderf-ieee: Work around test failure on OSF/1.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 ]) |