summaryrefslogtreecommitdiff
path: root/package/weston/0003-configure-search-for-lib-with-clock_getres.patch
blob: a8ad9eaa0b30c09689b7fbfab37e37d58ce8957b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From e269012c4b919624ca92d80afd1d6a6f5399e041 Mon Sep 17 00:00:00 2001
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
Date: Mon, 19 Dec 2016 18:07:07 +0100
Subject: [PATCH] configure: search for lib with clock_getres()

Like clock_gettime(), clock_getres() is in -lrt for glibc < 2.17.
Add a check for it, like is done for clock_gettime().

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Upstream status: submitted
https://lists.freedesktop.org/archives/wayland-devel/2016-December/032354.html
---
 Makefile.am  | 1 +
 configure.ac | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 2219e3d..53f8f51 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -190,6 +190,7 @@ weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
 weston_LDADD = libshared.la libweston-@LIBWESTON_MAJOR@.la \
 	$(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
 	$(DLOPEN_LIBS) $(LIBINPUT_BACKEND_LIBS) \
+	$(CLOCK_GETRES_LIBS) \
 	-lm
 
 weston_SOURCES = 					\
diff --git a/configure.ac b/configure.ac
index 1e251bf..604f51b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,8 +88,9 @@ PKG_PROG_PKG_CONFIG()
 
 WESTON_SEARCH_LIBS([DLOPEN], [dl], [dlopen])
 
-# In old glibc versions (< 2.17) clock_gettime() is in librt
+# In old glibc versions (< 2.17) clock_gettime() and clock_getres() are in librt
 WESTON_SEARCH_LIBS([CLOCK_GETTIME], [rt], [clock_gettime])
+WESTON_SEARCH_LIBS([CLOCK_GETRES], [rt], [clock_getres])
 
 AC_CHECK_DECL(SFD_CLOEXEC,[],
 	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
-- 
2.7.4