From: Vitaly Lipatov Date: Sat, 30 Jun 2018 09:07:21 +0000 (+0300) Subject: Fix: use LIBDL/LIBC_DL to select either libdl or libc X-Git-Tag: v2.11.0-rc1~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ab12eb57cf3fdd2c25df16a3d1e770a2642b93e8;p=lttng-ust.git 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 --- diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index a7edfd5c..57df3aed 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 \ @@ -96,10 +103,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)