From: Duncan C. <dun...@us...> - 2005-01-13 23:01:28
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26319 Modified Files: ChangeLog configure.ac Makefile.am Log Message: Do detection of haddock and add --enable-docs to configure. First hash at building haddock docs (gtk package only so far). Also move some defines from Makefile.am to configure.ac as requested by a FIXME comment. Index: configure.ac =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/configure.ac,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- configure.ac 8 Jan 2005 17:52:36 -0000 1.15 +++ configure.ac 13 Jan 2005 23:01:16 -0000 1.16 @@ -510,8 +510,33 @@ esac; fi +dnl The hsc2hs preprocessor +AC_PATH_PROG(HSC2HS,hsc2hs) +if test "$HSC2HS" = "no"; then + AC_MSG_ERROR([Could not find hsc2hs. This should be isntalled with GHC!]) +fi + +dnl The preprocessor to use on Haskell sources +HSCPP='$(CPP) -x c -traditional-cpp -P' + dnl Documentation -AC_PATH_PROG(HADDOCK,haddock) +AC_ARG_ENABLE(docs, + [ --enable-docs build html documentation], + [BUILDDOCS=$enableval],[BUILDDOCS=no]) +if test "$BUILDDOCS" = "yes"; then + AC_PATH_PROG(HADDOCK,haddock, no) + if test "$HADDOCK" = "no"; then + AC_MSG_ERROR([Could not find haddock which is required to build the documentation. + Install haddock or re-run configure without --enable-docs]) + fi + AC_MSG_CHECKING([version of haddock]) + HADDOCK_VERSION=`$HADDOCK --version | $CUT -d' ' -f3 | $CUT -d, -f1` + AC_MSG_RESULT([$HADDOCK_VERSION]) + GTKHS_PROG_CHECK_VERSION($HADDOCK_VERSION, -lt, 0.6, [ + AC_MSG_ERROR([I need haddock 0.6 or later to build the documentation. + Upgrade your version of haddock or re-run configure without --enable-docs])]) +fi +AM_CONDITIONAL(BUILDDOCS, test "$BUILDDOCS" = "yes") AC_ARG_WITH(ghc-docdir, [ --with-ghc-docdir=GHC_DOCDIR location of top of ghc haddockified html documentation], @@ -527,6 +552,8 @@ AC_SUBST(PKGCONF) AC_SUBST(HCFLAGS) AC_SUBST(C2HS) +AC_SUBST(HSC2HS) +AC_SUBST(HSCPP) AC_SUBST(MARSHALLDEFS) AC_SUBST(VERSION) dnl Platform specific flags @@ -585,11 +612,11 @@ echo "**************************************************" echo "* Configuration completed successfully. *" echo "* *" -if test -z "$HADDOCK"; then - echo "* Warning: The documentation will not be built: *" - echo "* - haddock was not found *" - echo "* *" -fi +dnl if test x$BUILDDOCS = xyes && test -z "$HADDOCK"; then +dnl echo "* Warning: The documentation will not be built: *" +dnl echo "* - haddock was not found *" +dnl echo "* *" +dnl fi dnl if test $BUILDDOCS = no; then dnl echo "* Warning: The documentation will not be built: *" dnl if test $FOUNDTRANSLATOR = no; then Index: Makefile.am =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile.am,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- Makefile.am 12 Jan 2005 18:19:52 -0000 1.32 +++ Makefile.am 13 Jan 2005 23:01:16 -0000 1.33 @@ -19,13 +19,8 @@ tools/hierarchyGen/hierarchy.list \ tools/hierarchyGen/Hierarchy.chs.template -# fixme: this should be in configure.ac: -HSCPP = $(CPP) -x c -traditional-cpp -P - CHSDEPEND = $(srcdir)/mk/chsDepend -HSC = hsc2hs - # all packages and applications lib_LIBRARIES = \ libHSglib.a \ @@ -478,6 +473,27 @@ nobase_hi_SCRIPTS += $(libHSgtk_a_HSFILES:.hs=.hi) +if BUILDDOCS +htmldir = $(prefix)/html +html_DATA = $(foreach HSFILE, $(libHSgtk_a_HSFILES), \ + $(patsubst gtk.%.hs, doc/%.html, $(subst /,.,$(HSFILE)))) +EXCLUDE_DOCS = +PREPROC_DOCS = gtk/Graphics/UI/Gtk.hs + +$(html_DATA) : $(libHSgtk_a_HSFILES) $(PREPROC_DOCS:.hs=.hs.uncpp) + mkdir -p doc + $(HADDOCK) --html -o doc \ + --title="Gtk2Hs" --package=$(libHSgtk_a_NAME) \ + --dump-interface=doc/gtk.haddock \ + $(filter-out $(EXCLUDE_DOCS) $(PREPROC_DOCS), $^) + +.hs.hs.uncpp : $(CONFIG_H) + $(HSCPP) -I. $< -o $@ + +MOSTLYCLEANFILES += $(html_DATA) + +endif #BUILDDOCS + MOSTLYCLEANFILES += $(am_libHSgtk_a_OBJECTS) MOSTLYCLEANFILES += $(libHSgtk_a_HSFILES:.hs=.hi) MOSTLYCLEANFILES += \ Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.287 retrieving revision 1.288 diff -u -d -r1.287 -r1.288 --- ChangeLog 13 Jan 2005 22:16:34 -0000 1.287 +++ ChangeLog 13 Jan 2005 23:01:16 -0000 1.288 @@ -3,6 +3,11 @@ * gtk/Graphics/UI/Gtk/Pango/Enums.chs.pp: fix whitespace problem that caused compile failure. + * configure.ac, Makefile.am, mk/common.mk: Do detection of haddock and + add --enable-docs to configure. First hash at building haddock docs - + gtk package only so far. Also move some defines from Makefile.am to + configure.ac as requested by a FIXME comment. + 2005-01-12 Axel Simon <A....@ke...> * Makefile.am, gtk/Graphics/UI/Gtk/Pango/Rendering.chs.pp, |