From: Christian Babeux Date: Fri, 3 Aug 2012 20:31:28 +0000 (-0400) Subject: Fix: Missing libs dependencies in configure check for lttng-ust-ctl X-Git-Tag: v2.1.0-rc1~29 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=082d0908b5e894bfbeb2be6f89f9a1916ff11089 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 --- diff --git a/configure.ac b/configure.ac index 3a023cdcc..e4b9eb1ad 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