[PATCH:xman 2/2] configure: check for groff and enable groff extensions if found

Gaetan Nadon memsize at videotron.ca
Sat Apr 20 11:28:56 PDT 2013


On 13-04-20 01:08 PM, Alan Coopersmith wrote:
> Check for groff never got translated from imake to autoconf
>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  configure.ac |    5 +++++
>  defs.h       |    4 ++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 74a6fc8..b9920bd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -37,6 +37,11 @@ AC_CONFIG_HEADERS([config.h])
>  
>  AC_CANONICAL_HOST
>  
> +AC_CHECK_PROG([GROFF], [groff], [found], [missing])
> +if test "x$GROFF" = "xfound" ; then
> +   AC_DEFINE([HAS_GROFF], 1, [Define to 1 if you have the groff package.])
> +fi
> +
>  AC_CHECK_FUNCS([mkstemp])
>  
>  AC_ARG_WITH(helpdir,
> diff --git a/defs.h b/defs.h
> index b4cd434..fe09b6b 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -34,6 +34,10 @@ from the X Consortium.
>   * Created:   October 22, 1987
>   */
>  
> +#ifdef HAVE_CONFIG_H
> +# include "config.h"
> +#endif
> +
>  #ifndef HELPFILE
>  #define HELPFILE "/usr/lib/X11/xman.help"  /* name of the default helpfile. */
>  #endif
Alternatively, you can use XORG_WITH_GROFF macro and benefit from all
the features. This was used in many docs before the move to DocBook. In
any case you probably want to use HAVE_xx to follow the convention used
by Automake elsewhere.


# XORG_WITH_GROFF([DEFAULT])
# ----------------
# Minimum version: 1.6.0
# Minimum version for optional DEFAULT argument: 1.11.0
#
# Documentation tools are not always available on all platforms and
sometimes
# not at the appropriate level. This macro enables a module to test for the
# presence of the tool and obtain it's path in separate variables.
Coupled with
# the --with-groff option, it allows maximum flexibilty in making decisions
# as whether or not to use the groff package. When DEFAULT is not specified,
# --with-groff assumes 'auto'.
#
# Interface to module:
# HAVE_GROFF:     used in makefiles to conditionally generate documentation
# HAVE_GROFF_MM: the memorandum macros (-mm) package
# HAVE_GROFF_MS: the -ms macros package
# GROFF:     returns the path of the groff program found
#         returns the path set by the user in the environment
# --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
# having the groff program and the later having devices, fonts and macros
# Checking for the groff executable is not enough.
#
# If macros are missing, we cannot assume that groff is useless, so we don't
# unset HAVE_GROFF or GROFF env variables.
# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
#



More information about the xorg-devel mailing list