linux: bump default version to 4.10.5
[buildroot-gz.git] / package / lirc-tools / 0002-configure-check-for-clock_gettime-in-librt.patch
blob710dfd3b05e2474c04f2dc5db28f2e6ad75e1d6d
1 From e654ae139cec42a6f1b5684261787d0c241cfd3b Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Fri, 19 Aug 2016 15:25:48 +0200
4 Subject: [PATCH] configure: check for clock_gettime in librt
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 ---
8 configure.ac | 3 +++
9 daemons/Makefile.am | 2 +-
10 plugins/Makefile.am | 1 +
11 3 files changed, 5 insertions(+), 1 deletion(-)
13 diff --git a/configure.ac b/configure.ac
14 index 73340c7..466e638 100644
15 --- a/configure.ac
16 +++ b/configure.ac
17 @@ -67,6 +67,9 @@ AC_CHECK_FUNCS(gethostname gettimeofday mkfifo select socket strdup \
18 AC_SEARCH_LIBS([dlopen], [dl dld], [], [
19 AC_MSG_ERROR([unable to find the dlopen() function])
21 +# glibc < 2.17 needs librt for clock_gettime()
22 +AC_CHECK_LIB(rt, clock_gettime, LIBCLOCK_GETTIME="-lrt")
23 +AC_SUBST(LIBCLOCK_GETTIME)
24 AC_CHECK_FUNCS(daemon)
25 if test "$ac_cv_func_daemon" != yes; then
26 daemon=""
27 diff --git a/daemons/Makefile.am b/daemons/Makefile.am
28 index 5625627..85a28f3 100644
29 --- a/daemons/Makefile.am
30 +++ b/daemons/Makefile.am
31 @@ -21,7 +21,7 @@ sbin_PROGRAMS += lircd-uinput
32 endif
34 lircd_SOURCES = lircd.cpp
35 -lircd_LDADD = ../lib/liblirc.la
36 +lircd_LDADD = ../lib/liblirc.la @LIBCLOCK_GETTIME@
38 lircd_uinput_SOURCES = lircd-uinput.cpp
39 lircd_uinput_LDADD = ../lib/liblirc.la
40 diff --git a/plugins/Makefile.am b/plugins/Makefile.am
41 index ddff01d..45c012a 100644
42 --- a/plugins/Makefile.am
43 +++ b/plugins/Makefile.am
44 @@ -127,6 +127,7 @@ zotac_la_SOURCES = zotac.c
46 plugin_LTLIBRARIES += mplay.la
47 mplay_la_SOURCES = mplay.c
48 +mplay_la_LIBADD = @LIBCLOCK_GETTIME@
49 endif
51 $(srcdir)/pluginlist.am:
52 --
53 2.7.4