From 0ba9b647b1db5d3e3f4196941401e01f255d9175 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 6 Feb 2012 13:29:25 -0500 Subject: [PATCH] Update static lib linking Signed-off-by: Mathieu Desnoyers --- README | 6 +++++- tests/hello-static-lib/Makefile.am | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README b/README index 23b83197..45521d00 100644 --- a/README +++ b/README @@ -67,7 +67,11 @@ USAGE: "TRACEPOINT_DEFINE" and include the tracepoint provider. - Use "-I." for the compilation unit containing the tracepoint provider include (e.g. tp.c). - - Link application with "-ldl -llttng-ust". + - Link application with "-ldl". + - If building the provider directly into the application, + link the application with "-llttng-ust". + - If building a static library for the provider, link the static + library with "-lllttng-ust". - Include the tracepoint provider header into all C files using the provider. - Example: diff --git a/tests/hello-static-lib/Makefile.am b/tests/hello-static-lib/Makefile.am index 31b26b72..0eff080c 100644 --- a/tests/hello-static-lib/Makefile.am +++ b/tests/hello-static-lib/Makefile.am @@ -3,11 +3,12 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -Wsystem-headers noinst_LTLIBRARIES = liblttng-ust-provider-ust-test-hello.la liblttng_ust_provider_ust_test_hello_la_SOURCES = \ tp.c ust_tests_hello.h +liblttng_ust_provider_ust_test_hello_la_LIBADD = \ + $(top_builddir)/liblttng-ust/liblttng-ust.la noinst_PROGRAMS = hello hello_SOURCES = hello.c -hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la \ - liblttng-ust-provider-ust-test-hello.la +hello_LDADD = -ldl liblttng-ust-provider-ust-test-hello.la noinst_SCRIPTS = run EXTRA_DIST = run -- 2.34.1