From: Sandro Santilli Date: Mon, 18 Aug 2014 10:58:38 +0000 (+0000) Subject: Simplify docs building rules, hopefully fixing build-on-install (#2872) X-Git-Tag: 2.2.0rc1~887 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf171c36ad7f473bf38630296d9f3ce3ea8d3bda;p=postgis Simplify docs building rules, hopefully fixing build-on-install (#2872) git-svn-id: http://svn.osgeo.org/postgis/trunk@12894 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/GNUmakefile.in b/GNUmakefile.in index 22324624e..09407a7a5 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -5,7 +5,7 @@ #----------------------------------------------------- # 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@ @@ -21,10 +21,6 @@ all install uninstall noop clean distclean check: all: postgis_svn_revision.h -ifneq ($(XSLTPROC),) -all: comments -endif - install: all comments-install uninstall: docs-uninstall comments-uninstall diff --git a/configure.ac b/configure.ac index 395922ff2..256e0dfba 100644 --- a/configure.ac +++ b/configure.ac @@ -163,26 +163,37 @@ dnl 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 diff --git a/doc/Makefile.in b/doc/Makefile.in index 3f879669d..d4d25a60a 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -39,6 +39,7 @@ INSTALL_DATA=@INSTALL_DATA@ XSLTPROC=@XSLTPROC@ XSLBASE=@XSLBASE@ XMLLINT=@XMLLINT@ +CAN_BUILD_COMMENTS=@CAN_BUILD_COMMENTS@ PERL=@PERL@ # To allow network access use: @@ -88,22 +89,20 @@ PGSQL_DOCDIR=@PGSQL_DOCDIR@ 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 \ @@ -292,15 +291,15 @@ distclean: clean 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 \