From: Michael Jeanson Date: Wed, 3 Aug 2016 21:59:16 +0000 (-0400) Subject: Port: Detect platforms where librt is required X-Git-Tag: v2.9.0-rc1~62 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fbc08f38de61a27756c2e667715db8dce7fcb15e;p=lttng-tools.git Port: Detect platforms where librt is required Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/configure.ac b/configure.ac index aa4220de7..5cfe97315 100644 --- a/configure.ac +++ b/configure.ac @@ -127,6 +127,10 @@ AC_CHECK_FUNCS([ \ strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \ ]) +# Check if clock_gettime, timer_create, timer_settime, and timer_delete are available in lib rt, and if so, +# add -lrt to LIBS +AC_CHECK_LIB([rt], [clock_gettime, timer_create, timer_settime, timer_delete]) + # Babeltrace viewer check AC_ARG_WITH([babeltrace-bin], AS_HELP_STRING([--with-babeltrace-bin], diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am index 7c6b0275e..acb8d7d44 100644 --- a/src/bin/lttng-consumerd/Makefile.am +++ b/src/bin/lttng-consumerd/Makefile.am @@ -13,8 +13,7 @@ lttng_consumerd_LDADD = \ $(top_builddir)/src/common/libcommon.la \ $(top_builddir)/src/common/index/libindex.la \ $(top_builddir)/src/common/health/libhealth.la \ - $(top_builddir)/src/common/testpoint/libtestpoint.la \ - -lrt + $(top_builddir)/src/common/testpoint/libtestpoint.la if HAVE_LIBLTTNG_UST_CTL lttng_consumerd_LDADD += -llttng-ust-ctl diff --git a/src/bin/lttng-relayd/Makefile.am b/src/bin/lttng-relayd/Makefile.am index 07eb73223..4857074df 100644 --- a/src/bin/lttng-relayd/Makefile.am +++ b/src/bin/lttng-relayd/Makefile.am @@ -23,7 +23,7 @@ lttng_relayd_SOURCES = main.c lttng-relayd.h utils.h utils.c cmd.h \ tracefile-array.c tracefile-array.h # link on liblttngctl for check if relayd is already alive. -lttng_relayd_LDADD = -lrt -lurcu-common -lurcu \ +lttng_relayd_LDADD = -lurcu-common -lurcu \ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/hashtable/libhashtable.la \ diff --git a/src/bin/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am index 29f48c9cc..423866139 100644 --- a/src/bin/lttng-sessiond/Makefile.am +++ b/src/bin/lttng-sessiond/Makefile.am @@ -42,7 +42,7 @@ endif lttng_sessiond_SOURCES += lttng-sessiond.h main.c # link on liblttngctl for check if sessiond is already alive. -lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ +lttng_sessiond_LDADD = -lurcu-common -lurcu \ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 37c451a45..e63ddeb73 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -76,7 +76,6 @@ libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ filter.c filter.h context.c context.h libcommon_la_LIBADD = \ - -lrt \ $(top_builddir)/src/common/config/libconfig.la if LTTNG_BUILD_WITH_LIBUUID libcommon_la_LIBADD += -luuid diff --git a/src/common/sessiond-comm/Makefile.am b/src/common/sessiond-comm/Makefile.am index 32ec058b3..8f0a839b6 100644 --- a/src/common/sessiond-comm/Makefile.am +++ b/src/common/sessiond-comm/Makefile.am @@ -6,4 +6,3 @@ noinst_LTLIBRARIES = libsessiond-comm.la libsessiond_comm_la_SOURCES = sessiond-comm.c sessiond-comm.h \ inet.c inet.h inet6.c inet6.h \ relayd.h agent.h -libsessiond_comm_la_LIBADD = -lrt