docs: Add Makefile rule to check syntax of manpages.
authorBen Pfaff <blp@nicira.com>
Wed, 24 Aug 2011 17:45:32 +0000 (10:45 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Aug 2011 19:42:52 +0000 (12:42 -0700)
This should catch future nroff syntax errors immediately, instead of much
later.

Makefile.am
configure.ac
lib/automake.mk
m4/openvswitch.m4
ofproto/automake.mk
ovsdb/automake.mk
utilities/automake.mk

index 91218e14ace0b7cc97babb88452159d65c56d66a..2090501cf4e7398cbea00f1a80ca3d4442e14437 100644 (file)
@@ -45,7 +45,8 @@ EXTRA_DIST = \
        REPORTING-BUGS \
        SubmittingPatches \
        WHY-OVS \
-       boot.sh
+       boot.sh \
+       $(MAN_FRAGMENTS)
 bin_PROGRAMS =
 sbin_PROGRAMS =
 bin_SCRIPTS =
@@ -57,6 +58,7 @@ dist_sbin_SCRIPTS =
 dist_scripts_SCRIPTS =
 INSTALL_DATA_LOCAL =
 man_MANS =
+MAN_FRAGMENTS =
 noinst_DATA =
 noinst_HEADERS =
 noinst_LIBRARIES =
@@ -148,6 +150,17 @@ rate-limit-check:
            exit 1; \
         fi
 
+if HAVE_GROFF
+ALL_LOCAL += manpage-check
+manpage-check: $(MANS) $(MAN_FRAGMENTS)
+       @manpages=; \
+       for d in $(MANS); do \
+               manpages="$$manpages `test -f $$d || echo $(VPATH)/`$$d"; \
+       done; \
+       LANG=en_US.UTF-8 groff -w mac -w delim -w escape -w input -w missing -w tab -T utf8 -man -p -z $$manpages && touch $@
+CLEANFILES += manpage-check
+endif
+
 dist-hook: $(DIST_HOOKS)
 all-local: $(ALL_LOCAL)
 clean-local: $(CLEAN_LOCAL)
index 492c7bcfe076e5bdb535efe9924b6163c7976563..e03946aa378a5424f53dacaf3c7881d5ba5d874d 100644 (file)
@@ -67,6 +67,7 @@ OVS_CHECK_VALGRIND
 OVS_CHECK_SOCKET_LIBS
 OVS_CHECK_LINKER_SECTIONS
 OVS_CHECK_XENSERVER_VERSION
+OVS_CHECK_GROFF
 
 OVS_ENABLE_OPTION([-Wall])
 OVS_ENABLE_OPTION([-Wno-sign-compare])
index d55465bb60d0e51d5c6a7a3d7328ff5ff1f7a518..2f5b5fdfd4fc24ab1f31ef7c17b31a1b2113a866 100644 (file)
@@ -236,7 +236,7 @@ EXTRA_DIST += \
        lib/dh4096.pem \
        lib/dirs.c.in
 
-EXTRA_DIST += \
+MAN_FRAGMENTS += \
        lib/common.man \
        lib/common-syn.man \
        lib/daemon.man \
index e9edc4902311f69b2dbee048339622d38deae78c..7aaf67a209402b38aecc65c90a747dbd433399a0 100644 (file)
@@ -361,3 +361,15 @@ AC_DEFUN([OVS_CHECK_LINKER_SECTIONS],
    fi
    AM_CONDITIONAL(
      [USE_LINKER_SECTIONS], [test $ovs_cv_use_linker_sections = yes])])
+
+dnl Checks for groff.
+AC_DEFUN([OVS_CHECK_GROFF],
+  [AC_CACHE_CHECK(
+    [for groff],
+    [ovs_cv_groff],
+    [if (groff -v) >/dev/null 2>&1; then
+       ovs_cv_groff=yes
+     else
+       ovs_cv_groff=no
+     fi])
+   AM_CONDITIONAL([HAVE_GROFF], [test "$ovs_cv_groff" = yes])])
index df83aef09fc4572159e174ebd09dadf872412b31..ae35b7ffee37b991c476fdfc1b739599957cf3ce 100644 (file)
@@ -29,4 +29,4 @@ ofproto_libofproto_a_SOURCES = \
        ofproto/pinsched.c \
        ofproto/pinsched.h
 
-EXTRA_DIST += ofproto/ofproto-unixctl.man
+MAN_FRAGMENTS += ofproto/ofproto-unixctl.man
index 5c9a8fbaf3bdd3067b2ae3eaee3667ec122c6f23..39bc65fcf0b5d80d50a455aa95f6cd1b673e642d 100644 (file)
@@ -29,7 +29,7 @@ ovsdb_libovsdb_a_SOURCES = \
        ovsdb/trigger.h \
        ovsdb/transaction.c \
        ovsdb/transaction.h
-EXTRA_DIST += \
+MAN_FRAGMENTS += \
        ovsdb/remote-active.man \
        ovsdb/remote-passive.man
 
index dc731bfb77db28d5106a4182b336aaa9319161cc..2cfdf8e33673fbdf4c9a19da2116aa9cd406a33b 100644 (file)
@@ -32,11 +32,11 @@ EXTRA_DIST += \
        utilities/ovs-save \
        utilities/ovs-tcpundump.1.in \
        utilities/ovs-tcpundump.in \
-       utilities/ovs-vlan-bugs.man \
        utilities/ovs-vlan-test.in \
        utilities/ovs-vlan-bug-workaround.8.in \
        utilities/ovs-vlan-test.8.in \
        utilities/ovs-vsctl.8.in
+MAN_FRAGMENTS += utilities/ovs-vlan-bugs.man
 DISTCLEANFILES += \
        utilities/ovs-appctl.8 \
        utilities/ovs-ctl \