[PATCH v2 util-macros] XORG_WITH_GROFF: add HAVE_GROFF_HTML Automake conditional

Gaetan Nadon memsize at videotron.ca
Sun Jun 20 17:31:04 PDT 2010

Groff uses grohtml to generate html output format. This program, in turn,
uses a number of pnm* commands from the netpbm package, psselect
from the psutils package and the ghostscript package.

These are independently installed, so they could be missing.
A check is made to ensure those dependencies are installed.
If not, the makefile can use the conditional to supress the target.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
 xorg-macros.m4.in |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index a8e12ed..443ceaf 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -552,6 +552,12 @@ AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
 # --with-groff:	 'yes' user instructs the module to use groff
 #		 'no' user instructs the module not to use groff
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+#		   psselect from the psutils package.
+#		   the ghostcript package. Refer to the grohtml man pages
 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
 # OS and distros often splits groff in a basic and full package, the former
@@ -591,6 +597,7 @@ elif test "x$use_groff" = x"no" ; then
    AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
 # We have groff, test for the presence of the macro packages
 if test "x$have_groff" = x"yes"; then
     AC_MSG_CHECKING([for ${GROFF} -ms macros])
@@ -608,9 +615,25 @@ if test "x$have_groff" = x"yes"; then
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+      have_groff_html=yes
+   else
+      have_groff_html=no
+      AC_MSG_WARN([grohtml dependencies not found - Documentation skipped. Refer to grohtml man pages])
+   fi
+# Set Automake conditionals for Makefiles
 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])

Added a message to help user.

Having no luck with a small test case, I kept the check for commands.
Dependencies may change in the future.

More information about the xorg-devel mailing list