Cleanup: dlmopen detection
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 10 May 2017 22:00:20 +0000 (18:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 1 Jun 2017 20:41:02 +0000 (16:41 -0400)
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 <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
22 files changed:
configure.ac
tests/regression/tools/filtering/Makefile.am
tests/regression/tools/health/Makefile.am
tests/regression/tools/live/Makefile.am
tests/regression/tools/notification/Makefile.am
tests/regression/tools/wildcard/Makefile.am
tests/regression/ust/clock-override/Makefile.am
tests/regression/ust/daemon/Makefile.am
tests/regression/ust/exit-fast/Makefile.am
tests/regression/ust/fork/Makefile.am
tests/regression/ust/getcpu-override/Makefile.am
tests/regression/ust/high-throughput/Makefile.am
tests/regression/ust/linking/Makefile.am
tests/regression/ust/low-throughput/Makefile.am
tests/regression/ust/multi-session/Makefile.am
tests/regression/ust/overlap/demo/Makefile.am
tests/regression/ust/type-declarations/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
tests/utils/testapp/gen-ust-tracef/Makefile.am

index 8e9a208e13bce7eb5208c79e49eda4aa75d5f7b2..d1fbd396bd6b7a0b3422e763ffa730a65789f23b 100644 (file)
@@ -466,21 +466,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],
index 712edefb63c7cec039a475e9882071c1ea13a7bc..b214fc1d69c0be70d554547bccafb3ab70ee0edb 100644 (file)
@@ -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
index 3cb2936ccf401c0934da0ff22b877cf7f1d5e377..c8deb5e5d93ee1205fa9f2d1667f7069df9d5041 100644 (file)
@@ -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)
 
index 44e4490102a7273a66d44c3e1aafca06a48b1e3a..46186d383583d7c21cf50b0d66e74ea8fb81d099 100644 (file)
@@ -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 \
index 540b818225083c936336c8ac3e74975b3224a2fc..707047c3a3ce9154dc6888d71e9e2b4db76bc3b6 100644 (file)
@@ -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
 
index 1261baa386b4db3a4396ca6e79763749c96e508f..c872f0d7b7519b65fd6bff1e18cf90e9a89ccd65 100644 (file)
@@ -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
 
index 8559ef02e1f5c2a39bc4401537527491cdc98f18..61b6d809f990b79a67917dbf5221355ce99d78b3 100644 (file)
@@ -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
index cc63b63b744c1b45b589bad8bfcde31d4c5daf46..1a52b634b0e8e1ea1a9ff53b6c01006e3bcf106d 100644 (file)
@@ -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
index 4424b0d20f16d83d29eb05e14b3ee37daa0035d0..06cda46a585a8a4900823745d4e54bf36707e131 100644 (file)
@@ -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
index b07cf9dba0cbadb233c7f85ac2ea17fc0cedb627..2c79db658f30852c3c7d03bbb31764ecaf9b5e45 100644 (file)
@@ -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
index a6487d9bb7f6ce9c6d939b282bd3afa8927d04aa..0543835b4506a48d1c1364329a69598a0d67314e 100644 (file)
@@ -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
index 22a31e18b062df7f43b6ec27e08199e2fc09dda0..f71dfd4dfeb7dd76d3f566f08a7ac1ef6224bbcf 100644 (file)
@@ -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
index c70bc53a2eccaed40aebc4d5b87b19cc269dc247..c8585698dab6e50f2c8a71badffce7ad177f71eb 100644 (file)
@@ -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)
 
index 8ce8f24397eae0a4d358a9f623bd1c738ca3c529..95022b9f98e9ede50fe48d9cf1722a6efd3077d6 100644 (file)
@@ -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
index 744a27ef9b17c1e3eace9167353a4e13f4484cd0..204ae7bcf2f96cb28a61725b3215cf254dc4de4e 100644 (file)
@@ -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
index 4d4efb154b5542da867b37817199e8e9582d107d..fbb399cd4e3fae2ccaa457614a3ec74f3c0c3b21 100644 (file)
@@ -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
index 593f6dc36f030b77d8bd230f0ab59cf84fd68c70..db39b1cc3aac4e6c79bbb122d07cd41f2cb14fe0 100644 (file)
@@ -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
index 2c7365912dc106b2ed192252d5bc1e587584896d..340dd936570929775686f6fc7e3b3064ac16138c 100644 (file)
@@ -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)
index 9700eac693a9f22707db392ade5228297da9748c..1c2fcf845bfa703881f940013442fc98c3557cbc 100644 (file)
@@ -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
index 405f05b74db4af7c00398dcedbad85bbf1d7bb42..ed0e6593722a4e06b5dc07d75d6969c69287332b 100644 (file)
@@ -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
index 24f64b2c6ed204a3cf1bdcd242bc8ec91c62e30e..27dc1dc4a05e17f5a766edb775c781c532a14d31 100644 (file)
@@ -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
index 293a79c8c9837f8a4df7c8e6efa3445d477932c9..6e746f05266fa7e5aaa50f64456de0d34de7c0ad 100644 (file)
@@ -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
This page took 0.057128 seconds and 5 git commands to generate.