From 41ad81d87d649dd658ef0305d3abc987abb3fc5d Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 18 Mar 2021 16:08:48 -0400 Subject: [PATCH] configure: standardize automake conditional names This is part of an effort to standardise our autotools setup across project to simplify maintenance. Change-Id: I32fe475e04e77b2972ed9d963f1d2a5c6440a4ce Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- Makefile.am | 11 ++++------- configure.ac | 22 +++++++++++----------- doc/examples/Makefile.am | 10 +++++----- doc/man/Makefile.am | 14 +++++++------- libcounter/Makefile.am | 2 +- liblttng-ust-java-agent/java/Makefile.am | 4 ++-- liblttng-ust-java-agent/jni/Makefile.am | 4 ++-- libringbuffer/Makefile.am | 2 +- tests/compile/Makefile.am | 2 +- 9 files changed, 34 insertions(+), 37 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7fc4fd48..9d362f42 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,28 +13,25 @@ SUBDIRS = . include snprintf libringbuffer liblttng-ust-comm \ liblttng-ust-cyg-profile \ tools -if HAVE_DLINFO +if ENABLE_UST_DL SUBDIRS += liblttng-ust-dl endif -if BUILD_JNI_INTERFACE +if ENABLE_JNI_INTERFACE SUBDIRS += liblttng-ust-java endif -if BUILD_JAVA_AGENT +if ENABLE_JAVA_AGENT SUBDIRS += liblttng-ust-java-agent endif -if BUILD_PYTHON_AGENT +if ENABLE_PYTHON_AGENT SUBDIRS += python-lttngust \ liblttng-ust-python-agent endif SUBDIRS += tests doc -#temporarily disabled -# liblttng-ust-malloc - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = lttng-ust.pc lttng-ust-ctl.pc diff --git a/configure.ac b/configure.ac index d089cfaa..89d2c1ea 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ m4_version_prereq([2.70], [], [AC_PROG_CC_STDC]) AC_PROG_CXX AX_CXX_COMPILE_STDCXX([11]) RW_PROG_CXX_WORKS -AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"]) +AM_CONDITIONAL([HAVE_CXX], [test "x$rw_cv_prog_cxx_works" = "xyes"]) # Check if the compiler support weak symbols AX_SYS_WEAK_ALIAS @@ -247,7 +247,7 @@ AS_IF([test "x${ac_cv_header_dlfcn_h}" = "xyes"], [ ac_cv_have_decl_RTLD_DI_LINKMAP="no" ]) -AM_CONDITIONAL([HAVE_DLINFO], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"]) +AM_CONDITIONAL([ENABLE_UST_DL], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"]) # Require URCU >= 0.12 for DEFINE_URCU_TLS_INIT PKG_CHECK_MODULES([URCU], [liburcu >= 0.12]) @@ -271,7 +271,7 @@ AS_IF([test "x$enable_numa" = "xyes"], [ [AC_MSG_ERROR([libnuma is not available. Please either install it (e.g. libnuma-dev) or use [LDFLAGS]=-Ldir to specify the right location, or use --disable-numa configure argument to disable NUMA support.])]) have_libnuma=yes ]) -AM_CONDITIONAL([HAVE_LIBNUMA], [test "x$have_libnuma" = "xyes"]) +AM_CONDITIONAL([ENABLE_NUMA], [test "x$have_libnuma" = "xyes"]) # optional linux/perf_event.h AC_CHECK_HEADERS([linux/perf_event.h], [have_perf_event=yes], []) @@ -294,7 +294,7 @@ AS_HELP_STRING([--enable-jni-interface], [build JNI interface between C and Java jni_interface=no ]) -AM_CONDITIONAL([BUILD_JNI_INTERFACE], [test "x$jni_interface" = "xyes"]) +AM_CONDITIONAL([ENABLE_JNI_INTERFACE], [test "x$jni_interface" = "xyes"]) AC_ARG_ENABLE([java-agent-jul], [ @@ -320,9 +320,9 @@ AS_HELP_STRING([--enable-java-agent-all], [build the LTTng UST Java agent with a java_agent_log4j=$enableval ], [:]) -AM_CONDITIONAL([BUILD_JAVA_AGENT], [test "x$java_agent_jul" = "xyes" || test "x$java_agent_log4j" = "xyes"]) -AM_CONDITIONAL([BUILD_JAVA_AGENT_WITH_JUL], [test "x$java_agent_jul" = "xyes"]) -AM_CONDITIONAL([BUILD_JAVA_AGENT_WITH_LOG4J], [test "x$java_agent_log4j" = "xyes"]) +AM_CONDITIONAL([ENABLE_JAVA_AGENT], [test "x$java_agent_jul" = "xyes" || test "x$java_agent_log4j" = "xyes"]) +AM_CONDITIONAL([ENABLE_JAVA_AGENT_WITH_JUL], [test "x$java_agent_jul" = "xyes"]) +AM_CONDITIONAL([ENABLE_JAVA_AGENT_WITH_LOG4J], [test "x$java_agent_log4j" = "xyes"]) AS_IF([test "x$jni_interface" = "xyes" || test "x$java_agent_jul" = "xyes" || test "x$java_agent_log4j" = "xyes"], [ AX_JAVA_OPTIONS @@ -359,7 +359,7 @@ AS_HELP_STRING([--enable-python-agent], [build the LTTng UST Python agent [defau ], [ python_agent=$enableval ], [:]) -AM_CONDITIONAL([BUILD_PYTHON_AGENT], [test "x$python_agent" = "xyes"]) +AM_CONDITIONAL([ENABLE_PYTHON_AGENT], [test "x$python_agent" = "xyes"]) AS_IF([test "x$python_agent" = "xyes"], [ AM_PATH_PYTHON([2.7]) ]) @@ -401,8 +401,8 @@ AS_HELP_STRING([--with-lttng-system-rundir], [Location of the system directory w AC_DEFINE_UNQUOTED([LTTNG_SYSTEM_RUNDIR], ["$lttng_system_rundir"], [LTTng system runtime directory]) -AC_CHECK_PROG([BUILD_GEN_TP_EXAMPLES], [python], ["yes"]) -AM_CONDITIONAL([BUILD_GEN_TP_EXAMPLES], [test "x$BUILD_GEN_TP_EXAMPLES" = "xyes"]) +AC_CHECK_PROG([ENABLE_GEN_TP_EXAMPLES], [python], ["yes"]) +AM_CONDITIONAL([ENABLE_GEN_TP_EXAMPLES], [test "x$ENABLE_GEN_TP_EXAMPLES" = "xyes"]) # Enable building examples AC_ARG_ENABLE( @@ -465,7 +465,7 @@ they will not be installed. # Export man page build condition: build the man pages if the user # asked for it, and if the tools are available. -AM_CONDITIONAL([MAN_PAGES_OPT], [test "x$man_pages_opt" != "xno"]) +AM_CONDITIONAL([ENABLE_MAN_PAGES], [test "x$man_pages_opt" != "xno"]) AM_CONDITIONAL([HAVE_ASCIIDOC_XMLTO], [test "x$have_asciidoc_xmlto" = "xyes"]) AM_CFLAGS="-Wall $URCU_CFLAGS $PTHREAD_CFLAGS" diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index b66acaf4..a7f52a04 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -11,7 +11,7 @@ doc_examples_clock_overridedir = ${docdir}/examples/clock-override doc_examples_getcpu_overridedir = ${docdir}/examples/getcpu-override doc_examples_cmakedir = ${docdir}/examples/cmake-multiple-shared-libraries -if BUILD_JAVA_AGENT_WITH_JUL +if ENABLE_JAVA_AGENT_WITH_JUL doc_examples_java_juldir = ${docdir}/examples/java-jul dist_doc_examples_java_jul_DATA = java-jul/Makefile \ java-jul/Hello.java \ @@ -22,7 +22,7 @@ dist_doc_examples_java_jul_DATA = java-jul/Makefile \ SUBDIRS_JUL = java-jul endif -if BUILD_JAVA_AGENT_WITH_LOG4J +if ENABLE_JAVA_AGENT_WITH_LOG4J doc_examples_java_log4jdir = ${docdir}/examples/java-log4j dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \ java-log4j/Hello.java \ @@ -30,13 +30,13 @@ dist_doc_examples_java_log4j_DATA = java-log4j/Makefile \ SUBDIRS_LOG4J = java-log4j endif -if BUILD_PYTHON_AGENT +if ENABLE_PYTHON_AGENT doc_examples_pythondir = ${docdir}/examples/python dist_doc_examples_python_DATA = python/hello.py endif if HAVE_CMAKE -if CXX_WORKS +if HAVE_CXX SUBDIRS_CMAKE = cmake-multiple-shared-libraries endif endif @@ -105,7 +105,7 @@ dist_doc_examples_getcpu_override_DATA = getcpu-override/Makefile \ SUBDIRS_PROXY = easy-ust demo hello-static-lib demo-tracef clock-override \ getcpu-override demo-tracelog -if BUILD_GEN_TP_EXAMPLES +if ENABLE_GEN_TP_EXAMPLES SUBDIRS_PROXY += gen-tp endif diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index d84bfcdc..c9e3bee5 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -49,7 +49,7 @@ MAN1 = $(addsuffix .1,$(MAN1_NAMES)) MAN3 = $(addsuffix .3,$(MAN3_NAMES)) $(MAN3_ALIASES) MAN = $(MAN1) $(MAN3) -if MAN_PAGES_OPT +if ENABLE_MAN_PAGES # At this point, we know the user asked to build the man pages. if HAVE_ASCIIDOC_XMLTO @@ -105,28 +105,28 @@ ERR_MSG += "Make sure both tools are installed and run the configure script agai @echo $(ERR_MSG) @false endif # HAVE_ASCIIDOC_XMLTO -endif # MAN_PAGES_OPT +endif # ENABLE_MAN_PAGES # Start with empty distributed/installed man pages: dist_man1_MANS = dist_man3_MANS = EXTRA_DIST = -if MAN_PAGES_OPT +if ENABLE_MAN_PAGES # Building man pages: we can install and distribute them. dist_man1_MANS += $(MAN1) dist_man3_MANS += $(MAN3) $(MAN3_TROFF) -else # MAN_PAGES_OPT +else # ENABLE_MAN_PAGES # Those are not known by automake yet because dist_man3_MANS is empty # at this point, so make sure they are distributed. EXTRA_DIST += $(MAN3_TROFF) -endif # MAN_PAGES_OPT +endif # ENABLE_MAN_PAGES -if !MAN_PAGES_OPT +if !ENABLE_MAN_PAGES dist-hook: @echo "Error: Please enable the man pages before creating a distribution tarball." @false -endif # !MAN_PAGES_OPT +endif # !ENABLE_MAN_PAGES # Always distribute the source files. EXTRA_DIST += $(MAN_TXT) $(COMMON_TXT) $(XSL_FILE) $(ASCIIDOC_CONF) README.md diff --git a/libcounter/Makefile.am b/libcounter/Makefile.am index eeeb86ce..534238f4 100644 --- a/libcounter/Makefile.am +++ b/libcounter/Makefile.am @@ -13,7 +13,7 @@ libcounter_la_LIBADD = \ -lpthread \ -lrt -if HAVE_LIBNUMA +if ENABLE_NUMA libcounter_la_LIBADD += -lnuma endif diff --git a/liblttng-ust-java-agent/java/Makefile.am b/liblttng-ust-java-agent/java/Makefile.am index 0f74d18c..96d575aa 100644 --- a/liblttng-ust-java-agent/java/Makefile.am +++ b/liblttng-ust-java-agent/java/Makefile.am @@ -2,10 +2,10 @@ SUBDIRS = lttng-ust-agent-common lttng-ust-agent-all -if BUILD_JAVA_AGENT_WITH_JUL +if ENABLE_JAVA_AGENT_WITH_JUL SUBDIRS += lttng-ust-agent-jul endif -if BUILD_JAVA_AGENT_WITH_LOG4J +if ENABLE_JAVA_AGENT_WITH_LOG4J SUBDIRS += lttng-ust-agent-log4j endif diff --git a/liblttng-ust-java-agent/jni/Makefile.am b/liblttng-ust-java-agent/jni/Makefile.am index 789db168..711fd475 100644 --- a/liblttng-ust-java-agent/jni/Makefile.am +++ b/liblttng-ust-java-agent/jni/Makefile.am @@ -2,10 +2,10 @@ SUBDIRS = common -if BUILD_JAVA_AGENT_WITH_JUL +if ENABLE_JAVA_AGENT_WITH_JUL SUBDIRS += jul endif -if BUILD_JAVA_AGENT_WITH_LOG4J +if ENABLE_JAVA_AGENT_WITH_LOG4J SUBDIRS += log4j endif diff --git a/libringbuffer/Makefile.am b/libringbuffer/Makefile.am index 46c720a5..eb9ba512 100644 --- a/libringbuffer/Makefile.am +++ b/libringbuffer/Makefile.am @@ -17,7 +17,7 @@ libringbuffer_la_SOURCES = \ libringbuffer_la_LIBADD = \ -lrt -if HAVE_LIBNUMA +if ENABLE_NUMA libringbuffer_la_LIBADD += -lnuma endif diff --git a/tests/compile/Makefile.am b/tests/compile/Makefile.am index f3731121..404bb156 100644 --- a/tests/compile/Makefile.am +++ b/tests/compile/Makefile.am @@ -7,7 +7,7 @@ SUBDIRS = \ same_line_tracepoint \ test-app-ctx -if CXX_WORKS +if HAVE_CXX SUBDIRS += hello.cxx endif -- 2.34.1