From: Michael Jeanson Date: Wed, 10 May 2017 22:00:20 +0000 (-0400) Subject: Cleanup: dlmopen detection X-Git-Tag: v2.10.0-rc2~23 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b1e910309fb5e7d46aadbc5321a2c23b288faff2;p=lttng-tools.git Cleanup: dlmopen detection Simplify dlmopen detection code and use a variable to store the detected lib instead of adding conditionnal code to each Makefile. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/configure.ac b/configure.ac index 0ec5e2087..2b61844d6 100644 --- a/configure.ac +++ b/configure.ac @@ -461,21 +461,16 @@ AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range]) # check for dlopen AC_CHECK_LIB([dl], [dlopen], -[ - have_libdl=yes -], -[ - #libdl not found, check for dlopen in libc. - AC_CHECK_LIB([c], [dlopen], - [ - have_libc_dl=yes - ], - [ - AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.]) - ]) -]) -AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"]) -AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"]) + [DL_LIBS="-ldl"], + [ + #libdl not found, check for dlopen in libc. + AC_CHECK_LIB([c], [dlopen], + [DL_LIBS="-lc"], + [AC_MSG_FAILURE([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])] + ) + ] +) +AC_SUBST(DL_LIBS) # Check for fmemopen AC_CHECK_LIB([c], [fmemopen], diff --git a/tests/regression/tools/filtering/Makefile.am b/tests/regression/tools/filtering/Makefile.am index 712edefb6..b214fc1d6 100644 --- a/tests/regression/tools/filtering/Makefile.am +++ b/tests/regression/tools/filtering/Makefile.am @@ -1,16 +1,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests -I$(srcdir) -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -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 = -llttng-ust -lurcu-bp $(DL_LIBS) endif noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter diff --git a/tests/regression/tools/health/Makefile.am b/tests/regression/tools/health/Makefile.am index 3cb2936cc..c8deb5e5d 100644 --- a/tests/regression/tools/health/Makefile.am +++ b/tests/regression/tools/health/Makefile.am @@ -1,12 +1,5 @@ AM_CPPFLAGS += -I. -I$(top_srcdir)/include -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - COPYSCRIPTS = test_thread_exit test_thread_stall test_tp_fail \ test_health.sh test_thread_ok dist_noinst_SCRIPTS = $(COPYSCRIPTS) @@ -27,21 +20,25 @@ FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ # Health thread exit ld_preloaded test lib libhealthexit_la_SOURCES=health_exit.c libhealthexit_la_LDFLAGS= $(FORCE_SHARED_LIB_OPTIONS) +libhealthexit_la_LIBADD = $(DL_LIBS) # Health thread stall ld_preloaded test lib libhealthstall_la_SOURCES=health_stall.c libhealthstall_la_LDFLAGS= $(FORCE_SHARED_LIB_OPTIONS) +libhealthstall_la_LIBADD = $(DL_LIBS) # Health thread fail ld_preloaded test lib libhealthtpfail_la_SOURCES=health_fail.c libhealthtpfail_la_LDFLAGS= $(FORCE_SHARED_LIB_OPTIONS) +libhealthtpfail_la_LIBADD = $(DL_LIBS) noinst_PROGRAMS = health_check noinst_LTLIBRARIES = libhealthexit.la libhealthstall.la libhealthtpfail.la health_check_SOURCES = health_check.c $(UTILS) health_check_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ - $(top_builddir)/src/common/libcommon.la + $(top_builddir)/src/common/libcommon.la \ + $(DL_LIBS) EXTRA_DIST = $(COPYSCRIPTS) diff --git a/tests/regression/tools/live/Makefile.am b/tests/regression/tools/live/Makefile.am index 44e449010..46186d383 100644 --- a/tests/regression/tools/live/Makefile.am +++ b/tests/regression/tools/live/Makefile.am @@ -1,12 +1,5 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils/ -I$(srcdir) -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la LIBCOMMON=$(top_builddir)/src/common/libcommon.la @@ -29,9 +22,9 @@ endif live_test_SOURCES = live_test.c live_test_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \ - $(LIBHASHTABLE) $(LIBHEALTH) -lrt + $(LIBHASHTABLE) $(LIBHEALTH) $(DL_LIBS) -lrt live_test_LDADD += $(LIVE) \ - $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la + $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la all-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ diff --git a/tests/regression/tools/notification/Makefile.am b/tests/regression/tools/notification/Makefile.am index 540b81822..707047c3a 100644 --- a/tests/regression/tools/notification/Makefile.am +++ b/tests/regression/tools/notification/Makefile.am @@ -20,7 +20,7 @@ FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ -rpath $(abs_builddir) libpause_consumer_la_SOURCES = consumer_testpoints.c -libpause_consumer_la_LIBADD = $(top_builddir)/src/common/libcommon.la +libpause_consumer_la_LIBADD = $(top_builddir)/src/common/libcommon.la $(DL_LIBS) libpause_consumer_la_LDFLAGS = $(FORCE_SHARED_LIB_OPTIONS) noinst_LTLIBRARIES = libpause_consumer.la @@ -30,13 +30,6 @@ base_client_LDADD = $(LIB_LTTNG_CTL) notification_SOURCES = notification.c notification_LDADD = $(LIB_LTTNG_CTL) $(LIBTAP) -lm -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - noinst_SCRIPTS = test_notification test_notification_multi_app EXTRA_DIST = test_notification test_notification_multi_app diff --git a/tests/regression/tools/wildcard/Makefile.am b/tests/regression/tools/wildcard/Makefile.am index 1261baa38..c872f0d7b 100644 --- a/tests/regression/tools/wildcard/Makefile.am +++ b/tests/regression/tools/wildcard/Makefile.am @@ -1,12 +1,5 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests -I$(srcdir) -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - noinst_SCRIPTS = test_event_wildcard EXTRA_DIST = test_event_wildcard diff --git a/tests/regression/ust/clock-override/Makefile.am b/tests/regression/ust/clock-override/Makefile.am index 8559ef02e..61b6d809f 100644 --- a/tests/regression/ust/clock-override/Makefile.am +++ b/tests/regression/ust/clock-override/Makefile.am @@ -21,13 +21,7 @@ GETCPU_LIBTOOL_FLAGS = \ noinst_LTLIBRARIES = lttng-ust-clock-override-test.la lttng_ust_clock_override_test_la_LDFLAGS = $(GETCPU_LIBTOOL_FLAGS) lttng_ust_clock_override_test_la_SOURCES = lttng-ust-clock-override-test.c - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -lttng_ust_clock_override_test_la_LIBADD = -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -lttng_ust_clock_override_test_la_LIBADD = -lc -endif +lttng_ust_clock_override_test_la_LIBADD = $(DL_LIBS) noinst_SCRIPTS = test_clock_override EXTRA_DIST = test_clock_override diff --git a/tests/regression/ust/daemon/Makefile.am b/tests/regression/ust/daemon/Makefile.am index cc63b63b7..1a52b634b 100644 --- a/tests/regression/ust/daemon/Makefile.am +++ b/tests/regression/ust/daemon/Makefile.am @@ -2,14 +2,7 @@ AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = daemon daemon_SOURCES = daemon.c ust_tests_daemon.h -daemon_LDADD = -llttng-ust -llttng-ust-fork - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -daemon_LDADD += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -daemon_LDADD += -lc -endif +daemon_LDADD = -llttng-ust -llttng-ust-fork $(DL_LIBS) noinst_SCRIPTS = test_daemon test_daemon.py EXTRA_DIST = test_daemon test_daemon.py diff --git a/tests/regression/ust/exit-fast/Makefile.am b/tests/regression/ust/exit-fast/Makefile.am index 4424b0d20..06cda46a5 100644 --- a/tests/regression/ust/exit-fast/Makefile.am +++ b/tests/regression/ust/exit-fast/Makefile.am @@ -2,14 +2,7 @@ AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = exit-fast exit_fast_SOURCES = exit-fast.c ust_tests_exitfast.h -exit_fast_LDADD = -llttng-ust - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -exit_fast_LDADD += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -exit_fast_LDADD += -lc -endif +exit_fast_LDADD = -llttng-ust $(DL_LIBS) noinst_SCRIPTS = test_exit-fast test_exit-fast.py EXTRA_DIST = test_exit-fast test_exit-fast.py diff --git a/tests/regression/ust/fork/Makefile.am b/tests/regression/ust/fork/Makefile.am index b07cf9dba..2c79db658 100644 --- a/tests/regression/ust/fork/Makefile.am +++ b/tests/regression/ust/fork/Makefile.am @@ -2,19 +2,10 @@ AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = fork fork2 fork_SOURCES = fork.c ust_tests_fork.h -fork_LDADD = -llttng-ust -llttng-ust-fork +fork_LDADD = -llttng-ust -llttng-ust-fork $(DL_LIBS) fork2_SOURCES = fork2.c -fork2_LDADD = -llttng-ust -llttng-ust-fork - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -fork_LDADD += -ldl -fork2_LDADD += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -fork_LDADD += -lc -fork2_LDADD += -lc -endif +fork2_LDADD = -llttng-ust -llttng-ust-fork $(DL_LIBS) noinst_SCRIPTS = test_fork test_fork.py EXTRA_DIST = test_fork test_fork.py diff --git a/tests/regression/ust/getcpu-override/Makefile.am b/tests/regression/ust/getcpu-override/Makefile.am index a6487d9bb..0543835b4 100644 --- a/tests/regression/ust/getcpu-override/Makefile.am +++ b/tests/regression/ust/getcpu-override/Makefile.am @@ -22,13 +22,7 @@ GETCPU_LIBTOOL_FLAGS = \ noinst_LTLIBRARIES = lttng-ust-getcpu-override-test.la lttng_ust_getcpu_override_test_la_LDFLAGS = $(GETCPU_LIBTOOL_FLAGS) lttng_ust_getcpu_override_test_la_SOURCES = lttng-ust-getcpu-override-test.c - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -lttng_ust_getcpu_override_test_la_LIBADD = -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -lttng_ust_getcpu_override_test_la_LIBADD = -lc -endif +lttng_ust_getcpu_override_test_la_LIBADD = $(DL_LIBS) noinst_SCRIPTS = test_getcpu_override run-getcpu-override EXTRA_DIST = test_getcpu_override run-getcpu-override diff --git a/tests/regression/ust/high-throughput/Makefile.am b/tests/regression/ust/high-throughput/Makefile.am index 22a31e18b..f71dfd4df 100644 --- a/tests/regression/ust/high-throughput/Makefile.am +++ b/tests/regression/ust/high-throughput/Makefile.am @@ -1,15 +1,8 @@ AM_CPPFLAGS += -I$(srcdir) -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - noinst_PROGRAMS = gen-events gen_events_SOURCES = main.c tp.c tp.h -gen_events_LDADD = -llttng-ust +gen_events_LDADD = -llttng-ust $(DL_LIBS) noinst_SCRIPTS = test_high_throughput EXTRA_DIST = test_high_throughput diff --git a/tests/regression/ust/linking/Makefile.am b/tests/regression/ust/linking/Makefile.am index c70bc53a2..c8585698d 100644 --- a/tests/regression/ust/linking/Makefile.am +++ b/tests/regression/ust/linking/Makefile.am @@ -9,7 +9,7 @@ LIBS = # 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 +demo_builtin_LDADD = -llttng-ust $(DL_LIBS) demo_builtin_CFLAGS = -Werror=old-style-definition $(AM_CFLAGS) # Build a version statically linked to the providers @@ -31,16 +31,8 @@ liblttng_ust_provider_ust_tests_demo3_static_la_LIBADD = \ demo_static_SOURCES = demo.c demo_static_LDADD = liblttng-ust-provider-ust-tests-demo-static.la \ - liblttng-ust-provider-ust-tests-demo3-static.la - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -demo_builtin_LDADD += -ldl -demo_static_LDADD += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -demo_builtin_LDADD += -lc -demo_static_LDADD += -lc -endif + liblttng-ust-provider-ust-tests-demo3-static.la \ + $(DL_LIBS) noinst_PROGRAMS = demo_builtin demo_static @@ -80,13 +72,7 @@ liblttng_ust_provider_ust_tests_demo3_la_LDFLAGS = \ noinst_PROGRAMS += demo demo_SOURCES = demo.c ust_tests_demo.h demo_CFLAGS = -DTEST_DYNAMIC_LINKAGE $(AM_CFLAGS) - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -demo_LDADD = -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -demo_LDADD = -lc -endif +demo_LDADD = $(DL_LIBS) EXTRA_DIST = $(COPYSCRIPTS) diff --git a/tests/regression/ust/low-throughput/Makefile.am b/tests/regression/ust/low-throughput/Makefile.am index 8ce8f2439..95022b9f9 100644 --- a/tests/regression/ust/low-throughput/Makefile.am +++ b/tests/regression/ust/low-throughput/Makefile.am @@ -1,15 +1,8 @@ AM_CPPFLAGS += -I$(srcdir) -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - noinst_PROGRAMS = gen-events gen_events_SOURCES = main.c tp.c tp.h -gen_events_LDADD = -llttng-ust -lurcu +gen_events_LDADD = -llttng-ust -lurcu $(DL_LIBS) noinst_SCRIPTS = test_low_throughput EXTRA_DIST = test_low_throughput diff --git a/tests/regression/ust/multi-session/Makefile.am b/tests/regression/ust/multi-session/Makefile.am index 744a27ef9..204ae7bcf 100644 --- a/tests/regression/ust/multi-session/Makefile.am +++ b/tests/regression/ust/multi-session/Makefile.am @@ -1,15 +1,8 @@ AM_CFLAGS += -I$(srcdir) -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - noinst_PROGRAMS = gen-nevents gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h -gen_nevents_LDADD = -llttng-ust -lurcu-bp +gen_nevents_LDADD = -llttng-ust -lurcu-bp $(DL_LIBS) noinst_SCRIPTS = test_multi_session EXTRA_DIST = test_multi_session diff --git a/tests/regression/ust/overlap/demo/Makefile.am b/tests/regression/ust/overlap/demo/Makefile.am index 4d4efb154..fbb399cd4 100644 --- a/tests/regression/ust/overlap/demo/Makefile.am +++ b/tests/regression/ust/overlap/demo/Makefile.am @@ -35,12 +35,7 @@ noinst_LTLIBRARIES = liblttng-ust-provider-ust-tests-demo.la \ noinst_PROGRAMS = demo demo_SOURCES = demo.c ust_tests_demo.h # The demo program only depends on libdl/libc for dlopen(). -if LTTNG_TOOLS_BUILD_WITH_LIBDL -demo_LDADD = -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -demo_LDADD = -lc -endif +demo_LDADD = $(DL_LIBS) noinst_SCRIPTS = demo-trace EXTRA_DIST = demo-trace diff --git a/tests/regression/ust/type-declarations/Makefile.am b/tests/regression/ust/type-declarations/Makefile.am index 593f6dc36..db39b1cc3 100644 --- a/tests/regression/ust/type-declarations/Makefile.am +++ b/tests/regression/ust/type-declarations/Makefile.am @@ -2,14 +2,7 @@ AM_CPPFLAGS += -I$(srcdir) noinst_PROGRAMS = type-declarations type_declarations_SOURCES = type-declarations.c ust_tests_td.h -type_declarations_LDADD = -llttng-ust - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -type_declarations_LDADD += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -type_declarations_LDADD += -lc -endif +type_declarations_LDADD = -llttng-ust $(DL_LIBS) noinst_SCRIPTS = test_type_declarations test_type_declarations.py EXTRA_DIST = test_type_declarations test_type_declarations.py diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 2c7365912..340dd9365 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -15,13 +15,6 @@ TESTS = test_kernel_data \ test_notification \ ini_config/test_ini_config -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -endif - LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la LIBCOMMON=$(top_builddir)/src/common/libcommon.la @@ -43,7 +36,7 @@ endif # URI unit tests test_uri_SOURCES = test_uri.c -test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) +test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) $(DL_LIBS) # Session unit test SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \ @@ -60,7 +53,7 @@ SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \ test_session_SOURCES = test_session.c test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \ - $(LIBHASHTABLE) -lrt + $(LIBHASHTABLE) $(DL_LIBS) -lrt test_session_LDADD += $(SESSIONS) # UST data structures unit test @@ -84,7 +77,7 @@ UST_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \ test_ust_data_SOURCES = test_ust_data.c test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM)\ - $(LIBHASHTABLE) -lrt -llttng-ust-ctl + $(LIBHASHTABLE) $(DL_LIBS) -lrt -llttng-ust-ctl test_ust_data_LDADD += $(UST_DATA_TRACE) endif @@ -99,7 +92,7 @@ KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \ test_kernel_data_SOURCES = test_kernel_data.c test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \ - $(LIBHASHTABLE) -lrt + $(LIBHASHTABLE) $(DL_LIBS) -lrt test_kernel_data_LDADD += $(KERN_DATA_TRACE) # utils suffix for unit test @@ -107,18 +100,18 @@ UTILS_SUFFIX=$(top_builddir)/src/common/libcommon.la # parse_size_suffix unit test test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c -test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) +test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS) test_utils_parse_size_suffix_LDADD += $(UTILS_SUFFIX) # expand_path unit test test_utils_expand_path_SOURCES = test_utils_expand_path.c -test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) +test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS) test_utils_expand_path_LDADD += $(UTILS_SUFFIX) # string utilities unit test test_string_utils_SOURCES = test_string_utils.c -test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS) -# +test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS) $(DL_LIBS) + # Notification api test_notification_SOURCES = test_notification.c -test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) +test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(DL_LIBS) diff --git a/tests/utils/testapp/gen-ust-events/Makefile.am b/tests/utils/testapp/gen-ust-events/Makefile.am index 9700eac69..1c2fcf845 100644 --- a/tests/utils/testapp/gen-ust-events/Makefile.am +++ b/tests/utils/testapp/gen-ust-events/Makefile.am @@ -1,15 +1,9 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils -I$(srcdir) -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -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 \ - $(top_builddir)/tests/utils/libtestutils.la + $(top_builddir)/tests/utils/libtestutils.la \ + $(DL_LIBS) endif diff --git a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am index 405f05b74..ed0e65937 100644 --- a/tests/utils/testapp/gen-ust-nevents-str/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents-str/Makefile.am @@ -1,15 +1,9 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -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 \ - $(top_builddir)/tests/utils/libtestutils.la + $(top_builddir)/tests/utils/libtestutils.la \ + $(DL_LIBS) endif diff --git a/tests/utils/testapp/gen-ust-nevents/Makefile.am b/tests/utils/testapp/gen-ust-nevents/Makefile.am index 24f64b2c6..27dc1dc4a 100644 --- a/tests/utils/testapp/gen-ust-nevents/Makefile.am +++ b/tests/utils/testapp/gen-ust-nevents/Makefile.am @@ -1,15 +1,9 @@ AM_CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/tests/utils -if LTTNG_TOOLS_BUILD_WITH_LIBDL -LIBS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -LIBS += -lc -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 \ - $(top_builddir)/tests/utils/libtestutils.la + $(top_builddir)/tests/utils/libtestutils.la \ + $(DL_LIBS) endif diff --git a/tests/utils/testapp/gen-ust-tracef/Makefile.am b/tests/utils/testapp/gen-ust-tracef/Makefile.am index 293a79c8c..6e746f052 100644 --- a/tests/utils/testapp/gen-ust-tracef/Makefile.am +++ b/tests/utils/testapp/gen-ust-tracef/Makefile.am @@ -1,15 +1,7 @@ AM_CPPFLAGS += -I$(srcdir) -AM_LDFLAGS = - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -AM_LDFLAGS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -AM_LDFLAGS += -lc -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 +gen_ust_tracef_LDADD = -llttng-ust $(DL_LIBS) endif