Thread (1 message) 1 message, 1 author, 2013-09-06

Re: [PATCH] build: use -lrt for clock_gettime on glibc < 2.17

From: Dirk-Jan C. Binnema <hidden>
Date: 2013-09-06 08:07:02

Hi Marcel,

marcel@holtmann.org writes:
Hi Dirk-Jan,,
quoted
glibc before 2.17 (e.g., fedora 18) requires -lrt for clock_gettime.
AC_SEARCH_LIBS adds it to LIBS in that case
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 050d30d..403e323 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,7 @@ AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
AC_CHECK_FUNC(signalfd, dummy=yes,
			AC_MSG_ERROR(signalfd support is required))

+AC_SEARCH_LIBS(clock_gettime,rt)
I do like this since this now it links everything with -lrt even if it is not needed.
Hmm, I suppose there's a missing 'not'...

Note, AC_SEARCH_LIBS tries without rt first, and only adds -lrt if
clock_gettime is not defined without it.

Or did you mean building parts of bluez without -lrt in the glibc < 2.17
case? If so, please see my next patch, which only uses -lrt (if needed)
for bluetoothd.

Cheers,
Dirk.


-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help