Select which binaries/extras to build at configure time
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 16 Oct 2015 23:08:29 +0000 (19:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 19 Oct 2015 20:20:41 +0000 (16:20 -0400)
Introduce new flags to the configure script to select what to build:

* By default everything is built *

--disable-bin-lttng
    Do not build anything under src/bin/lttng.
--disable-bin-lttng-consumerd
    Do not build anything under src/bin/lttng-consumerd.
--disable-bin-lttng-crash
    Do not build anything under src/bin/lttng-crash.
--disable-bin-lttng-relayd
    Do not build anything under src/bin/lttng-relayd.
--disable-bin-lttng-sessiond
    Do not build anything under src/bin/lttng-sessiond.
--disable-extras
    Do not build anything under extras.

Only the necessary libs (from src/lib and src/common) are built.
libcommon and libconfig are always built since they are used by every
target.

If any lttng-* binaries are disabled, 'tests' will not be built.
On ./configure a warning is shown to the user.
Also 'make check' and 'make checkinstall' only return a warning when 'tests'
are not built.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Makefile.am
configure.ac
src/bin/Makefile.am
src/common/Makefile.am
src/lib/Makefile.am
tests/Makefile.am

index 7b2a23f0da3c7b529f8d10451b9f60e506b6cec2..63101c541ce5f9f68c52736d24d7d4bcc15f600a 100644 (file)
@@ -1,10 +1,12 @@
 ACLOCAL_AMFLAGS = -I m4
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = include \
-                 src \
-                 tests \
-                 extras \
-                 doc
+DIST_SUBDIRS = include src extras doc tests
+
+SUBDIRS = include src doc tests
+
+if BUILD_EXTRAS
+SUBDIRS += extras
+endif
 
 dist_doc_DATA = LICENSE \
                 ChangeLog \
 
 dist_doc_DATA = LICENSE \
                 ChangeLog \
index ceaf3771520674a2fee3f38d38b71f1759d38844..a5494fbc57c47cf93d005b8d20b64979c5d4178c 100644 (file)
@@ -550,11 +550,158 @@ AS_IF([test "x$enable_test_python3_agent" = "xyes" -o "x$test_python3_agent_auto
 
        ])
 ])
 
        ])
 ])
-
 AC_SUBST([RUN_PYTHON_AGENT_TEST])
 AC_SUBST([PYTHON2_AGENT])
 AC_SUBST([PYTHON3_AGENT])
 
 AC_SUBST([RUN_PYTHON_AGENT_TEST])
 AC_SUBST([PYTHON2_AGENT])
 AC_SUBST([PYTHON3_AGENT])
 
+# 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],
+             [Disable the build of lttng-consumerd binaries]))
+AC_ARG_ENABLE([bin-lttng-crash], AS_HELP_STRING([--disable-bin-lttng-crash],[Disable the build of lttng-crash binaries]))
+AC_ARG_ENABLE([bin-lttng-relayd], AS_HELP_STRING([--disable-bin-lttng-relayd],
+             [Disable the build of lttng-relayd binaries]))
+AC_ARG_ENABLE([bin-lttng-sessiond], AS_HELP_STRING([--disable-bin-lttng-sessiond],
+             [Disable the build of lttng-sessiond binaries]))
+AC_ARG_ENABLE([extras], AS_HELP_STRING([--disable-extras],
+             [Disable the build of the extra components]))
+
+
+# Always build libconfig since it a dependency of libcommon
+build_lib_config=yes
+
+build_lib_compat=no
+build_lib_consumer=no
+build_lib_hashtable=no
+build_lib_health=no
+build_lib_index=no
+build_lib_kernel_consumer=no
+build_lib_kernel_ctl=no
+build_lib_lttng_ctl=no
+build_lib_relayd=no
+build_lib_sessiond_comm=no
+build_lib_testpoint=no
+build_lib_ust_consumer=no
+
+# There is an overlap for enabled dependencies, but this makes everything
+# simpler. libcommon and libconfig are always compiled so they are not repeated
+# here.
+
+# Enable binary dependencies.
+AS_IF([test x$enable_bin_lttng != xno],
+      [
+       build_lib_lttng_ctl=yes
+      ]
+)
+
+AS_IF([test x$enable_bin_lttng_consumerd != xno],
+      [
+       build_lib_consumer=yes
+       build_lib_sessiond_comm=yes
+       build_lib_index=yes
+       build_lib_health=yes
+       build_lib_testpoint=yes
+      ]
+)
+
+AS_IF([test x$enable_bin_lttng_crash != xno],
+      # Do nothing since libconfig and libcommon are built by default.
+      []
+)
+
+AS_IF([test x$enable_bin_lttng_relayd != xno],
+      [
+       build_lib_lttng_ctl=yes
+       build_lib_sessiond_comm=yes
+       build_lib_hashtable=yes
+       build_lib_compat=yes
+       build_lib_index=yes
+       build_lib_health=yes
+       build_lib_testpoint=yes
+      ]
+)
+AS_IF([test x$enable_bin_lttng_sessiond != xno],
+      [
+       build_lib_lttng_ctl=yes
+       build_lib_sessiond_comm=yes
+       build_lib_kernel_ctl=yes
+       build_lib_hashtable=yes
+       build_lib_compat=yes
+       build_lib_relayd=yes
+       build_lib_testpoint=yes
+       build_lib_health=yes
+       build_lib_health=yes
+      ]
+)
+
+# Libraries dependencies enabling
+AS_IF([test x$build_lib_lttng_ctl = xyes],
+      [
+       build_lib_sessiond_comm=yes
+       build_lib_hashtable=yes
+      ]
+)
+
+AS_IF([test x$build_lib_consumer = xyes],
+      [
+       build_lib_sessiond_comm=yes
+       build_lib_kernel_consumer=yes
+       build_lib_hashtable=yes
+       build_lib_compat=yes
+       build_lib_relayd=yes
+       AS_IF([test x$lttng_ust_ctl_found = xyes],[build_lib_ust_consumer=yes])
+      ]
+)
+
+AS_IF([test x$build_lib_kernel_consumer = xyes],
+      [
+       build_lib_kernel_ctl=yes
+       build_lib_relayd=yes
+      ]
+)
+
+AS_IF([test x$build_lib_relayd = xyes],
+      [
+       build_lib_sessiond_comm=yes
+      ]
+)
+
+
+# Export binaries build conditions.
+AM_CONDITIONAL([BUILD_BIN_LTTNG], [test x$enable_bin_lttng != xno])
+AM_CONDITIONAL([BUILD_BIN_LTTNG_CONSUMERD], [test x$enable_bin_lttng_consumerd != xno])
+AM_CONDITIONAL([BUILD_BIN_LTTNG_CRASH], [test x$enable_bin_lttng_crash != xno])
+AM_CONDITIONAL([BUILD_BIN_LTTNG_RELAYD], [test x$enable_bin_lttng_relayd != xno])
+AM_CONDITIONAL([BUILD_BIN_LTTNG_SESSIOND], [test x$enable_bin_lttng_sessiond != xno])
+
+# Export the tests and extras build conditions.
+AS_IF([\
+test "x$enable_bin_lttng" != "xno" && \
+test "x$enable_bin_lttng_consumerd" != "xno" && \
+test "x$enable_bin_lttng_crash" != "xno" && \
+test "x$enable_bin_lttng_relayd" != "xno" && \
+test "x$enable_bin_lttng_sessiond" != "xno"],
+[build_tests=yes],
+[build_tests=no]
+)
+
+AM_CONDITIONAL([BUILD_TESTS], [test x$build_tests = xyes])
+AM_CONDITIONAL([BUILD_EXTRAS], [test x$enable_extras != xno])
+
+# Export libraries build conditions.
+AM_CONDITIONAL([BUILD_LIB_COMPAT], [test x$build_lib_compat = xyes])
+AM_CONDITIONAL([BUILD_LIB_CONFIG], [test x$build_lib_config = xyes])
+AM_CONDITIONAL([BUILD_LIB_CONSUMER], [test x$build_lib_consumer = xyes])
+AM_CONDITIONAL([BUILD_LIB_HASHTABLE], [test x$build_lib_hashtable = xyes])
+AM_CONDITIONAL([BUILD_LIB_HEALTH], [test x$build_lib_health = xyes])
+AM_CONDITIONAL([BUILD_LIB_INDEX], [test x$build_lib_index = xyes])
+AM_CONDITIONAL([BUILD_LIB_KERNEL_CONSUMER], [test x$build_lib_kernel_consumer = xyes])
+AM_CONDITIONAL([BUILD_LIB_KERNEL_CTL], [test x$build_lib_kernel_ctl = xyes])
+AM_CONDITIONAL([BUILD_LIB_LTTNG_CTL], [test x$build_lib_lttng_ctl = xyes])
+AM_CONDITIONAL([BUILD_LIB_RELAYD], [test x$build_lib_relayd = xyes])
+AM_CONDITIONAL([BUILD_LIB_SESSIOND_COMM], [test x$build_lib_sessiond_comm = xyes])
+AM_CONDITIONAL([BUILD_LIB_TESTPOINT], [test x$build_lib_testpoint = xyes])
+AM_CONDITIONAL([BUILD_LIB_UST_CONSUMER], [test x$build_lib_ust_consumer = xyes])
 
 if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-parser.h"; then
        if test x"$YACC" != "xbison -y"; then
 
 if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-parser.h"; then
        if test x"$YACC" != "xbison -y"; then
@@ -670,13 +817,13 @@ AC_CONFIG_FILES([
        tests/utils/testapp/gen-ust-tracef/Makefile
 ])
 
        tests/utils/testapp/gen-ust-tracef/Makefile
 ])
 
-# Inject variable into python test script
+# Inject variable into python test script.
 AC_CONFIG_FILES([tests/regression/ust/python-logging/test_python_logging],[chmod +x tests/regression/ust/python-logging/test_python_logging])
 
 AC_OUTPUT
 
 #
 AC_CONFIG_FILES([tests/regression/ust/python-logging/test_python_logging],[chmod +x tests/regression/ust/python-logging/test_python_logging])
 
 AC_OUTPUT
 
 #
-# Mini-report on what will be built
+# Mini-report on what will be built.
 #
 AS_ECHO()
 
 #
 AS_ECHO()
 
@@ -685,7 +832,7 @@ AS_ECHO("$version_description")
 
 AS_ECHO()
 
 
 AS_ECHO()
 
-# Target architecture we're building for
+# Target architecture we're building for.
 target_arch=$host_cpu
 [
 for f in $CFLAGS; do
 target_arch=$host_cpu
 [
 for f in $CFLAGS; do
@@ -715,6 +862,69 @@ AS_IF([test "x$lttng_ust_support" = "xyes"],[
        AS_ECHO("Disabled")
 ])
 
        AS_ECHO("Disabled")
 ])
 
+AS_ECHO()
+AS_ECHO("Binaries:")
+
+# List binaries to be built
+AS_ECHO_N("lttng: ")
+AS_IF([test x$enable_bin_lttng != xno],[
+       AS_ECHO("Enabled")
+],[
+       AS_ECHO("Disabled")
+])
+
+AS_ECHO_N("lttng-consumerd: ")
+AS_IF([test x$enable_bin_lttng_consumerd != xno],[
+       AS_ECHO("Enabled")
+],[
+       AS_ECHO("Disabled")
+])
+
+AS_ECHO_N("lttng-crash: ")
+AS_IF([test x$enable_bin_lttng_crash != xno],[
+       AS_ECHO("Enabled")
+],[
+       AS_ECHO("Disabled")
+])
+
+AS_ECHO_N("lttng-relayd: ")
+AS_IF([test x$enable_bin_lttng_relayd != xno],[
+       AS_ECHO("Enabled")
+],[
+       AS_ECHO("Disabled")
+])
+
+AS_ECHO_N("lttng-sessiond: ")
+AS_IF([test x$enable_bin_lttng_sessiond != xno],[
+       AS_ECHO("Enabled")
+],[
+       AS_ECHO("Disabled")
+])
+
+AS_ECHO_N("Extras: ")
+AS_IF([test x$enable_extras != xno],[
+       AS_ECHO("Enabled")
+],[
+       AS_ECHO("Disabled")
+])
+
+# Print the bindir and libdir this `make install' will install into.
+AS_ECHO()
+AS_ECHO_N("Binaries will be installed in:  ")
+AS_ECHO("`eval eval echo $bindir`")
+AS_ECHO_N("Libraries will be installed in: ")
+AS_ECHO("`eval eval echo $libdir`")
+
+
+AS_ECHO()
+
+# Print clear message that tests won't be built
+AS_IF([test "x$build_tests" = "xno"],[
+       AS_ECHO("WARNING: Tests won't be built since some binaries were disabled")
+])
+
+AS_ECHO("Tests:")
+
 # LTTng UST Java agent JUL tests enabled/disabled
 AS_ECHO_N("LTTng-UST Java agent JUL tests: ")
 AS_IF([test "x$test_java_agent_jul" = "xyes"],[
 # LTTng UST Java agent JUL tests enabled/disabled
 AS_ECHO_N("LTTng-UST Java agent JUL tests: ")
 AS_IF([test "x$test_java_agent_jul" = "xyes"],[
@@ -753,13 +963,6 @@ AS_IF([test "x${enable_python_binding:-yes}" = xyes], [
        AS_ECHO("Disabled")
 ])
 
        AS_ECHO("Disabled")
 ])
 
-# Print the bindir and libdir this `make install' will install into.
-AS_ECHO()
-AS_ECHO_N("Binaries will be installed in:  ")
-AS_ECHO("`eval eval echo $bindir`")
-AS_ECHO_N("Libraries will be installed in: ")
-AS_ECHO("`eval eval echo $libdir`")
-
 # If we build the sessiond, print the paths it will use
 AS_ECHO()
 AS_ECHO_N("The lttng command will search for the lttng-sessiond executable at: ")
 # If we build the sessiond, print the paths it will use
 AS_ECHO()
 AS_ECHO_N("The lttng command will search for the lttng-sessiond executable at: ")
index ebf9b57ff938511d12091560a16c16ffa79c6a1c..73cfac7b76986076f031299fc630f498ac375c9d 100644 (file)
@@ -1,7 +1,28 @@
 ACLOCAL_AMFLAGS = -I config
 
 ACLOCAL_AMFLAGS = -I config
 
-SUBDIRS = lttng-consumerd \
-                 lttng \
-          lttng-sessiond \
-          lttng-relayd \
-          lttng-crash
+SUBDIRS =
+
+# Make sure to always distribute all folders
+# since SUBDIRS is decided at configure time.
+DIST_SUBDIRS = lttng-consumerd lttng lttng-sessiond lttng-relayd \
+              lttng-crash
+
+if BUILD_BIN_LTTNG
+SUBDIRS += lttng
+endif
+
+if BUILD_BIN_LTTNG_CONSUMERD
+SUBDIRS += lttng-consumerd
+endif
+
+if BUILD_BIN_LTTNG_CRASH
+SUBDIRS += lttng-crash
+endif
+
+if BUILD_BIN_LTTNG_RELAYD
+SUBDIRS += lttng-relayd
+endif
+
+if BUILD_BIN_LTTNG_SESSIOND
+SUBDIRS += lttng-sessiond
+endif
index 0b16e4be9f3e7cb7e3b4b9e007f8131a50c7c453..148130177f177d2be79fd0e99c638d64b3da6b54 100644 (file)
@@ -2,9 +2,60 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
 
 AUTOMAKE_OPTIONS = subdir-objects
 
 
 AUTOMAKE_OPTIONS = subdir-objects
 
-SUBDIRS = compat health hashtable kernel-ctl sessiond-comm relayd \
-                 kernel-consumer ust-consumer testpoint index config \
-                 consumer
+SUBDIRS =
+
+# Make sure to always distribute all folders
+# since SUBDIRS is decided at configure time.
+DIST_SUBDIRS = compat health hashtable kernel-ctl sessiond-comm relayd \
+         kernel-consumer ust-consumer testpoint index config consumer
+
+if BUILD_LIB_COMPAT
+SUBDIRS += compat
+endif
+
+if BUILD_LIB_HEALTH
+SUBDIRS += health
+endif
+
+if BUILD_LIB_HASHTABLE
+SUBDIRS += hashtable
+endif
+
+if BUILD_LIB_KERNEL_CTL
+SUBDIRS += kernel-ctl
+endif
+
+if BUILD_LIB_SESSIOND_COMM
+SUBDIRS += sessiond-comm
+endif
+
+if BUILD_LIB_RELAYD
+SUBDIRS += relayd
+endif
+
+if BUILD_LIB_KERNEL_CONSUMER
+SUBDIRS += kernel-consumer
+endif
+
+if BUILD_LIB_UST_CONSUMER
+SUBDIRS += ust-consumer
+endif
+
+if BUILD_LIB_TESTPOINT
+SUBDIRS += testpoint
+endif
+
+if BUILD_LIB_INDEX
+SUBDIRS += index
+endif
+
+if BUILD_LIB_CONFIG
+SUBDIRS += config
+endif
+
+if BUILD_LIB_CONSUMER
+SUBDIRS += consumer
+endif
 
 AM_CFLAGS = -fno-strict-aliasing
 
 
 AM_CFLAGS = -fno-strict-aliasing
 
index 482f20c1551a01a6e7295e37585c459cb0eb0209..82458a44fbe26b6d5f1004a112dee57452e45dab 100644 (file)
@@ -1 +1,7 @@
-SUBDIRS = lttng-ctl
+SUBDIRS =
+
+DIST_SUBDIRS = lttng-ctl
+
+if BUILD_LIB_LTTNG_CTL
+SUBDIRS += lttng-ctl
+endif
index d72b1ecd89fd30c94154c10e294d1a0cca1e4987..99c20422e0cfbfca5231d3bd1046420f8e3c3fca 100644 (file)
@@ -1,18 +1,35 @@
-SUBDIRS = utils regression unit stress
+SUBDIRS =
+DIST_SUBDIRS = utils regression unit stress
+
+if BUILD_TESTS
+SUBDIRS += utils regression unit stress
+endif
 
 installcheck-am:
 
 installcheck-am:
+if BUILD_TESTS
        ./run.sh unit_tests
        ./run.sh fast_regression
 if PYTHON_BINDING
        ./run.sh with_bindings_regression
 endif
        ./run.sh unit_tests
        ./run.sh fast_regression
 if PYTHON_BINDING
        ./run.sh with_bindings_regression
 endif
+else
+       @echo "========================================="
+       @echo "WARNING: Tests were disabled at configure"
+       @echo "========================================="
+endif
 
 check-am:
 
 check-am:
+if BUILD_TESTS
        ./run.sh unit_tests
        ./run.sh fast_regression
 if PYTHON_BINDING
        ./run.sh with_bindings_regression
 endif
        ./run.sh unit_tests
        ./run.sh fast_regression
 if PYTHON_BINDING
        ./run.sh with_bindings_regression
 endif
+else
+       @echo "========================================="
+       @echo "WARNING: Tests were disabled at configure"
+       @echo "========================================="
+endif
 
 dist_noinst_SCRIPTS = run.sh unit_tests fast_regression long_regression root_regression with_bindings_regression
 EXTRA_DIST = run.sh unit_tests fast_regression long_regression root_regression with_bindings_regression README
 
 dist_noinst_SCRIPTS = run.sh unit_tests fast_regression long_regression root_regression with_bindings_regression
 EXTRA_DIST = run.sh unit_tests fast_regression long_regression root_regression with_bindings_regression README
This page took 0.031254 seconds and 4 git commands to generate.