[PATCH:macros] doc: add XORG_CHECK_SGML_DOCTOOLS to detect xorg-sgml-doctools
Gaetan Nadon
memsize at videotron.ca
Thu Mar 25 15:49:47 PDT 2010
On Thu, 2010-03-25 at 18:08 -0400, Gaetan Nadon wrote:
> On Thu, 2010-03-25 at 03:48 -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>
> > ---
> > This depends on the patch for xorg-sgml-doctools to provide a pkg-config
> > file.
> >
> > xorg-macros.m4.in | 45 ++++++++++++++++++++++++---------------------
> > 1 files changed, 24 insertions(+), 21 deletions(-)
> >
> > diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> > index 055c83e..beb5fd5 100644
> > --- a/xorg-macros.m4.in
> > +++ b/xorg-macros.m4.in
> > @@ -178,6 +178,22 @@ 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])
> > +PKG_CHECK_EXISTS([xorg-sgml-doctools],
> > + [XORG_SGML_PATH="`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`"
> > + have_sgml_ent=yes],
> > + [have_sgml_ent=no])
> > +AC_MSG_RESULT([$have_sgml_ent])
> > +AC_SUBST(XORG_SGML_PATH)
> > +])
> > +
> > # XORG_CHECK_LINUXDOC
> > # -------------------
> > # Minimum version: 1.0.0
> > @@ -187,23 +203,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 +252,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 +273,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 +281,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 +289,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
>
>
> That's the right thing to do. I tested the patches and found a
> scenario that fails.
> When a doctools v1.3 is present, the linuxdoc in hw/dmx/doc do not
> build. There is
> a requirement that an older "client" of util-macros behaves the same
> way when
> linked with a newer version.
>
> This should be relatively easy to fix. In util-macros v1.7, the code
> should revert to the v1.6
> flawed behaviour when the doctools pc file is not found. It should not
> assume that the package
> is missing and that the sgml definitions are missing as well.
>
> Note this patch introduces a build order dependency where doctools be
> built before xserver.
> Nothing wrong with that, just need to check the build script.
>
> Once that's fixed, the release plan should be:
>
> util-macros v1.7 released first.
> doctools v1.4 with XORG_MACROS_VERSION(1.4) released second.
I meant doctools v1.4 with XORG_MACROS_VERSION(1.7) released second.
>
> This is how I tested the scenario:
> - In macros: apply patch; make install
> - In doctools: make uninstall; get v1.3; autogen; make install
> - In xserver: autogen;
> - In xserver/hw/dmx/doc: check Makefile and notice targets like
> #.sgml.txt: are commented out.
>
> To recover:
> - In doctools: apply patch; autogen; make install
> - In xserver: autogen;
> - In xserver/hw/dmx/doc: check Makefile and notice targets like
> .sgml.txt: are not commented out.
>
>
>
>
>
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100325/2638ee89/attachment.html>
-------------- 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/2638ee89/attachment-0001.pgp>
More information about the xorg-devel
mailing list