help help2man to find iwhd

Pete Zaitcev zaitcev at redhat.com
Wed Aug 3 17:42:53 UTC 2011


I have a problem that I'm failing to solve.

If "make distcheck" is ran on a freshly-cloned iwhd repo, just after the
configuring it, the following happens:

make[1]: Entering directory `/q/zaitcev/hail/iwhd-h2mcheck/man'
  GEN    iwhd.8
help2man: can't get `--help' info from iwhd
Try `--no-discard-stderr' if option outputs to stderr
make[1]: *** [iwhd.8] Error 1

It works fine on a tree that was built once. Still, usually, in other
projects, there's nothing wrong with going directly to "distcheck".
So, I quickly did this:

diff --git a/man/Makefile.am b/man/Makefile.am
index 7cb842c..4023c49 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -23,5 +23,5 @@ iwhd.8: $(top_srcdir)/configure.ac $(top_srcdir)/rest.c
 	$(AM_V_GEN) \
 	  (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $(top_srcdir)/rest.c)|\
 	  PATH=..$(PATH_SEPARATOR)$$PATH \
-	    $(HELP2MAN) --no-info -i - -S '$(PACKAGE) $(VERSION)' iwhd \
+	    $(HELP2MAN) --no-info -i - -S '$(PACKAGE) $(VERSION)' $(top_builddir)/iwhd \
 	      > $@-t && mv $@-t $@

Woops this is not enough, obviously, because not only help2man recipy
points to wrong place, it also runs before iwhd was built. I tried to
approach it like this:

diff --git a/man/Makefile.am b/man/Makefile.am
index 7cb842c..3afb44d 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -18,10 +18,15 @@
 dist_man8_MANS = iwhd.8
 MAINTAINERCLEANFILES = $(dist_man8_MANS)
 
+all: iwhd.8
+
+# Explicit distdir to prevent us from accessing iwhd that's not built yet.
+distdir: $(top_srcdir)/configure.ac
+	$(AM_V_GEN)
+
 # Depend on configure.ac to get version number changes.
 iwhd.8: $(top_srcdir)/configure.ac $(top_srcdir)/rest.c
-	$(AM_V_GEN) \
-	  (echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $(top_srcdir)/rest.c)|\
+	(echo '[NAME]' && sed 's@/\* *@@; s/-/\\-/; q' $(top_srcdir)/rest.c)|\
 	  PATH=..$(PATH_SEPARATOR)$$PATH \
-	    $(HELP2MAN) --no-info -i - -S '$(PACKAGE) $(VERSION)' iwhd \
+	    $(HELP2MAN) --no-info -i - -S '$(PACKAGE) $(VERSION)' $(top_builddir)/iwhd \
 	      > $@-t && mv $@-t $@

But the above causes this to happen:

$ sh autogen.sh
$ ./configure
$ make distcheck
............
checking where the gettext function comes from... libc
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gnulib-tests/Makefile
config.status: creating lib/Makefile
config.status: error: cannot find input file: `man/Makefile.in'

So, what to do?

-- Pete


More information about the iwhd-devel mailing list