From 1d586c7f93f26f4f29d308835c738b06834d6a70 Mon Sep 17 00:00:00 2001 From: Christian Babeux Date: Fri, 3 Aug 2012 16:31:28 -0400 Subject: [PATCH] Fix: Missing libs dependencies in configure check for lttng-ust-ctl The lttng-ust-ctl library depends on liburcu-{common,bp,cds}. The AC_CHECK_LIBRARY macro can't automatically resolve dependents libraries (ala libtool), so any additionnals dependencies must be manually specified. Also, the AC_CHECK_LIB action-if-found case for the lttng-ust-ctl check is modified to have a similar behavior as the default action, which is to define HAVE_LIBxxx and append -lxxx to $LIBS, *except* for the later step. This is to ensure that any future addition of AC_CHECK_LIB after the one for lttng-ust-ctl will not need to append the liburcu dependencies or fail unexpectedly. Acked-by: Mathieu Desnoyers Signed-off-by: Christian Babeux Signed-off-by: David Goulet --- configure.ac | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 286aa8933..65d709dd8 100644 --- a/configure.ac +++ b/configure.ac @@ -138,13 +138,16 @@ AC_ARG_ENABLE(lttng-ust, lttng_ust_support=$enableval, lttng_ust_support=yes) AS_IF([test "x$lttng_ust_support" = "xyes"], [ - AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [], - [AC_MSG_ERROR([Cannot find LTTng-UST. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])] + AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], + [ + AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) + lttng_ust_ctl_found=yes + ], + [AC_MSG_ERROR([Cannot find LTTng-UST. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], + [-lurcu-common -lurcu-bp -lurcu-cds] ) ]) - -AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ]) - +AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) AC_CHECK_FUNCS([sched_getcpu sysconf]) # check for dlopen -- 2.34.1