From b93e282a8c2e86ebdf2bc05fce91f001c53bd88d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 23 Nov 2007 23:31:13 +0000 Subject: [PATCH] MERGED: If we have hscolour then make source code links in teh haddock docs Fri Nov 23 13:15:59 PST 2007 Ian Lynagh --- configure.ac | 2 ++ libraries/Makefile | 12 +++++++++++- mk/config.mk.in | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2eac29d..17b92ee 100644 --- a/configure.ac +++ b/configure.ac @@ -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) +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]) diff --git a/libraries/Makefile b/libraries/Makefile index 7cf8238..190e9ce 100644 --- a/libraries/Makefile +++ b/libraries/Makefile @@ -133,6 +133,10 @@ CONFIGURE_OPTS += --enable-split-objs 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)) @@ -283,11 +287,17 @@ html: doc 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 \ - cd $* && setup/Setup haddock --html-location='../$$pkgid'; \ + cd $* && setup/Setup haddock --html-location='../$$pkgid' \ + $(CABAL_HADDOCK_FLAGS); \ fi .PHONY: distclean clean clean.library.% diff --git a/mk/config.mk.in b/mk/config.mk.in index 104694e..706bf7c 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -1041,6 +1041,8 @@ STRIP = strip TAR = @TarCmd@ ZIP = zip +HSCOLOUR = @HSCOLOUR@ + # # This is special to literate/, ToDo: add literate-specific # configure setup to literate/. -- 1.7.10.4