From: c.briere@samsung.com (Charles Briere)
Subject: [lttng-dev] [PATCH lttng-tools 04/24] Fix : Only link librt if available
Date: Mon, 27 Oct 2014 20:49:28 +0000 [thread overview]
Message-ID: <1414442926-14381-5-git-send-email-c.briere@samsung.com> (raw)
In-Reply-To: <1414442926-14381-1-git-send-email-c.briere@samsung.com>
From: Charles Briere <c.briere@samsung.com>
Signed-off-by: Charles Briere <c.briere at samsung.com>
---
configure.ac | 15 ++++++++++++++-
src/bin/lttng-consumerd/Makefile.am | 2 +-
src/bin/lttng-relayd/Makefile.am | 2 +-
src/bin/lttng-sessiond/Makefile.am | 2 +-
src/common/Makefile.am | 2 +-
src/common/sessiond-comm/Makefile.am | 3 ++-
tests/regression/tools/live/Makefile.am | 3 ++-
tests/unit/Makefile.am | 9 ++++++---
8 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index 487a2b9..8703284 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,6 +167,19 @@ AC_CHECK_LIB([uuid], [uuid_generate],
])
]
)
+
+# Check for librt
+AC_CHECK_LIB([rt], [shm_open],
+[
+ AC_SUBST(LIBRT, '-lrt')
+ librt='-lrt'
+],
+[
+ AC_SUBST(LIBRT, '')
+ ilibrt=''
+]
+)
+
AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
@@ -247,7 +260,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [
lttng_ust_ctl_found=yes
],
[AC_MSG_ERROR([Cannot find LTTng-UST >= 2.2.x. Use --with-lttng-ust-prefix=PREFIX to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])],
- [-lurcu-common -lurcu-bp -lurcu-cds -lrt]
+ [-lurcu-common -lurcu-bp -lurcu-cds $librt]
)
])
AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am
index 28034ca..8d7a675 100644
--- a/src/bin/lttng-consumerd/Makefile.am
+++ b/src/bin/lttng-consumerd/Makefile.am
@@ -14,7 +14,7 @@ lttng_consumerd_LDADD = \
$(top_builddir)/src/common/index/libindex.la \
$(top_builddir)/src/common/health/libhealth.la \
$(top_builddir)/src/common/testpoint/libtestpoint.la \
- -lrt
+ @LIBRT@
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 126cdaf..4700f1a 100644
--- a/src/bin/lttng-relayd/Makefile.am
+++ b/src/bin/lttng-relayd/Makefile.am
@@ -20,7 +20,7 @@ lttng_relayd_SOURCES = main.c lttng-relayd.h utils.h utils.c cmd.h \
connection.c connection.h
# link on liblttngctl for check if relayd is already alive.
-lttng_relayd_LDADD = -lrt -lurcu-common -lurcu \
+lttng_relayd_LDADD = @LIBRT@ -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 7819222..cf75082 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 = @LIBRT@ -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 3a2f4f0..974ce7c 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -21,7 +21,7 @@ libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \
daemonize.c daemonize.h
libcommon_la_LIBADD = \
-luuid \
- -lrt \
+ @LIBRT@ \
$(top_builddir)/src/common/config/libconfig.la
# Consumer library
diff --git a/src/common/sessiond-comm/Makefile.am b/src/common/sessiond-comm/Makefile.am
index fdffa40..23d8e68 100644
--- a/src/common/sessiond-comm/Makefile.am
+++ b/src/common/sessiond-comm/Makefile.am
@@ -6,4 +6,5 @@ noinst_LTLIBRARIES = libsessiond-comm.la
libsessiond_comm_la_SOURCES = sessiond-comm.c sessiond-comm.h \
unix.c unix.h inet.c inet.h inet6.c inet6.h \
relayd.h agent.h
-libsessiond_comm_la_LIBADD = -lrt
+
+libsessiond_comm_la_LIBADD = @LIBRT@
diff --git a/tests/regression/tools/live/Makefile.am b/tests/regression/tools/live/Makefile.am
index ea5f417..4b99022 100644
--- a/tests/regression/tools/live/Makefile.am
+++ b/tests/regression/tools/live/Makefile.am
@@ -30,7 +30,8 @@ endif
live_test_SOURCES = live_test.c
live_test_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
- $(LIBHASHTABLE) $(LIBHEALTH) -lrt
+ $(LIBHASHTABLE) $(LIBHEALTH) @LIBRT@
+
live_test_LDADD += $(LIVE) \
$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am
index dd3dd8c..169ab68 100644
--- a/tests/unit/Makefile.am
+++ b/tests/unit/Makefile.am
@@ -43,7 +43,8 @@ SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.o \
test_session_SOURCES = test_session.c
test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
- $(LIBHASHTABLE) -lrt
+ $(LIBHASHTABLE) @LIBRT@
+
test_session_LDADD += $(SESSIONS)
# UST data structures unit test
@@ -67,7 +68,8 @@ UST_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-ust.o \
test_ust_data_SOURCES = test_ust_data.c
test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM)\
- $(LIBHASHTABLE) -lrt -llttng-ust-ctl
+ $(LIBHASHTABLE) @LIBRT@ -llttng-ust-ctl
+
test_ust_data_LDADD += $(UST_DATA_TRACE)
endif
@@ -82,7 +84,8 @@ KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.o \
test_kernel_data_SOURCES = test_kernel_data.c
test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
- $(LIBHASHTABLE) -lrt
+ $(LIBHASHTABLE) @LIBRT@
+
test_kernel_data_LDADD += $(KERN_DATA_TRACE)
# utils suffix for unit test
--
2.1.2
next prev parent reply other threads:[~2014-10-27 20:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 20:49 [lttng-dev] Fixes for Android Charles Briere
2014-10-27 20:49 ` Charles Briere [this message]
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 01/24] Fix : wait.h should be sys/wait.h according to posix and android doesn't redirect wait.h to sys/wait.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 03/24] Fix : Wrap variable with URCU_TLS for sizeof Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 08/24] Fix : Don't compile ust functions when not enabled Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 07/24] Fix : need to include config.h if using it's definitions Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 06/24] Fix : Do not redeclare gettid if found Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 05/24] Fix : Do not use gLibc specific macros Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 02/24] Fix : Include sys/stat.h where needed Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 11/24] Add : Compatibility layer for limit.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 13/24] Add : Compatibility layer for un.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 15/24] Add : Compatibility layer for stat.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 10/24] Add : Compatibility layer for netinet/in.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 17/24] Add : Compatibility layer for pthread Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 12/24] Add : Compatibility layer for ulimit.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 16/24] Add : Compatibility layer for pwd.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 14/24] Add : Compatibility layer for signal.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 09/24] Add : Compatibility layer for syscall.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 22/24] Android : Missing defintion in fcntl.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 20/24] Android : %m[^] not supported in fscanf Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 24/24] Android : Add splice compatibility to fcntl layer Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 23/24] Android : Define posix_fadvise Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 18/24] Add : Compatibility layer for shm.h Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 21/24] Android : Adding bswap defintions Charles Briere
2014-10-27 20:49 ` [lttng-dev] [PATCH lttng-tools 19/24] Android : Looking for pthread in libc Charles Briere
2014-10-27 20:58 ` [lttng-dev] Fixes for Android Karim Yaghmour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1414442926-14381-5-git-send-email-c.briere@samsung.com \
--to=c.briere@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox