Skip to contentSkip to conversation

Fix: Conditionnally disable tests requiring shared libs support

PATCH Mathieu Desnoyers 1 participant 1 message Nov 5, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Applied
#1 lore raw
Quoted 11 lines · * Christian Babeux ([email protected]) wrote:

When building lttng-ust with shared library support explicitly disabled (e.g.: ./configure --disable-shared), libtool fail with a fatal error:

  CC       tp.lo
  CC       tp2.lo
  CCLD     liblttng-ust-provider-ust-tests-demo.la

libtool: link: can not build a shared library
libtool: link: See the libtool documentation for more information.
libtool: link: Fatal configuration error.

Quoted 7 lines

The build should not fail because some tests require explicit shared library support, instead they should be skipped.

This patch detect that the --disable-shared flag was passed to the configure script and toggle the "NO_SHARED" Automake variable. Thus, the tests that require explicit shared library support can be skipped when the NO_SHARED variable is true.

merged into master and stable-2.0, thanks!

Mathieu

Quoted 43 lines
---
 configure.ac           | 2 ++
 tests/demo/Makefile.am | 5 +++++
 2 files changed, 7 insertions(+)
configure.ac +2 -0
index 91ad8d9..87e89d5 100644
@@ -64,6 +64,8 @@ AS_IF([test "x$libtool_fixup" = "xyes"],
 		  ])
 	    ])
 
+AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
+
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_CXX
tests/demo/Makefile.am +5 -0
index 0e43255..76ab598 100644
@@ -6,6 +6,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers
 # libraries.
 LIBS =
 
+if NO_SHARED
+# Do not build this test if shared libraries support was
+# explicitly disabled.
+else
 # Force the shared flag on the noinst libraries since they are
 # only built static by default
 FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \
@@ -41,3 +45,4 @@ if LTTNG_UST_BUILD_WITH_LIBC_DL
 demo_LDADD = -lc
 endif
 
+endif
Signature · 1 line
1.8.0
Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com