* Bug 16365 fixed: median(m,'r'|'c') was wrong after 5dc990
[scilab.git] / scilab / m4 / docbook.m4
1 dnl
2 dnl Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 dnl Copyright (C) INRIA - 2008 - Sylvestre Ledru
4 dnl 
5 dnl Copyright (C) 2012 - 2016 - Scilab Enterprises
6 dnl
7 dnl This file is hereby licensed under the terms of the GNU GPL v2.0,
8 dnl pursuant to article 5.3.4 of the CeCILL v.2.1.
9 dnl This file was originally licensed under the terms of the CeCILL v2.1,
10 dnl and continues to be available under such terms.
11 dnl For more information, see the COPYING file which you should have received
12 dnl along with this program.
13 dnl
14 dnl DOCBOOK detection
15 dnl
16 dnl ------------------------------------------------------
17 dnl Check if Docbook is usable and working
18 dnl
19 AC_DEFUN([AC_DOCBOOK], [
20
21 DOCBOOK_OK=no
22 DOCBOOK_ROOT=""
23
24 if test "x$ac_java_jvm_name" != "x" ; then
25     # if JDK is not enabled, skip the docbook detection
26
27 AC_ARG_WITH(docbook,
28                 AC_HELP_STRING([--with-docbook=DIR],[Set the path to the docbook package]),
29                 [with_docbook=$withval],
30                 [with_docbook='yes']
31                 )
32
33         for dir in $with_docbook $SCI_SRCDIR_FULL/thirdparty/docbook/ /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/docbook2X/xslt/man/ /usr/share/xml/docbook/stylesheet/nwalsh/ /usr/share/xml/docbook/stylesheet/nwalsh/current/ /sw/share/xml/xsl/docbook-xsl /usr/share/xml/docbook/xsl-stylesheets-*/ /usr/share/sgml/docbook/xsl-stylesheets-*/ /usr/share/sgml/docbook/xsl-stylesheets /usr/share/sgml/docbook/xsl-ns-stylesheets-*/ /usr/share/xml/docbook/stylesheet/docbook-xsl /opt/local/share/xsl/docbook-xsl; do
34                 if test -r "$dir/fo/docbook.xsl" -a "$DOCBOOK_ROOT" = ""; then
35                         DOCBOOK_ROOT=$dir
36         fi
37         done
38         if test -z "$DOCBOOK_ROOT"; then
39                 AC_MSG_ERROR([Could not find the Docbook root directory. If you have installed it on your system and we haven't been able to find it. Please report a bug])
40         fi
41         AC_SUBST(DOCBOOK_ROOT)
42
43
44         # Saxon XSLT Processor, as the JVM implementation is unable to parse the docbook xsl files
45         # check Saxon-HE 9.5 first then fallback to Saxon-6.5
46         AC_JAVA_CHECK_JAR([saxon9he],[net.sf.saxon.Version],[Saxon XSLT Processor],"yes")
47         SAXON=$PACKAGE_JAR_FILE
48         if test -z "$SAXON"; then
49                 AC_JAVA_CHECK_JAR([saxon],[net.sf.saxon.Version],[Saxon XSLT Processor],"yes")
50                 SAXON=$PACKAGE_JAR_FILE
51         fi
52         if test -z "$SAXON"; then
53                 AC_JAVA_CHECK_JAR([saxon],[com.icl.saxon.Loader],[Saxon XSLT Processor])
54                 SAXON=$PACKAGE_JAR_FILE
55         fi
56         AC_SUBST(SAXON)
57
58 fi # JDK
59
60 ])