1 From d3be03464be7fa3844dfe0837a7e2c920c107836 Mon Sep 17 00:00:00 2001
2 From: Baruch Siach <baruch@tkos.co.il>
3 Date: Thu, 23 Jul 2015 13:35:35 +0300
4 Subject: [PATCH] configure.ac: detect -lrt requirement for clock_gettime
6 glibc versions before 2.17 require link with -lrt.
8 Upstream status: sent, stuck in moderator's queue
10 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
12 configure.ac | 8 ++++++++
13 unix/Makefile.am | 4 ++--
14 2 files changed, 10 insertions(+), 2 deletions(-)
16 diff --git a/configure.ac b/configure.ac
17 index 18401f161d45..6b350a41a916 100644
20 @@ -854,6 +854,14 @@ OPENIPMI_SWIG_SO="${PYTHON_POSIX_SO}:\$(top_builddir)/lib/.libs/libOpenIPMI.so:\
21 AC_SUBST(OPENIPMI_SWIG_LIBS)
22 AC_SUBST(OPENIPMI_SWIG_SO)
26 +AC_SEARCH_LIBS([clock_gettime], [rt],
27 + [test "$ac_cv_search_clock_gettime" = "none required" ||
28 + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
29 +AC_SUBST([LIB_CLOCK_GETTIME])
32 # Everything from here to AC_OUTPUT is for libedit
34 # AC_PROG_LIBTOOL runs AC_CANONICAL_HOST
35 diff --git a/unix/Makefile.am b/unix/Makefile.am
36 index a108bc679c9a..fb60242d5d3b 100644
37 --- a/unix/Makefile.am
38 +++ b/unix/Makefile.am
39 @@ -9,13 +9,13 @@ lib_LTLIBRARIES = libOpenIPMIposix.la libOpenIPMIpthread.la
41 libOpenIPMIpthread_la_SOURCES = posix_thread_os_hnd.c selector.c
42 libOpenIPMIpthread_la_LIBADD = -lpthread $(GDBM_LIB) \
43 - $(top_builddir)/utils/libOpenIPMIutils.la
44 + $(top_builddir)/utils/libOpenIPMIutils.la $(LIB_CLOCK_GETTIME)
45 libOpenIPMIpthread_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
46 -Wl,-Map -Wl,libOpenIPMIpthread.map
48 libOpenIPMIposix_la_SOURCES = posix_os_hnd.c selector.c
49 libOpenIPMIposix_la_LIBADD = $(top_builddir)/utils/libOpenIPMIutils.la \
51 + $(GDBM_LIB) $(LIB_CLOCK_GETTIME)
52 libOpenIPMIposix_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
53 -Wl,-Map -Wl,libOpenIPMIposix.map