Even when building with the NOMAN option, "which" will not build without
the manpage whereis.1 being present.
This patch checks to see whether NOMAN is defined, and if not, does not
do the tests related to path expansion.
Index: usr.bin/which/Makefile
===================================================================
RCS file: /cvs/src/usr.bin/which/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- usr.bin/which/Makefile 15 Apr 2013 16:34:19 -0000 1.8
+++ usr.bin/which/Makefile 4 Jan 2015 10:27:22 -0000
@@ -1,10 +1,12 @@
# $OpenBSD: Makefile,v 1.8 2013/04/15 16:34:19 guenther Exp $
+.include <bsd.own.mk>
PROG= which
MAN= which.1 whereis.1
LINKS= ${BINDIR}/which ${BINDIR}/whereis
check_path_in_man:
+.if !defined(NOMAN)
@echo "Checking path expansion in whereis.1"; \
stdpath=`printf '#include <paths.h>\n_PATH_STDPATH\n' | \
${CPP} ${CPPFLAGS} - | \
@@ -12,6 +14,7 @@ check_path_in_man:
fgrep -xq "$$stdpath" ${.CURDIR}/whereis.1 && { touch $@; exit
0; }; \
echo "Update the expansion of _PATH_STDPATH in
${.CURDIR}/whereis.1"; \
exit 1
+.endif
all: check_path_in_man
CLEANFILES = check_path_in_man