[with_lttng_ust=yes]
)
-AS_IF([test "x$with_lttng_ust" = "xyes"],
- [
- AC_CHECK_LIB([lttng-ust-ctl], [lttng_ust_enum_get_from_desc],
- [
- AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1])
- ],
- [
- AC_MSG_FAILURE([Cannot find LTTng-UST >= 2.11.x. Use [LDFLAGS]=-Ldir and [CPPFLAGS]=-Idir to specify its location, or specify --without-lttng-ust to build lttng-tools without LTTng-UST support.])
- ]
- )
- ]
-)
+AS_IF([test "x$with_lttng_ust" = "xyes"], [
+ AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1])
+
+ # Check for liblttng-ust
+ PKG_CHECK_MODULES([UST], [lttng-ust >= $major_version.$minor_version])
+
+ # Check for liblttng-ust-ctl
+ PKG_CHECK_MODULES([UST_CTL], [lttng-ust-ctl >= $major_version.$minor_version])
+
+ AM_CPPFLAGS="$AM_CPPFLAGS $UST_CFLAGS"
+])
+
AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$with_lttng_ust" = "xyes"])
lttng_consumerd_LDFLAGS = -rdynamic
if HAVE_LIBLTTNG_UST_CTL
-lttng_consumerd_LDADD += -llttng-ust-ctl
+lttng_consumerd_LDADD += $(UST_CTL_LIBS)
endif
if HAVE_LIBLTTNG_UST_CTL
-lttng_sessiond_LDADD += -llttng-ust-ctl
+lttng_sessiond_LDADD += $(UST_CTL_LIBS)
endif
libust_consumer_la_SOURCES = ust-consumer.c ust-consumer.h
libust_consumer_la_LIBADD = \
- -llttng-ust-ctl \
+ $(UST_CTL_LIBS) \
$(top_builddir)/src/common/relayd/librelayd.la
endif
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 = -llttng-ust -lurcu-bp $(DL_LIBS)
+gen_ust_events_LDADD = $(UST_LIBS) $(DL_LIBS)
endif
noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter
noinst_PROGRAMS = prog
prog_SOURCES = prog.c tp.c tp.h
-prog_LDADD = -llttng-ust $(DL_LIBS)
+prog_LDADD = $(UST_LIBS) $(DL_LIBS)
noinst_SCRIPTS = test_baddr-statedump test_baddr-statedump.py
EXTRA_DIST = test_baddr-statedump test_baddr-statedump.py
noinst_PROGRAMS = daemon
daemon_SOURCES = daemon.c ust_tests_daemon.h
-daemon_LDADD = -llttng-ust -llttng-ust-fork $(DL_LIBS)
+daemon_LDADD = $(UST_LIBS) -llttng-ust-fork $(DL_LIBS)
noinst_SCRIPTS = test_daemon test_daemon.py
EXTRA_DIST = test_daemon test_daemon.py
noinst_PROGRAMS = exit-fast
exit_fast_SOURCES = exit-fast.c ust_tests_exitfast.h
-exit_fast_LDADD = -llttng-ust $(DL_LIBS)
+exit_fast_LDADD = $(UST_LIBS) $(DL_LIBS)
noinst_SCRIPTS = test_exit-fast test_exit-fast.py
EXTRA_DIST = test_exit-fast test_exit-fast.py
noinst_PROGRAMS = fork fork2
fork_SOURCES = fork.c ust_tests_fork.h
-fork_LDADD = -llttng-ust -llttng-ust-fork $(DL_LIBS)
+fork_LDADD = $(UST_LIBS) -llttng-ust-fork $(DL_LIBS)
fork2_SOURCES = fork2.c
-fork2_LDADD = -llttng-ust -llttng-ust-fork $(DL_LIBS)
+fork2_LDADD = $(UST_LIBS) -llttng-ust-fork $(DL_LIBS)
noinst_SCRIPTS = test_fork test_fork.py
EXTRA_DIST = test_fork test_fork.py
noinst_PROGRAMS = gen-events
gen_events_SOURCES = main.c tp.c tp.h
-gen_events_LDADD = -llttng-ust $(DL_LIBS)
+gen_events_LDADD = $(UST_LIBS) $(DL_LIBS)
noinst_SCRIPTS = test_high_throughput
EXTRA_DIST = test_high_throughput
noinst_PROGRAMS = prog
prog_SOURCES = prog.c
-prog_LDADD = -llttng-ust -llttng-ust-libc-wrapper
+prog_LDADD = $(UST_LIBS) -llttng-ust-libc-wrapper
noinst_SCRIPTS = test_libc-wrapper test_libc-wrapper.py
EXTRA_DIST = test_libc-wrapper test_libc-wrapper.py
# Build a version of the test app with built-in tracepoints
demo_builtin_SOURCES = demo.c tp.c tp2.c tp3.c ust_tests_demo.h \
ust_tests_demo2.h ust_tests_demo3.h
-demo_builtin_LDADD = -llttng-ust $(DL_LIBS)
+demo_builtin_LDADD = $(UST_LIBS) $(DL_LIBS)
demo_builtin_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS)
# Build a version statically linked to the providers
tp.c ust_tests_demo.h \
tp2.c ust_tests_demo2.h
liblttng_ust_provider_ust_tests_demo_static_la_LIBADD = \
- -llttng-ust
+ $(UST_LIBS)
# contains ust_tests_demo3.h provider probes
liblttng_ust_provider_ust_tests_demo3_static_la_SOURCES = \
tp3.c ust_tests_demo3.h
liblttng_ust_provider_ust_tests_demo3_static_la_LIBADD = \
- -llttng-ust
+ $(UST_LIBS)
demo_static_SOURCES = demo.c
demo_static_LDADD = liblttng-ust-provider-ust-tests-demo-static.la \
liblttng_ust_provider_ust_tests_demo_la_SOURCES = \
tp.c ust_tests_demo.h \
tp2.c ust_tests_demo2.h
-liblttng_ust_provider_ust_tests_demo_la_LIBADD = -llttng-ust
+liblttng_ust_provider_ust_tests_demo_la_LIBADD = $(UST_LIBS)
liblttng_ust_provider_ust_tests_demo_la_LDFLAGS = \
$(FORCE_SHARED_LIB_OPTIONS)
#contains ust_tests_demo3.h provider probes
liblttng_ust_provider_ust_tests_demo3_la_SOURCES = \
tp3.c ust_tests_demo3.h
-liblttng_ust_provider_ust_tests_demo3_la_LIBADD = -llttng-ust
+liblttng_ust_provider_ust_tests_demo3_la_LIBADD = $(UST_LIBS)
liblttng_ust_provider_ust_tests_demo3_la_LDFLAGS = \
$(FORCE_SHARED_LIB_OPTIONS)
noinst_PROGRAMS = gen-events
gen_events_SOURCES = main.c tp.c tp.h
-gen_events_LDADD = -llttng-ust -lurcu $(DL_LIBS)
+gen_events_LDADD = $(UST_LIBS) $(DL_LIBS)
noinst_SCRIPTS = test_low_throughput
EXTRA_DIST = test_low_throughput
exec_with_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=1
exec_without_callsites_SOURCES = multi-lib-test.c
-exec_without_callsites_LDFLAGS = -ldl $(POPT_LIBS) -llttng-ust
+exec_without_callsites_LDFLAGS = -ldl $(POPT_LIBS) $(UST_LIBS)
exec_without_callsites_LDADD = probes.o
exec_without_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=0
PROBES_SRC=probes.c probes.h
-PROBES_LDF=-shared -module -llttng-ust -avoid-version -rpath $(abs_builddir)/.libs/
+PROBES_LDF=-shared -module $(UST_LIBS) -avoid-version -rpath $(abs_builddir)/.libs/
PROBES_CF=$(AM_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) -c -I$(srcdir)/
probes.o: probes.c probes.h
noinst_LTLIBRARIES += libcallsites_1.la libcallsites_2.la
CALLSITES_SRC=callsites.c callsites.h
-CALLSITES_LDF=-shared -module -llttng-ust -avoid-version -rpath $(abs_builddir)/.libs/
+CALLSITES_LDF=-shared -module $(UST_LIBS) -avoid-version -rpath $(abs_builddir)/.libs/
CALLSITES_CF=-c -I.
libprobes_a_la_SOURCES = $(PROBES_SRC)
noinst_PROGRAMS = gen-nevents
gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h
-gen_nevents_LDADD = -llttng-ust -lurcu-bp $(DL_LIBS)
+gen_nevents_LDADD = $(UST_LIBS) $(DL_LIBS)
noinst_SCRIPTS = test_multi_session
EXTRA_DIST = test_multi_session
liblttng_ust_provider_ust_tests_demo_la_SOURCES = \
tp.c ust_tests_demo.h \
tp2.c ust_tests_demo2.h
-liblttng_ust_provider_ust_tests_demo_la_LIBADD = -llttng-ust
+liblttng_ust_provider_ust_tests_demo_la_LIBADD = $(UST_LIBS)
liblttng_ust_provider_ust_tests_demo_la_LDFLAGS = $(FORCE_SHARED_LIB_OPTIONS)
#contains ust_tests_demo3.h provider probes
liblttng_ust_provider_ust_tests_demo3_la_SOURCES = tp3.c ust_tests_demo3.h
-liblttng_ust_provider_ust_tests_demo3_la_LIBADD = -llttng-ust
+liblttng_ust_provider_ust_tests_demo3_la_LIBADD = $(UST_LIBS)
liblttng_ust_provider_ust_tests_demo3_la_LDFLAGS = $(FORCE_SHARED_LIB_OPTIONS)
noinst_LTLIBRARIES = liblttng-ust-provider-ust-tests-demo.la \
noinst_PROGRAMS = type-declarations
type_declarations_SOURCES = type-declarations.c ust_tests_td.h
-type_declarations_LDADD = -llttng-ust $(DL_LIBS)
+type_declarations_LDADD = $(UST_LIBS) $(DL_LIBS)
+type_declarations_CPPFLAGS = $(UST_CFLAGS) $(DL_CFLAGS) $(AM_CPPFLAGS)
noinst_SCRIPTS = test_type_declarations test_type_declarations.py
EXTRA_DIST = test_type_declarations test_type_declarations.py
test_session_LDADD += $(SESSIOND_OBJS)
if HAVE_LIBLTTNG_UST_CTL
-test_session_LDADD += -llttng-ust-ctl
+test_session_LDADD += $(UST_CTL_LIBS)
endif
# UST data structures unit test
test_ust_data_SOURCES = test_ust_data.c
test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
$(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
- -llttng-ust-ctl \
+ $(UST_CTL_LIBS) \
$(KMOD_LIBS) \
$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
$(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
if HAVE_LIBLTTNG_UST_CTL
noinst_PROGRAMS = gen-ust-events-ns
gen_ust_events_ns_SOURCES = gen-ust-events-ns.c tp.c tp.h
-gen_ust_events_ns_LDADD = -llttng-ust -lurcu-bp -llttng-ust-fork \
+gen_ust_events_ns_LDADD = $(UST_LIBS) -llttng-ust-fork \
$(top_builddir)/tests/utils/libtestutils.la \
$(DL_LIBS) $(POPT_LIBS)
endif
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 = -llttng-ust -lurcu-bp \
+gen_ust_events_LDADD = $(UST_LIBS) \
$(top_builddir)/tests/utils/libtestutils.la \
$(DL_LIBS)
endif
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 = -llttng-ust -lurcu-bp \
+gen_ust_nevents_str_LDADD = $(UST_LIBS) \
$(top_builddir)/tests/utils/libtestutils.la \
$(DL_LIBS)
endif
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 = -llttng-ust -lurcu-bp \
+gen_ust_nevents_LDADD = $(UST_LIBS) \
$(top_builddir)/tests/utils/libtestutils.la \
$(DL_LIBS)
endif
if HAVE_LIBLTTNG_UST_CTL
noinst_PROGRAMS = gen-ust-tracef
gen_ust_tracef_SOURCES = gen-ust-tracef.c
-gen_ust_tracef_LDADD = -llttng-ust $(DL_LIBS)
+gen_ust_tracef_LDADD = $(UST_LIBS) $(DL_LIBS)
endif