From 93d623fdf9bee70bfae50168ac163825361f38e0 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Fri, 23 Feb 2024 18:09:05 -0300 Subject: build: allow overriding certain tools Allow overriding the following tools at configure-time and build-time: * codespell * cppcheck * gawk * scan-build For example, instead of hardcoding `gawk`, enable overriding it at configure-time with: ./configure GAWK=/path/to/gawk To override it for a single `make` invocation: make GAWK=/path/to/gawk Also, add default values for the programs that are not found (rather than leaving the variables empty), to make error messages clearer when trying to run them: $ make CPPCHECK= cppcheck-old [...] force --error-exitcode=1 --enable=warning,performance . make: force: No such file or directory $ make CPPCHECK=cppcheck cppcheck-old [...] cppcheck --force --error-exitcode=1 --enable=warning,performance . make: cppcheck: No such file or directory --- configure.ac | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7a2c379fe..2762c2ef0 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,10 @@ AC_CONFIG_SRCDIR([src/firejail/main.c]) AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC +AC_CHECK_PROGS([CODESPELL], [codespell]) +AC_CHECK_PROGS([CPPCHECK], [cppcheck]) +AC_CHECK_PROGS([GAWK], [gawk]) +AC_CHECK_PROGS([SCAN_BUILD], [scan-build]) DEPS_CFLAGS="" AC_SUBST([DEPS_CFLAGS]) @@ -139,8 +143,7 @@ AC_ARG_ENABLE([man], [AS_HELP_STRING([--disable-man], [disable man pages])]) AS_IF([test "x$enable_man" != "xno"], [ HAVE_MAN="-DHAVE_MAN" - AC_CHECK_PROG([HAVE_GAWK], [gawk], [yes], [no]) - AS_IF([test "x$HAVE_GAWK" != "xyes"], [AC_MSG_ERROR([*** gawk not found ***])]) + AS_IF([test "x$GAWK" = "x"], [AC_MSG_ERROR([*** gawk not found ***])]) ]) HAVE_PRIVATE_HOME="" -- cgit v1.2.3-70-g09d2