configure.ac: introduce --{disable,enable}-lib-lttng-ctl
authorChristophe Bedard <christophe.bedard@apex.ai>
Tue, 23 Jan 2024 22:52:55 +0000 (14:52 -0800)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 29 Feb 2024 22:19:33 +0000 (17:19 -0500)
The goal is to be able to only build liblttng-ctl, for example without
needing to build bin/lttng.

Since liblttng-ctl is required when building some of the binaries,
./configure will fail if --disabled (explicitly) unless those binaries
are --disabled too.

Previously, the following would result in liblttng-ctl not getting
built, but it now gets built by default:

  ./configure \
    --disable-bin-lttng \
    --disable-bin-lttng-relayd \
    --disable-bin-lttng-sessiond

Change-Id: I9338c46e64c031360aa762a3ce891511a3dbba39
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac

index 3c3b2f39b6b018d06655686443e3cb4bf660c483..836ff15b8e562bd2cb2738e43e6ce8fc84c6d386 100644 (file)
@@ -953,6 +953,9 @@ AS_IF([test "$test_sdt_uprobe" = "autodetect"], [
 
 AM_CONDITIONAL([TEST_SDT_UPROBE], [test "$test_sdt_uprobe" = "yes"])
 
+AC_ARG_ENABLE([lib-lttng-ctl], AS_HELP_STRING([--disable-lib-lttng-ctl],
+       [Disable the build of liblttng-ctl (only possible if no binaries that depend on it are built)]))
+
 # Arguments for binaries build exclusion
 AC_ARG_ENABLE([bin-lttng], AS_HELP_STRING([--disable-bin-lttng],[Disable the build of lttng binaries]))
 AC_ARG_ENABLE([bin-lttng-consumerd], AS_HELP_STRING([--disable-bin-lttng-consumerd],
@@ -1023,11 +1026,23 @@ AS_IF([test x$enable_bin_lttng_sessiond != xno],
 )
 
 # Libraries dependencies enabling
+# If we want to build liblttng-ctl
+AS_IF([test x$enable_lib_lttng_ctl != xno],
+      [
+       build_lib_lttng_ctl=yes
+      ]
+)
+# If we need to build liblttng-ctl because a binary depends on it
 AS_IF([test x$build_lib_lttng_ctl = xyes],
       [
        build_lib_sessiond_comm=yes
       ]
 )
+# Fail if we didn't want to build liblttng-ctl but need to build it anyway
+AS_IF([test "x$build_lib_lttng_ctl" = "xyes" -a "x$enable_lib_lttng_ctl" = "xno"],[
+       AC_MSG_FAILURE(
+               [liblttng-ctl must be built, because at least one binary that depends on it is enabled])
+])
 
 AS_IF([test x$build_lib_consumer = xyes],
       [
@@ -1347,6 +1362,13 @@ PPRINT_PROP_BOOL([libkmod support], $value)
 test "x$with_lttng_ust" = "xyes" && value=1 || value=0
 PPRINT_PROP_BOOL([LTTng-UST support], $value)
 
+AS_ECHO
+PPRINT_SUBTITLE([Libraries])
+
+# liblttng-ctl enabled/disabled
+test x$build_lib_lttng_ctl != xno && value=1 || value=0
+PPRINT_PROP_BOOL([liblttng-ctl], $value)
+
 AS_ECHO
 PPRINT_SUBTITLE([Binaries])
 
This page took 0.026278 seconds and 4 git commands to generate.