Fix: Do not install health tests helper libraries
authorChristian Babeux <>
Tue, 6 Nov 2012 18:32:05 +0000 (13:32 -0500)
committerDavid Goulet <>
Tue, 6 Nov 2012 19:41:53 +0000 (14:41 -0500)
The libraries libhealthexit and libhealthstall should not be installed
on the user system. They are only useful for the health check tests.

Furthermore, when adding libraries to noinst_LTLIBRARIES, libtool will
only build these as static libraries (see [1] for a workaround). This is
fine for most use cases, but for the health tests, we _must_ have shared
libraries (the nature of the tests require LD_PRELOAD), hence we force
the build of a shared object.

Forcing shared object has the unfortunate side-effect of breaking builds
where configure was invoked with "--disable-shared" flag.  Instead of
failing badly, detect this flag and skip the health tests altogether.

noinst shared libs:
[1] -

Acked-by: Mathieu Desnoyers <>
Signed-off-by: Christian Babeux <>
Signed-off-by: David Goulet <>

index 72daf7e0f32c42770bfa2a60fb04c13bd66b527c..a3120fc041568bc37ea919d708fec8c46ab86a74 100644 (file)
@@ -39,6 +39,8 @@ AS_IF([test "x$libtool_fixup" = "xyes"],
+AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
        sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
        signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
index 9fab58234a370f7ed0b6a5c41b53cfa663ae40be..f1a5d915d9350c8506a8a58800ab07dff00bbc28 100644 (file)
@@ -8,23 +8,27 @@ if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
 AM_LDFLAGS += -lc
+# Do not build this test if shared libraries support was
+# explicitly disabled.
+# In order to test the health check feature, the libhealth* libs
+# must be built as .so to be able to LD_PRELOAD them.
+FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \
+                          -rpath $(abs_builddir)
 # Health thread exit ld_preloaded test lib
-libhealthexit_la_LDFLAGS= -module
 # Health thread stall ld_preloaded test lib
-libhealthstall_la_LDFLAGS= -module
 noinst_PROGRAMS = health_check
 health_check_SOURCES = health_check.c $(UTILS)
 health_check_LDADD = $(top_builddir)/src/lib/lttng-ctl/ \
-noinst_SCRIPTS =
This page took 0.025901 seconds and 4 git commands to generate.