[PATCH:macros] doc: add XORG_CHECK_SGML_DOCTOOLS to detect xorg-sgml-doctools

Gaetan Nadon memsize at videotron.ca
Thu Mar 25 18:00:17 PDT 2010


On Thu, 2010-03-25 at 18:12 -0500, Yaakov (Cygwin/X) wrote:

> From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
> 
> Trying to find X11/defs.ent with AC_CHECK_FILE does not work when
> cross-compiling, and the check assumed that xorg-sgml-doctools is
> installed to the same prefix which need not always be the case.
> 
> xorg-sgml-doctools 1.4 provides a pkg-config file which we can use
> instead, fixing both those cases.  This macro is provided in util-macros
> instead of with xorg-sgml-doctools, otherwise the latter would become a
> hard dependency just to run autoreconf.
> 
> Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
> ---
>  xorg-macros.m4.in |   54 ++++++++++++++++++++++++++++++++--------------------
>  1 files changed, 33 insertions(+), 21 deletions(-)
> 
> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> index 055c83e..916b472 100644
> --- a/xorg-macros.m4.in
> +++ b/xorg-macros.m4.in
> @@ -178,6 +178,31 @@ AC_SUBST([DRIVER_MAN_DIR])
>  AC_SUBST([ADMIN_MAN_DIR])
>  ]) # XORG_MANPAGE_SECTIONS
>  
> +# XORG_CHECK_SGML_DOCTOOLS
> +# ------------------------
> +# Minimum version: 1.7.0
> +#
> +# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
> +# provided by xorg-sgml-doctools, if installed.
> +AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
> +AC_MSG_CHECKING([for X.Org SGML entities])
> +XORG_SGML_PATH=
> +PKG_CHECK_EXISTS([xorg-sgml-doctools],
> +    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
> +    [if test x"$cross_compiling" != x"yes" ; then
> +        AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
> +                      [XORG_SGML_PATH=$prefix/share/sgml])
> +     fi])
> +
> +if test "x$XORG_SGML_PATH" != "x" ; then
> +   AC_MSG_RESULT([$XORG_SGML_PATH])
> +else
> +   AC_MSG_RESULT([no])
> +fi
> +
> +AC_SUBST(XORG_SGML_PATH)
> +]) # XORG_CHECK_SGML_DOCTOOLS
> +
>  # XORG_CHECK_LINUXDOC
>  # -------------------
>  # Minimum version: 1.0.0
> @@ -187,23 +212,14 @@ AC_SUBST([ADMIN_MAN_DIR])
>  # Whether or not the necessary tools and files are found can be checked
>  # with the AM_CONDITIONAL "BUILD_LINUXDOC"
>  AC_DEFUN([XORG_CHECK_LINUXDOC],[
> -if test x$XORG_SGML_PATH = x ; then
> -    XORG_SGML_PATH=$prefix/share/sgml
> -fi
> -HAVE_DEFS_ENT=
> -
> -if test x"$cross_compiling" = x"yes" ; then
> -  HAVE_DEFS_ENT=no
> -else
> -  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
> -fi
> +AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
>  
>  AC_PATH_PROG(LINUXDOC, linuxdoc)
>  AC_PATH_PROG(PS2PDF, ps2pdf)
>  
>  AC_MSG_CHECKING([whether to build documentation])
>  
> -if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
> +if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
>     BUILDDOC=yes
>  else
>     BUILDDOC=no
> @@ -245,24 +261,20 @@ AC_SUBST(MAKE_HTML)
>  # indicates whether the necessary tools and files are found and, if set,
>  # $(MAKE_XXX) blah.sgml will produce blah.xxx.
>  AC_DEFUN([XORG_CHECK_DOCBOOK],[
> -if test x$XORG_SGML_PATH = x ; then
> -    XORG_SGML_PATH=$prefix/share/sgml
> -fi
> -HAVE_DEFS_ENT=
> +AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
> +
>  BUILDTXTDOC=no
>  BUILDPDFDOC=no
>  BUILDPSDOC=no
>  BUILDHTMLDOC=no
>  
> -AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
> -
>  AC_PATH_PROG(DOCBOOKPS, docbook2ps)
>  AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
>  AC_PATH_PROG(DOCBOOKHTML, docbook2html)
>  AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
>  
>  AC_MSG_CHECKING([whether to build text documentation])
> -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
> +if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
>     test x$BUILD_TXTDOC != xno; then
>  	BUILDTXTDOC=yes
>  fi
> @@ -270,7 +282,7 @@ AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
>  AC_MSG_RESULT([$BUILDTXTDOC])
>  
>  AC_MSG_CHECKING([whether to build PDF documentation])
> -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
> +if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
>     test x$BUILD_PDFDOC != xno; then
>  	BUILDPDFDOC=yes
>  fi
> @@ -278,7 +290,7 @@ AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
>  AC_MSG_RESULT([$BUILDPDFDOC])
>  
>  AC_MSG_CHECKING([whether to build PostScript documentation])
> -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
> +if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
>     test x$BUILD_PSDOC != xno; then
>  	BUILDPSDOC=yes
>  fi
> @@ -286,7 +298,7 @@ AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
>  AC_MSG_RESULT([$BUILDPSDOC])
>  
>  AC_MSG_CHECKING([whether to build HTML documentation])
> -if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
> +if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
>     test x$BUILD_HTMLDOC != xno; then
>  	BUILDHTMLDOC=yes
>  fi

All set to go.

Reviewed by: Gaetan Nadon <memsize at videotron.ca>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100325/75597ab0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100325/75597ab0/attachment-0001.pgp>


More information about the xorg-devel mailing list