Cleanup: Use pkg-config to detect liburcu
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 30 Oct 2020 06:48:08 +0000 (02:48 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Nov 2020 20:00:22 +0000 (15:00 -0500)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I88d3f853c8ee0e14a38a462ce24626800e0a4caf

configure.ac
src/bin/lttng-relayd/Makefile.am
src/bin/lttng-sessiond/Makefile.am
src/common/hashtable/Makefile.am
tests/regression/ust/multi-session/Makefile.am
tests/unit/Makefile.am
tests/utils/testapp/gen-ust-events/Makefile.am
tests/utils/testapp/gen-ust-nevents-str/Makefile.am
tests/utils/testapp/gen-ust-nevents/Makefile.am

index 2d4fcb7b96a594575a5ccea3817caa9ab3b5c9d0..fa58cbb16e385b3b455ffd4bd9a106ae153ff847 100644 (file)
@@ -481,35 +481,10 @@ PKG_CHECK_MODULES([libxml2], [libxml-2.0 >= 2.7.6])
 AC_CHECK_FUNC([clock_gettime], [AC_DEFINE_UNQUOTED([LTTNG_HAVE_CLOCK_GETTIME], 1, [Has clock_gettime() support.])])
 
 # URCU library version needed or newer
-m4_define([WRONG_LIBURCU_MSG], [Userspace RCU (liburcu) >= 0.9.0 is needed])
-
-# Check liburcu needed function calls
-AC_CHECK_DECL([cds_list_add], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/list.h>]])
-AC_CHECK_DECL([cds_wfcq_init], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/wfcqueue.h>]])
-AC_CHECK_DECL([cds_wfcq_dequeue_blocking], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/wfcqueue.h>]])
-AC_CHECK_DECL([futex_async], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/futex.h>]])
-AC_CHECK_DECL([rcu_thread_offline], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]])
-AC_CHECK_DECL([rcu_thread_online], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]])
-AC_CHECK_DECL([caa_likely], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]])
-AC_CHECK_LIB([urcu-cds], [_cds_lfht_new], [],
-       [AC_MSG_ERROR([WRONG_LIBURCU_MSG])])
-
-#Function added in urcu 0.7.0
-AC_CHECK_DECL([cmm_smp_mb__before_uatomic_or], [],
-        [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu.h>]]
-)
-
-#Function added in urcu 0.9.0
-AC_CHECK_DECL([urcu_ref_get_unless_zero], [],
-        [AC_MSG_ERROR([WRONG_LIBURCU_MSG])], [[#include <urcu/ref.h>]]
-)
+PKG_CHECK_MODULES([URCU], [liburcu >= 0.9])
+PKG_CHECK_MODULES([URCU_BP], [liburcu-bp >= 0.9])
+PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.9])
+AM_CPPFLAGS="$AM_CPPFLAGS $URCU_CFLAGS"
 
 # Check for libkmod, it will be auto-neabled if found but won't fail if it's not,
 # it can be explicitly disabled with --without-kmod
index 9bc1523e0c04d0d1a83b55f277f2b8aecb13f443..f6d5b29501f17295dcc9fc1e0e8641b502be6710 100644 (file)
@@ -28,7 +28,7 @@ lttng_relayd_SOURCES = main.c lttng-relayd.h utils.h utils.c cmd.h \
                        backward-compatibility-group-by.c backward-compatibility-group-by.h
 
 # link on liblttngctl for check if relayd is already alive.
-lttng_relayd_LDADD = -lurcu-common -lurcu \
+lttng_relayd_LDADD = $(URCU_LIBS) \
                $(top_builddir)/src/common/libcommon.la \
                $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \
                $(top_builddir)/src/common/hashtable/libhashtable.la \
index dd807125b6342e243c4720f835ba01ba94c37f27..d8e3b715d7b7926b550b4c5f973ae5bc7c7080ff 100644 (file)
@@ -68,7 +68,7 @@ endif
 lttng_sessiond_SOURCES += lttng-sessiond.h main.c
 
 # link on liblttngctl for check if sessiond is already alive.
-lttng_sessiond_LDADD = -lurcu-common -lurcu $(KMOD_LIBS) \
+lttng_sessiond_LDADD = -lurcu-common $(URCU_LIBS) $(KMOD_LIBS) \
                $(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 \
index ba002b6c35c4f4ce255373aa5cc7f8c5a9983e2d..5f6770a815b9e8fd50b7dd4a4f085abab218bc16 100644 (file)
@@ -6,4 +6,4 @@ libhashtable_la_SOURCES = hashtable.c hashtable.h \
                          utils.c utils.h \
                          hashtable-symbols.h
 
-libhashtable_la_LIBADD = -lurcu-common -lurcu -lurcu-cds
+libhashtable_la_LIBADD = $(URCU_LIBS) $(URCU_CDS_LIBS)
index b27e05b7981f01109f89e7c307bca8f83db59c95..c50233fa81015bb306eac91b570a62ed57de9e00 100644 (file)
@@ -4,7 +4,7 @@ AM_CFLAGS += -I$(srcdir)
 
 noinst_PROGRAMS = gen-nevents
 gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h
-gen_nevents_LDADD = $(UST_LIBS) -lurcu-bp $(DL_LIBS)
+gen_nevents_LDADD = $(UST_LIBS) $(URCU_BP_LIBS) $(DL_LIBS)
 
 noinst_SCRIPTS = test_multi_session
 EXTRA_DIST = test_multi_session
index 8dc4748a4eaf265094cac3c92855a74a9f05a941..a91b4dbd92682f01ccb5a891d21222a5de080001 100644 (file)
@@ -114,7 +114,7 @@ RELAYD_OBJS = $(top_builddir)/src/bin/lttng-relayd/backward-compatibility-group-
 
 test_session_SOURCES = test_session.c
 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
-                    $(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
+                    $(LIBHASHTABLE) $(DL_LIBS) -lrt $(URCU_LIBS) \
                     $(KMOD_LIBS) \
                     $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
                     $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
@@ -134,7 +134,7 @@ endif
 if HAVE_LIBLTTNG_UST_CTL
 test_ust_data_SOURCES = test_ust_data.c
 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
-                     $(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
+                     $(LIBHASHTABLE) $(DL_LIBS) -lrt $(URCU_LIBS) \
                      $(UST_CTL_LIBS) \
                      $(KMOD_LIBS) \
                      $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
@@ -205,7 +205,7 @@ test_relayd_backward_compat_group_by_session_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_s
 
 # fd tracker unit test
 test_fd_tracker_SOURCES = test_fd_tracker.c
-test_fd_tracker_LDADD = $(LIBTAP) $(LIBFDTRACKER) $(DL_LIBS) -lurcu $(LIBCOMMON) $(LIBHASHTABLE)
+test_fd_tracker_LDADD = $(LIBTAP) $(LIBFDTRACKER) $(DL_LIBS) $(URCU_LIBS) $(LIBCOMMON) $(LIBHASHTABLE)
 
 # uuid unit test
 test_uuid_SOURCES = test_uuid.c
index d6327d5b22d16498765e2e60cd31769857f15667..4b1c2173bfc6e39a9be6cb2ed9a0afcf29621b65 100644 (file)
@@ -6,7 +6,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir) \
 if HAVE_LIBLTTNG_UST_CTL
 noinst_PROGRAMS = gen-ust-events
 gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h
-gen_ust_events_LDADD = $(UST_LIBS) -lurcu-bp \
+gen_ust_events_LDADD = $(UST_LIBS) $(URCU_BP_LIBS) \
                $(top_builddir)/tests/utils/libtestutils.la \
                $(DL_LIBS)
 endif
index ed278a6cabdc6b0137ad4913aad3c683a142039a..84198bedd7e0cad8acffbc3c4fd4d436df8f732c 100644 (file)
@@ -6,7 +6,7 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils \
 if HAVE_LIBLTTNG_UST_CTL
 noinst_PROGRAMS = gen-ust-nevents-str
 gen_ust_nevents_str_SOURCES = gen-ust-nevents-str.c tp.c tp.h
-gen_ust_nevents_str_LDADD = $(UST_LIBS) -lurcu-bp \
+gen_ust_nevents_str_LDADD = $(UST_LIBS) $(URCU_BP_LIBS) \
                $(top_builddir)/tests/utils/libtestutils.la \
                $(DL_LIBS)
 endif
index d160d920d9b0006368286e810b7a41834c0ef5be..6788b1f363696f9f7827c9583bcdae04ea8d9011 100644 (file)
@@ -6,7 +6,7 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils \
 if HAVE_LIBLTTNG_UST_CTL
 noinst_PROGRAMS = gen-ust-nevents
 gen_ust_nevents_SOURCES = gen-ust-nevents.c tp.c tp.h
-gen_ust_nevents_LDADD = $(UST_LIBS) -lurcu-bp \
+gen_ust_nevents_LDADD = $(UST_LIBS) $(URCU_BP_LIBS) \
                $(top_builddir)/tests/utils/libtestutils.la \
                $(DL_LIBS)
 endif
This page took 0.029555 seconds and 4 git commands to generate.