On Jan 5, 2004, at 7:25 PM, Dave Thomas wrote:

> That'd be cool, but I'm clueless about autoconf. If folks feel this is 
> a good idea, someone else'll have to make the patch...
>

Here's a quick attempt at providing autoconf support for building rdoc 
documentation...

Here rdoc is disabled by default, you need to --enable-install-doc to 
get it turned on.  Maybe once the kinks are out of the system, folks 
can discuss making it enabled by default.

I wasn't sure whether to use 'doc' or 'rdoc'.

Does this seem like it's on the right track?

-J



Index: Makefile.in
===================================================================
RCS file: /src/ruby/Makefile.in,v
retrieving revision 1.55.2.1
diff -u -r1.55.2.1 Makefile.in
--- Makefile.in	5 Jan 2004 21:46:49 -0000	1.55.2.1
+++ Makefile.in	6 Jan 2004 19:09:00 -0000
@@ -139,7 +139,7 @@
  		@@NM@ -Pgp $(LIBRUBY_A) | awk 'BEGIN{print "#!"}; 
$$2~/^[BD]$$/{print $$1}' | sort -u -o $@
  # $(MINIRUBY) $< $@

-install:	install-nodoc rdoc
+install:	install-nodoc @RDOCTARGET@

  install-nodoc:	rbconfig.rb
  		$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) 
--mantype="$(MANTYPE)"
@@ -149,9 +149,9 @@
  		$(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS) 
--mantype="$(MANTYPE)"
  		$(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(SCRIPT_ARGS) install

-rdoc:
+install-doc:
  		@echo Generating RDoc documentation
-		$(MINIRUBY) -I lib bin/rdoc --all --ri-system
+		$(MINIRUBY) -I lib bin/rdoc --all --ri-system $(srcdir)

  clean-ext:
  		@-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) clean 2> 
/dev/null || true
@@ -204,7 +204,7 @@

  .PRECIOUS:	@MAKEFILES@

-.PHONY:		test install install-nodoc rdoc
+.PHONY:		test

  PHONY:

Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.212.2.4
diff -u -r1.212.2.4 configure.in
--- configure.in	6 Jan 2004 14:00:44 -0000	1.212.2.4
+++ configure.in	6 Jan 2004 19:09:01 -0000
@@ -1223,6 +1223,16 @@
  XLDFLAGS="$XLDFLAGS -L."
  AC_SUBST(ARCHFILE)

+dnl build rdoc index if requested
+RDOCTARGET="PHONY"
+AC_ARG_ENABLE(install-doc,
+       [  --enable-install-doc    build and install rdoc indexes 
during install ],
+       [install_doc=$enableval], [install_doc=no])
+if test "$install_doc" != no; then
+   RDOCTARGET="install-doc"
+fi
+AC_SUBST(RDOCTARGET)
+
  case "$target_os" in
      netbsd*)
      	CFLAGS="$CFLAGS -pipe"