From c402cafb3d6831f86a4edf9c0fb75fd05471ddd1 Mon Sep 17 00:00:00 2001 From: Vitaly Lipatov Date: Sat, 30 Jun 2018 12:07:21 +0300 Subject: [PATCH] Fix: use LIBDL/LIBC_DL to select either libdl or libc Use LTTNG_UST_BUILD_WITH_LIBDL/LIBC_DL variables to choose between -ldl and -lc. Add a missing direct dependency against -ldl or -lc to liblttng_ust_tracepoint_la_LIBADD. Signed-off-by: Vitaly Lipatov Signed-off-by: Mathieu Desnoyers --- liblttng-ust/Makefile.am | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index 982be69b..47b9da57 100644 --- a/liblttng-ust/Makefile.am +++ b/liblttng-ust/Makefile.am @@ -19,6 +19,13 @@ liblttng_ust_tracepoint_la_LIBADD = \ liblttng_ust_tracepoint_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION) liblttng_ust_tracepoint_la_CFLAGS = -DUST_COMPONENT="liblttng_ust_tracepoint" $(AM_CFLAGS) +if LTTNG_UST_BUILD_WITH_LIBDL +liblttng_ust_tracepoint_la_LIBADD += -ldl +endif +if LTTNG_UST_BUILD_WITH_LIBC_DL +liblttng_ust_tracepoint_la_LIBADD += -lc +endif + liblttng_ust_runtime_la_SOURCES = \ lttng-ust-comm.c \ lttng-ust-abi.c \ @@ -94,10 +101,16 @@ liblttng_ust_la_LIBADD = \ -lpthread \ -lrt \ -lurcu-cds \ - -ldl \ $(top_builddir)/snprintf/libustsnprintf.la \ $(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \ liblttng-ust-tracepoint.la \ liblttng-ust-runtime.la liblttng-ust-support.la +if LTTNG_UST_BUILD_WITH_LIBDL +liblttng_ust_la_LIBADD += -ldl +endif +if LTTNG_UST_BUILD_WITH_LIBC_DL +liblttng_ust_la_LIBADD += -lc +endif + liblttng_ust_la_CFLAGS = -DUST_COMPONENT="liblttng_ust" $(AM_CFLAGS) -- 2.34.1