diff --git a/Makefile.am b/Makefile.am index 77d8deaa..738a583e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,7 +64,16 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = spandsp.pc faq: faq.xml +if USE_DOCBOOK_CDN + sed -i 's|http://docbook.sourceforge.net|https://cdn.docbook.org|g' wrapper.xsl +else + sed -i 's|https://cdn.docbook.org|http://docbook.sourceforge.net|g' wrapper.xsl +endif +if HAVE_XML_CATALOG_FILES + cd faq ; XML_CATALOG_FILES=$(XML_CATALOG_FILES) xsltproc ../wrapper.xsl ../faq.xml +else cd faq ; xsltproc ../wrapper.xsl ../faq.xml +endif rpm: rpm-build diff --git a/configure.ac b/configure.ac index 83fb3fde..44d9c7d8 100644 --- a/configure.ac +++ b/configure.ac @@ -147,7 +147,10 @@ AC_ARG_ENABLE(v34, [ --enable-v34 Enable V.34 support]) # The following is for MSVC, where we may be using a local copy of libtiff, built alongside spandsp AC_ARG_ENABLE(builtin_tiff, - [AC_HELP_STRING([--enable-builtin-tiff],[build with builtin libtiff])],[enable_builtin_tiff="$enableval"],[enable_builtin_tiff="no"]) + [AC_HELP_STRING([--enable-builtin-tiff],[Build with builtin libtiff])],[enable_builtin_tiff="$enableval"],[enable_builtin_tiff="no"]) + +AC_ARG_ENABLE(docbook-cdn, + [AC_HELP_STRING([--enable-docbook-cdn],[Build docs with 'cdn.docbook.org' URL])],[enable_docbook_cdn="yes"],[enable_docbook_cdn="no"]) AC_FUNC_ERROR_AT_LINE AC_FUNC_VPRINTF @@ -584,6 +587,35 @@ else fi AM_CONDITIONAL([COND_DOC], [test "$enable_doc" = yes]) +AM_CONDITIONAL([HAVE_XML_CATALOG_FILES], false) +AM_CONDITIONAL([USE_DOCBOOK_CDN], false) + +AS_IF([test "$enable_doc" != "no"], [ + AC_CHECK_PROG([have_xsltproc], xsltproc, true, false) + XML_CATALOG_FILES= + if $have_xsltproc; then + catalog_prefix="" + AC_CHECK_PROG([have_brew], brew, true, false) + if $have_brew; then + catalog_prefix=$(brew --prefix) + fi + catalog_file=$catalog_prefix/etc/xml/catalog + if test -f $catalog_file; then + AM_CONDITIONAL([HAVE_XML_CATALOG_FILES], true) + XML_CATALOG_FILES=file:$catalog_file + else + AC_MSG_WARN([Missing file $catalog_file.]) + fi + AC_SUBST([XML_CATALOG_FILES]) + AM_CONDITIONAL([USE_DOCBOOK_CDN], [test "$enable_docbook_cdn" = yes]) + else + AS_IF([test "x$enable_doc" != xcheck], [ + AC_MSG_FAILURE( + [--enable-doc was given, but test for xsltproc failed]) + ]) + fi +]) + AM_CONDITIONAL([COND_TESTS], [test "$enable_tests" = yes]) AM_CONDITIONAL([COND_MMX], [test "$enable_mmx" = yes]) AM_CONDITIONAL([COND_SSE], [test "$enable_sse" = yes]) diff --git a/debian/control b/debian/control index a70f3771..6c0a6492 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: spandsp Section: libs Priority: optional Maintainer: FreeSWITCH Solutions -Build-Depends: debhelper (>= 9), libtiff-dev, libjpeg-dev, dpatch, doxygen, autotools-dev, xsltproc +Build-Depends: debhelper (>= 9), libtiff-dev, libjpeg-dev, dpatch, doxygen, autotools-dev, xsltproc, docbook-xsl Standards-Version: 3.9.6 Package: libspandsp3 diff --git a/doc/Makefile.am b/doc/Makefile.am index b85883f4..a4b65b1f 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -32,7 +32,16 @@ doxydocs: doxygen doxygen t38_manual/index.html: t38_manual.xml +if USE_DOCBOOK_CDN + sed -i 's|http://docbook.sourceforge.net|https://cdn.docbook.org|g' wrapper.xsl +else + sed -i 's|https://cdn.docbook.org|http://docbook.sourceforge.net|g' wrapper.xsl +endif +if HAVE_XML_CATALOG_FILES + cd t38_manual ; XML_CATALOG_FILES=$(XML_CATALOG_FILES) xsltproc ../wrapper.xsl ../t38_manual.xml +else cd t38_manual ; xsltproc ../wrapper.xsl ../t38_manual.xml +endif clean: cd t38_manual ; rm *.html ; cd ../api ; rm -rf html