[postgis-commits] svn - r2777 - in trunk: . doc
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Tue May 20 15:10:55 PDT 2008
Author: mcayland
Date: 2008-05-20 15:10:54 -0700 (Tue, 20 May 2008)
New Revision: 2777
Modified:
trunk/configure.in
trunk/doc/Makefile
Log:
Rework the documentation Makefile so that it works with the autoconf build system.
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2008-05-14 17:24:25 UTC (rev 2776)
+++ trunk/configure.in 2008-05-20 22:10:54 UTC (rev 2777)
@@ -24,6 +24,49 @@
dnl
+dnl Search for xsltproc which is required for building documentation
+dnl
+
+AC_PATH_PROG([XSLTPROC], [xsltproc], [])
+if test "x$XSLTPROC" = "x"; then
+ AC_MSG_WARN([xsltproc is not installed so documentation cannot be built])
+fi
+
+
+dnl
+dnl Allow the user to specify the location of the html/docbook.xsl stylesheet
+dnl
+
+AC_ARG_WITH([xsldir], [Specify the path to the directory containing the docbook.xsl stylesheet], [XSLBASE="$withval"], [XSLBASE=""])
+if test "x$XSLBASE" = "x"; then
+ dnl If the user did not specify a directory for the docbook stylesheet, choose the first directory
+ dnl that matches from the following list
+ SEARCHPATH="
+ /usr/share/sgml/docbook/xsl-stylesheets
+ /usr/share/xml/docbook/stylesheet/nwalsh
+ /usr/share/sgml/docbook/stylesheet/xsl/nwalsh
+ "
+ for p in ${SEARCHPATH}; do
+ if test -r "${p}"/html/docbook.xsl; then
+ XSLBASE="${p}"
+ break
+ fi
+ done
+fi
+
+dnl For XSLBASE, make sure the directory exists and that it contains html/docbook.xsl
+if test ! -d "$XSLBASE"; then
+ AC_MSG_ERROR([the docbook stylesheet directory specified using --with-xsldir does not exist])
+fi
+
+if test ! -f "$XSLBASE/html/docbook.xsl"; then
+ AC_MSG_ERROR([the docbook stylesheet directory specified using --with-xsldir does not contain the html/docbook.xsl file])
+fi
+
+AC_SUBST([XSLBASE])
+
+
+dnl
dnl Detect the version of PostgreSQL installed on the system
dnl
@@ -245,5 +288,5 @@
dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])
dnl Output the relevant files
-AC_OUTPUT([lwgeom/Makefile lwgeom/sqldefines.h loader/Makefile.pgsql2shp regress/Makefile])
+AC_OUTPUT([lwgeom/Makefile lwgeom/sqldefines.h loader/Makefile.pgsql2shp regress/Makefile doc/Makefile])
Modified: trunk/doc/Makefile
===================================================================
--- trunk/doc/Makefile 2008-05-14 17:24:25 UTC (rev 2776)
+++ trunk/doc/Makefile 2008-05-20 22:10:54 UTC (rev 2777)
@@ -1,10 +1,10 @@
-include ../Makefile.config
-include ../Version.config
+#
+# PostGIS documentation build Makefile
+#
-LAST_RELEASE_VERSION = $(REL_MAJOR_VERSION).$(REL_MINOR_VERSION).$(REL_MICRO_VERSION)
+XSLTPROC = /usr/bin/xsltproc
+XSLBASE = /usr/share/xml/docbook/stylesheet/nwalsh
-JW_COMMONOPTS = -f docbook -b html -e no-valid
-
XSLTPROC_COMMONOPTS = \
--param section.autolabel 1 \
--param section.label.includes.component.label 1 \
@@ -15,21 +15,19 @@
HTML_DOCBOOK_XSL=$(XSLBASE)/html/docbook.xsl
CHUNK_HTML_DOCBOOK_XSL=$(XSLBASE)/html/chunk.xsl
-FO_DOCBOOK_XSL=$(XSLBASE)/fo/docbook.xsl
-all: $(DOC_RULE)
-requirements_not_met:
- @echo
- @echo "Docs building requires 'xsltproc' or 'jw'."
- @echo "Configuration tool could not find any, either install"
- @echo "them or refer to online manual:"
- @echo
- @echo " http://postgis.refractions.net/docs"
- @echo
+# If XSLTPROC was not found during configure, we cannot
+# build the documentation
+ifdef XSLTPROC
+all: html/postgis.html
+else
+all: requirements_not_met
+endif
+
postgis-out.xml: postgis.xml long_xact.xml ../Version.config
- cat $< | sed "s/@@LAST_RELEASE_VERSION@@/$(LAST_RELEASE_VERSION)/g" > $@
+ cat $< | sed "s/@@LAST_RELEASE_VERSION@@/1.4.0/g" > $@
chunked-html: postgis-out.xml
$(XSLTPROC) $(XSLTPROC_COMMONOPTS) $(XSLTPROC_HTMLOPTS) \
@@ -44,35 +42,6 @@
$(HTML_DOCBOOK_XSL) \
$<
-postgis.fo: postgis-out.xml
- $(XSLTPROC) $(XSLTPROC_COMMONOPTS) \
- --output $@ \
- $(XSLBASE)/fo/docbook.xsl \
- $<
-
-html: html/postgis.html
-
-postgis.pdf: postgis-out.xml
- @if test x"$(DB2PDF)" = x; then \
- echo "Error: db2pdf not found, can't build posgis.pdf"; \
- echo " try installing docbook-utils package"; \
- false; \
- else \
- $(DB2PDF) $< && mv postgis-out.pdf postgis.pdf; \
- fi
-
-# this is broken
-_postgis.pdf: postgis.fo
- @if test x"$(PDFXMLTEX)" = x; then \
- echo "Error: pdfxmltex not found, can't build posgis.pdf"; \
- false; \
- else \
- $(PDFXMLTEX) $<; \
- fi
-
-jw: postgis-out.xml
- $(JW) $(JW_COMMONOPTS) -o html/ postgis-out.xml
-
clean:
@rm -f \
postgis-out.xml \
@@ -99,4 +68,14 @@
rm -f $(DESTDIR)$(mandir)/man1/shp2pgsql.1
rm -f $(DESTDIR)$(mandir)/man1/pgsql2shp.1
-.PHONY: html
+requirements_not_met:
+ @echo
+ @echo "configure was unable to find 'xsltproc' which is required to build the documentation."
+ @echo "To build the documentation, install xsltproc and then re-run configure. Alternatively "
+ @echo "refer to online manual:"
+ @echo
+ @echo " http://postgis.refractions.net/docs"
+ @echo
+
+.PHONY: html
+
More information about the postgis-commits
mailing list