MERGED: If we have hscolour then make source code links in teh haddock docs
authorIan Lynagh <igloo@earth.li>
Fri, 23 Nov 2007 23:31:13 +0000 (23:31 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 23 Nov 2007 23:31:13 +0000 (23:31 +0000)
Fri Nov 23 13:15:59 PST 2007  Ian Lynagh <igloo@earth.li>

configure.ac
libraries/Makefile
mk/config.mk.in

index 2eac29d..17b92ee 100644 (file)
@@ -927,6 +927,8 @@ dnl ** check for tar
 dnl   if GNU tar is named gtar, look for it first.
 AC_PATH_PROGS(TarCmd,gtar tar,tar)
 
 dnl   if GNU tar is named gtar, look for it first.
 AC_PATH_PROGS(TarCmd,gtar tar,tar)
 
+AC_PATH_PROG(HSCOLOUR,HsColour)
+
 dnl ** check for DocBook toolchain
 FP_CHECK_DOCBOOK_DTD
 FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/xml/docbook/stylesheet/nwalsh /usr/share/xml/docbook/xsl-stylesheets* /usr/share/sgml/docbook/docbook-xsl-stylesheets* /usr/share/sgml/docbook/xsl-stylesheets* /opt/kde?/share/apps/ksgmltools2/docbook/xsl /usr/share/docbook-xsl /usr/share/sgml/docbkxsl /usr/local/share/xsl/docbook /sw/share/xml/xsl/docbook-xsl /opt/local/share/xsl/docbook-xsl])
 dnl ** check for DocBook toolchain
 FP_CHECK_DOCBOOK_DTD
 FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/xml/docbook/stylesheet/nwalsh /usr/share/xml/docbook/xsl-stylesheets* /usr/share/sgml/docbook/docbook-xsl-stylesheets* /usr/share/sgml/docbook/xsl-stylesheets* /opt/kde?/share/apps/ksgmltools2/docbook/xsl /usr/share/docbook-xsl /usr/share/sgml/docbkxsl /usr/local/share/xsl/docbook /sw/share/xml/xsl/docbook-xsl /opt/local/share/xsl/docbook-xsl])
index 7cf8238..190e9ce 100644 (file)
@@ -133,6 +133,10 @@ CONFIGURE_OPTS += --enable-split-objs
 CONFIGURE_STAMP_EXTRAS := $(CONFIGURE_STAMP_EXTRAS)-splitting
 endif
 
 CONFIGURE_STAMP_EXTRAS := $(CONFIGURE_STAMP_EXTRAS)-splitting
 endif
 
+ifneq "$(HSCOLOUR)" ""
+CONFIGURE_OPTS += --with-hscolour=$(HSCOLOUR)
+endif
+
 BOOTSTRAP_LIBS = Cabal filepath
 BOOTSTRAP_STAMPS = $(addprefix stamp/bootstrapping.,$(BOOTSTRAP_LIBS))
 BOOTSTRAP_INC_1_UP = -DCABAL_VERSION=1,3 $(addprefix -i../bootstrapping.,$(BOOTSTRAP_LIBS))
 BOOTSTRAP_LIBS = Cabal filepath
 BOOTSTRAP_STAMPS = $(addprefix stamp/bootstrapping.,$(BOOTSTRAP_LIBS))
 BOOTSTRAP_INC_1_UP = -DCABAL_VERSION=1,3 $(addprefix -i../bootstrapping.,$(BOOTSTRAP_LIBS))
@@ -283,11 +287,17 @@ html: doc
 doc: $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR))
        sh gen_contents_index --inplace
 
 doc: $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR))
        sh gen_contents_index --inplace
 
+# Making hyperlinked source only works if we have hscolour
+ifneq "$(HSCOLOUR)" ""
+CABAL_HADDOCK_FLAGS=--hyperlink-source
+endif
+
 $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR)):\
 doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
                %/setup/Setup ifBuildable/ifBuildable
        if ifBuildable/ifBuildable $*; then \
 $(foreach SUBDIR,$(SUBDIRS),doc.library.$(SUBDIR)):\
 doc.library.%: stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).% \
                %/setup/Setup ifBuildable/ifBuildable
        if ifBuildable/ifBuildable $*; then \
-         cd $* && setup/Setup haddock --html-location='../$$pkgid'; \
+         cd $* && setup/Setup haddock --html-location='../$$pkgid' \
+                                      $(CABAL_HADDOCK_FLAGS); \
        fi
 
 .PHONY: distclean clean clean.library.%
        fi
 
 .PHONY: distclean clean clean.library.%
index 104694e..706bf7c 100644 (file)
@@ -1041,6 +1041,8 @@ STRIP                     = strip
 TAR                    = @TarCmd@
 ZIP                    = zip
 
 TAR                    = @TarCmd@
 ZIP                    = zip
 
+HSCOLOUR = @HSCOLOUR@
+
 #
 # This is special to literate/, ToDo: add literate-specific
 # configure setup to literate/.
 #
 # This is special to literate/, ToDo: add literate-specific
 # configure setup to literate/.