From f2c27ce38e41e21f51630c318f4df7edb4571748 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Wed, 21 Aug 2024 06:18:18 +0800 Subject: [PATCH] build: bring back configure warning when pkg.m4 is absent Commit 24b1513296fd61722166625ad46be1c56a5efc44 removed the warning when the configure script is generated without pkg.m4. I added that warning years ago (see 103f1a497a9ebbcab021c1a8d21276802d1922c6) to prevent downstream distributions from creating a tarball with an "incomplete" configure script. Add the warning back, reword the messages to tell exactly what feature would be missing (to builders), and also add FORCE_MAKE_DIST variable for builders who want to ignore the warning. :) Signed-off-by: Kang-Che Sung --- Makefile.am | 5 +++-- configure.ac | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index e1e866b0a..386506c92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -508,8 +508,9 @@ cppcheck: cppcheck -q -v . --enable=all -DHAVE_OPENVZ dist-hook: $(top_distdir)/configure - @if grep 'pkg_m4_absent' '$(top_distdir)/configure'; then \ - echo 'ERROR: configure is generated without pkg.m4. Please supply pkg.m4 and run ./autogen.sh to rebuild the configure script.'>&2; \ + @if test "x$$FORCE_MAKE_DIST" = x && \ + grep 'pkg_m4_absent' '$(top_distdir)/configure' >/dev/null; then \ + echo 'ERROR: This distribution would have incomplete pkg-config support. Rebuilding the configure script is advised. Set FORCE_MAKE_DIST=1 to ignore this warning.'>&2; \ (exit 1); \ else :; \ fi diff --git a/configure.ac b/configure.ac index a58bf6702..1757f59fb 100644 --- a/configure.ac +++ b/configure.ac @@ -384,6 +384,10 @@ dnl If the macro is not called, some pkg-config checks might be skipped dnl and $PKG_CONFIG might be unset. m4_ifdef([PKG_PROG_PKG_CONFIG], [ PKG_PROG_PKG_CONFIG +], [ +pkg_m4_absent=1 +m4_warn([syntax], + [pkg.m4 is absent or older than version 0.16; this 'configure' would have incomplete pkg-config support]) ]) # HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART)