[Pkg-shadow-devel] [PATCH] man pages: add helpful error message when --enable-man is needed
Mike Frysinger
vapier at gentoo.org
Thu Aug 27 10:29:44 UTC 2009
If the build system needs to generate man pages but --enable-man was not
specified, you get a useless error message like:
make[1]: *** No rule to make target `groups.1', needed by `all-am'. Stop.
So include all the targets like normal but if man pages cannot be generated,
emit a useful error message:
you need to run configure with --enable-man to generate man pages
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
man/generate_mans.mak | 9 +++++----
man/generate_translations.mak | 11 ++++++-----
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/man/generate_mans.mak b/man/generate_mans.mak
index ec3f6d7..2fd2e21 100644
--- a/man/generate_mans.mak
+++ b/man/generate_mans.mak
@@ -1,5 +1,3 @@
-if ENABLE_REGENERATE_MAN
-
if USE_PAM
PAM_COND=pam
else
@@ -18,13 +16,16 @@ SHA_CRYPT_COND=no_sha_crypt
endif
%: %.xml Makefile config.xml
+if ENABLE_REGENERATE_MAN
$(XSLTPROC) --stringparam profile.condition "$(PAM_COND);$(SHADOWGRP_COND);$(SHA_CRYPT_COND)" \
-nonet http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl $<
+else
+ @echo you need to run configure with --enable-man to generate man pages
+ @false
+endif
grpconv.8 grpunconv.8 pwunconv.8: pwconv.8
getspnam.3: shadow.3
vigr.8: vipw.8
-
-endif
diff --git a/man/generate_translations.mak b/man/generate_translations.mak
index b3b671e..95256f1 100644
--- a/man/generate_translations.mak
+++ b/man/generate_translations.mak
@@ -1,20 +1,21 @@
-if ENABLE_REGENERATE_MAN
-
LANG=$(notdir $(CURDIR))
%.xml: ../%.xml ../po/$(LANG).po
+if ENABLE_REGENERATE_MAN
[ ! -f ../config.xml ] || mv ../config.xml ../config.xml.bak
xml2po --expand-all-entities -l $(LANG) -p ../po/$(LANG).po -o $@ ../$@
sed -i 's:\(^<refentry .*\)>:\1 lang="$(LANG)">:' $@
[ ! -f ../config.xml.bak ] || mv ../config.xml.bak ../config.xml
sed -i 's/config SYSTEM "config.xml">/config SYSTEM "config.xml">\%config;/' $@
+else
+ @echo you need to run configure with --enable-man to generate man pages
+ @false
+endif
config.xml: ../config.xml.in
- make -C .. config.xml
+ $(MAKE) -C .. config.xml
cp ../config.xml $@
include ../generate_mans.mak
CLEANFILES = .xml2po.mo $(EXTRA_DIST) $(addsuffix .xml,$(EXTRA_DIST))
-
-endif
--
1.6.4
More information about the Pkg-shadow-devel
mailing list