[PATCH v2 4/4] perf build: Emit a warning when libtraceevent is explicitely disabled

Arnaldo Carvalho de Melo posted 4 patches 2 weeks, 4 days ago
[PATCH v2 4/4] perf build: Emit a warning when libtraceevent is explicitely disabled
Posted by Arnaldo Carvalho de Melo 2 weeks, 4 days ago
From: Arnaldo Carvalho de Melo <acme@redhat.com>

Since not having the libtraceevent devel package installed prevents the
build from proceeding unless NO_LIBTRACEEVENT=1 is passed:

  $ make O=/tmp/build/perf-tools-next/ -C tools/perf install-bin
  Makefile.config:1195: *** ERROR: libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel and/or set LIBTRACEEVENT_DIR or build with NO_LIBTRACEEVENT=1.  Stop.
  make[1]: *** [Makefile.perf:292: sub-make] Error 2
  make: *** [Makefile:119: install-bin] Error 2
  make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
  $

Behave just like with the NO_LIBPYTHON case:

  $ make NO_LIBPYTHON=1 NO_LIBTRACEEVENT=1 O=/tmp/build/perf-tools-next/ -C tools/perf install-bin
  Makefile.config:874: Python support disabled by user
  Makefile.config:1180: libtraceevent support disabled by user

  Auto-detecting system features:
<SNIP>

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Veronika Molnarova <vmolnaro@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.config | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 80bf06e828f0ebc8..3ae3449ccf684b42 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -1180,7 +1180,9 @@ ifndef NO_LIBPFM4
 endif
 
 # libtraceevent is a recommended dependency picked up from the system.
-ifneq ($(NO_LIBTRACEEVENT),1)
+ifeq ($(NO_LIBTRACEEVENT),1)
+  msg := $(warning libtraceevent support disabled by user);
+else
   $(call feature_check,libtraceevent)
   ifeq ($(feature-libtraceevent), 1)
     CFLAGS += -DHAVE_LIBTRACEEVENT $(shell $(PKG_CONFIG) --cflags libtraceevent)
-- 
2.47.0