From 8840490dbf37134725f30e4cca00b09198ad5384 Mon Sep 17 00:00:00 2001 From: Maxim Storchak Date: Tue, 7 Jul 2026 19:09:55 +0300 Subject: [PATCH] Add a flag to disable building lsof.8 man page Some platforms (OpenWrt in particular) don't package the man page. In addition, some build environments might not have the packages required to build man pages. This commit adds --disable-manpages configure flag to skip building them. The default behavior is unchanged Signed-off-by: Maxim Storchak --- Makefile.am | 3 +++ configure.ac | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/Makefile.am b/Makefile.am index 9cd951cd..bc33b4de 100644 --- a/Makefile.am +++ b/Makefile.am @@ -221,11 +221,14 @@ EXTRA_DIST += 00.README.FIRST 00CREDITS 00DCACHE 00DIALECTS 00DIST 00FAQ 00LSOF- # Testing EXTRA_DIST += tests/00README tests/TestDB tests/CkTestDB tests/Makefile tests/LsofTest.h check.bash +if ENABLE_MANPAGES # Manpages lsof.man: Lsof.8 version 00DIALECTS soelim < Lsof.8 > $@ man8_MANS = lsof.man EXTRA_DIST += Lsof.8 +endif + # Fix distcheck error clean-local: rm -rf lsof.man diff --git a/configure.ac b/configure.ac index ef664c91..2bacdb7f 100644 --- a/configure.ac +++ b/configure.ac @@ -283,6 +283,11 @@ AS_IF([test "x$enable_no_sock_security" = xyes], [ ]) ]) +# --disable-manpages to stop building and installing lsof.8 +AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], + [do not build and install lsof.8]), [], [enable_manpages=yes]) +AM_CONDITIONAL([ENABLE_MANPAGES], [test "x$enable_manpages" = xyes]) + # Check rpc/rpc.h or libtirpc # with_libtirpc=yes/no/auto AC_ARG_WITH(libtirpc, AS_HELP_STRING([--with-libtirpc],