Skip to content

Commit

Permalink
build: bring back configure warning when pkg.m4 is absent
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Explorer09 committed Aug 20, 2024
1 parent 14987ca commit 9bde638
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9bde638

Please sign in to comment.