summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavo@zacarias.com.ar>2016-04-21 11:18:48 -0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-04-22 11:13:04 +0300
commit34d59859475fdbaf0332c487987a9f1f23922e64 (patch)
tree763d74f4cc77530ea5e948d9ed29cdf51b617e0c /configure.ac
parentfd01ba055d118eaf9b51aac2f93b9a9b697e31a8 (diff)
downloadweston-34d59859475fdbaf0332c487987a9f1f23922e64.tar.gz
build: add check for clock_gettime() in librt
zuctest is another clock_gettime() user that fails to link against librt when necessary. Instead of adding another -lrt LDADD entry i've opted for the saner way and converted the check to a configure test that will set CLOCK_GETTIME_LIBS appropiately and replaced all instances of -lrt with it. Built-tested against old and new glibc. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 447cf6b2..670200cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,11 @@ AC_CHECK_FUNC([dlopen], [],
AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
AC_SUBST(DLOPEN_LIBS)
+# In old glibc versions (< 2.17) clock_gettime() is in librt
+AC_SEARCH_LIBS([clock_gettime], [rt],
+ [CLOCK_GETTIME_LIBS="-lrt"])
+AC_SUBST([CLOCK_GETTIME_LIBS])
+
AC_CHECK_DECL(SFD_CLOEXEC,[],
[AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
[[#include <sys/signalfd.h>]])