Skip to content

Commit baf7041

Browse files
Explorer09BenBE
authored andcommitted
build: bring back configure warning when pkg.m4 is absent
Commit 24b1513 removed the warning when the configure script is generated without pkg.m4. I added that warning years ago (see 103f1a4) 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 <explorer09@gmail.com>
1 parent fd08314 commit baf7041

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,9 @@ cppcheck:
508508
cppcheck -q -v . --enable=all -DHAVE_OPENVZ
509509

510510
dist-hook: $(top_distdir)/configure
511-
@if grep 'pkg_m4_absent' '$(top_distdir)/configure'; then \
512-
echo 'ERROR: configure is generated without pkg.m4. Please supply pkg.m4 and run ./autogen.sh to rebuild the configure script.'>&2; \
511+
@if test "x$$FORCE_MAKE_DIST" = x && \
512+
grep 'pkg_m4_absent' '$(top_distdir)/configure' >/dev/null; then \
513+
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; \
513514
(exit 1); \
514515
else :; \
515516
fi

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,11 @@ dnl If the macro is not called, some pkg-config checks might be skipped
384384
dnl and $PKG_CONFIG might be unset.
385385
m4_ifdef([PKG_PROG_PKG_CONFIG], [
386386
PKG_PROG_PKG_CONFIG()
387+
], [
388+
pkg_m4_absent=1 # Makefile might grep this keyword. Don't remove.
389+
m4_warn(
390+
[syntax],
391+
[pkg.m4 is absent or older than version 0.16; this 'configure' would have incomplete pkg-config support])
387392
])
388393

389394
# HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART)

0 commit comments

Comments
 (0)