[Gtk-sharp-list] conditionally compile docs

Mike Kestner mkestner@ximian.com
Tue, 30 Mar 2004 12:45:34 -0600


On Wed, 2004-03-24 at 14:30, John Luke wrote:
> Hello,
> 	Attached is a patch to conditionally compile and install the docs if
> you already have monodoc installed.  Ok to commit?

Sorry about the delay.  Did you try distcheck on this?

I have some comments...  

Index: configure.in
===================================================================
RCS file: /cvs/public/gtk-sharp/configure.in,v
retrieving revision 1.50
diff -u -r1.50 configure.in
--- configure.in        22 Mar 2004 06:23:07 -0000      1.50
+++ configure.in        24 Mar 2004 19:57:35 -0000
@@ -150,6 +150,13 @@
 AC_SUBST(BASE_DEPENDENCIES_CFLAGS)
 AC_SUBST(BASE_DEPENDENCIES_LIBS)
 
+AC_PATH_PROG(MONODOC, monodoc, no)
+if test "x$MONODOC" = "xno" ; then
+enable_monodoc="no"
+else
+enable_monodoc="yes"
+fi

========
I don't think this is enough.  I think you need to test for the
--assemble and --update flags.  This could be challenging, but the best
approach is to install a .pc file for monodoc so that we can test it for
a version.  Then you just have to test for the version that has the
features you are using.  Also, you should AC_SUBST the MONODOC tool path
returned and use that in the Makefile.am.  It might also be nice to
report whether docs are building in the configuration summary.
========

Index: doc/Makefile.am
===================================================================
RCS file: doc/Makefile.am
diff -N doc/Makefile.am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ doc/Makefile.am     24 Mar 2004 19:57:35 -0000
@@ -0,0 +1,26 @@
+ASSEMBLER = monodoc --assemble
+UPDATER = monodoc --update

=========
So these become $(MONODOC) --assemble, etc...
=========

+DIRS = glib pango atk gdk gtk glade art gnome gda gnomedb gconf/GConf
gconf/GConf.PropertyEditors rsvg gtkhtml
+
+if ENABLE_MONODOC

=========
DOCDIR=`$(MONODOC) --get-sourcesdir`
TARGETS = gtk-sharp-docs.zip gtk-sharp-docs.tree gtk-sharp-docs.source
#else
DOCDIR=
TARGETS=
#endif

docdir=$(DOCDIR)
doc_DATA=$(TARGETS)
=========
+
+all: gtk-sharp-docs.zip gtk-sharp-docs.tree

=========
lose that
=========
+
+gtk-sharp-docs.zip gtk-sharp-docs.tree: en/*/*.xml en/*.xml
+       $(ASSEMBLER) --ecma en -o gtk-sharp-docs

=========
This needs to be VPATH buildable.  You probably need to do something
like the build_sources hack that I've done in the assembly directories.
=========

+
+update:
+       for i in $(DIRS); do                                    \
+               $(UPDATER) ../$$i/*.dll -o ./en -f || exit 1;   \
+        done
+
+install-data-local: gtk-sharp-docs.zip gtk-sharp-docs.tree 
+       install -m 644 gtk-sharp-docs.zip gtk-sharp-docs.tree `monodoc
--get-sourcesdir`
+       install -m 644 gtk-sharp-docs.source `monodoc --get-sourcesdir`

=======
lose that
=======
+
+endif
+
+CLEANFILES = gtk-sharp-docs.zip gtk-sharp-docs.tree
+
+EXTRA_DIST = gtk-sharp-docs.source

========
don't need any of these. however, you do need a disthook target that
dists the en/ files.  There is an example of this in monodoc already if
I remember correctly.

Thanks for the patch.  Let me know if I can clarify any further.  Please
make sure distcheck passes on the resubmitted patch.

-- 
Mike Kestner <mkestner@ximian.com>