#-----------------------------------------------------
# todo: add all subdirs
-SUBDIRS = liblwgeom libpgcommon postgis regress @RASTER@ @TOPOLOGY@ loader utils @EXTENSIONS@
+SUBDIRS = liblwgeom libpgcommon postgis regress @RASTER@ @TOPOLOGY@ loader utils doc @EXTENSIONS@
PERL = @PERL@
all: postgis_svn_revision.h
-ifneq ($(XSLTPROC),)
-all: comments
-endif
-
install: all comments-install
uninstall: docs-uninstall comments-uninstall
dnl Search for xsltproc which is required for building documentation
dnl
+CAN_BUILD_COMMENTS=yes
+
AC_PATH_PROG([IMAGEMAGICK], [convert], [])
if test "x$IMAGEMAGICK" = "x"; then
AC_MSG_WARN([ImageMagick does not seem to be installed. Documentation cannot be built])
+ CAN_BUILD_COMMENTS=no
fi
AC_PATH_PROG([XSLTPROC], [xsltproc], [])
if test "x$XSLTPROC" = "x"; then
AC_MSG_WARN([xsltproc is not installed so documentation cannot be built])
+ CAN_BUILD_COMMENTS=no
fi
AC_PATH_PROG([XMLLINT], [xmllint], [])
if test "x$XMLLINT" = "x"; then
AC_MSG_WARN([xmllint is not installed so documentation cannot be checked])
+ CAN_BUILD_COMMENTS=no
fi
+CAN_BUILD_PDF=${CAN_BUILD_COMMENTS}
+
AC_PATH_PROG([DBLATEX], [dblatex], [])
if test "x$DBLATEX" = "x"; then
AC_MSG_WARN([dblatex is not installed so PDF documentation cannot be built])
+ CAN_BUILD_PDF=no
fi
+AC_SUBST(CAN_BUILD_COMMENTS)
+AC_SUBST(CAN_BUILD_PDF)
+
dnl
dnl Allow the user to specify the location of the html/docbook.xsl stylesheet
dnl
XSLTPROC=@XSLTPROC@
XSLBASE=@XSLBASE@
XMLLINT=@XMLLINT@
+CAN_BUILD_COMMENTS=@CAN_BUILD_COMMENTS@
PERL=@PERL@
# To allow network access use:
PGSQL_MANDIR=@PGSQL_MANDIR@
PGSQL_SHAREDIR=@PGSQL_SHAREDIR@
-# If XSLTPROC or XSLBASE were not found during configure, we cannot
-# build the documentation
-ifeq ($(XSLTPROC),)
-all: requirements_not_met_xsltproc
-else
-ifeq ($(XSLBASE),)
-all: requirements_not_met_xslbase
-else
-ifeq ($(IMAGEMAGICK),)
-all: requirements_not_met_imagemagick
-else
-all: comments
-endif
+BUILD_TARGET =
+
+ifeq ($(CAN_BUILD_COMMENTS),yes)
+BUILD_TARGET += comments
endif
+
+ifeq ($(CAN_BUILD_PDF),yes)
+BUILD_TARGET += pdf
endif
+# TODO: add "html" to the BUILD_TARGET if it can be built
+
+all: $(BUILD_TARGET)
+
XML_SOURCES = \
extras_historytable.xml \
extras_tigergeocoder.xml \
maintainer-clean: clean images-clean
rm -f postgis_comments.sql raster_comments.sql topology_comments.sql tiger_geocoder_comments.sql sfcgal_comments.sql
-ifeq ($(XSLTPROC),)
-comments: requirements_not_met_xsltproc
+ifneq ($(CAN_BUILD_COMMENTS),yes)
+comments:
else
comments: postgis_comments.sql raster_comments.sql topology_comments.sql sfcgal_comments.sql tiger_geocoder_comments.sql
endif
cheatsheets: postgis_cheatsheet.html raster_cheatsheet.html topology_cheatsheet.html sfcgal_cheatsheet.html tiger_geocoder_cheatsheet.html
-ifeq ($(XSLTPROC),)
+ifneq ($(CAN_BUILD_COMMENTS),yes)
comments-install:
if test -e postgis_comments.sql -a \
-e raster_comments.sql -a \