1 # Use this m4 function for autoconf if you use YAZ in your own
4 dnl ----- Setup Docbook documentation for YAZ
7 dnl autoconf < 2.60 does not define docdir
8 if test -n "$docdir"; then
9 docdir="${datadir}/doc/${PACKAGE}"
12 AC_SUBST(XSLTPROC_COMPILE)
13 XSLTPROC_COMPILE='xsltproc --xinclude -path ".:$(srcdir)"'
15 MAN_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.man.xsl'
16 AC_SUBST(HTML_COMPILE)
17 HTML_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.htmlhelp.xsl'
19 TKL_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.tkl.xsl'
21 PDF_COMPILE='dblatex -P latex.class.options=a4paper,12pt,twoside,openright'
24 AC_ARG_WITH(docbook-dtd,[[ --with-docbook-dtd=DIR use docbookx.dtd in DIR]],
26 if test -f "$withval/docbookx.dtd"; then
30 AC_MSG_CHECKING(for docbookx.dtd)
32 for d in /usr/lib/sgml/dtd/docbook-xml \
33 /usr/share/sgml/docbook/dtd/4.2 \
34 /usr/share/sgml/docbook/dtd/xml/4.* \
35 /usr/share/sgml/docbook/xml-dtd-4.* \
36 /usr/local/share/xml/docbook/4.*
38 if test -f $d/docbookx.dtd; then
42 if test -z "$DTD_DIR"; then
43 AC_MSG_RESULT(Not found)
49 AC_ARG_WITH(docbook-dsssl,[[ --with-docbook-dsssl=DIR use Docbook DSSSL in DIR/{html,print}/docbook.dsl]],
51 if test -f "$withval/html/docbook.dsl"; then
55 AC_MSG_CHECKING(for docbook.dsl)
57 for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
58 /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
59 /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh \
60 /usr/local/share/sgml/docbook/dsssl/modular
62 if test -f $d/html/docbook.dsl; then
68 if test -z "$DSSSL_DIR"; then
69 AC_MSG_RESULT(Not found)
73 AC_ARG_WITH(docbook-xsl,[[ --with-docbook-xsl=DIR use Docbook XSL in DIR/{htmlhelp,xhtml}]],
75 if test -f "$withval/htmlhelp/htmlhelp.xsl"; then
79 AC_MSG_CHECKING(for htmlhelp.xsl)
80 for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \
81 /usr/local/share/xsl/docbook \
82 /usr/share/sgml/docbook/xsl-stylesheets-1.*
84 if test -f $d/htmlhelp/htmlhelp.xsl; then
90 if test -z "$XSL_DIR"; then
91 AC_MSG_RESULT(Not found)
104 AC_ARG_WITH(yaz, [ --with-yaz=DIR use yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval])
105 if test "x$yazpath" != "xNONE"; then
106 yazconfig=$yazpath/yaz-config
108 if test "x$srcdir" = "x"; then
113 for i in ${yazsrcdir}/../../yaz ${yazsrcdir}/../yaz-* ${yazsrcdir}/../yaz; do
115 if test -r $i/yaz-config; then
116 yazconfig=$i/yaz-config
120 if test "x$yazconfig" = "xNONE"; then
121 AC_PATH_PROG(yazconfig, yaz-config, NONE)
124 AC_MSG_CHECKING(for YAZ)
125 if $yazconfig --version >/dev/null 2>&1; then
126 YAZLIB=`$yazconfig --libs $1`
127 # if this is empty, it's a simple version YAZ 1.6 script
128 # so we have to source it instead...
129 if test "X$YAZLIB" = "X"; then
132 YAZLALIB=`$yazconfig --lalibs $1`
133 YAZINC=`$yazconfig --cflags $1`
134 YAZVERSION=`$yazconfig --version`
136 AC_MSG_RESULT([$yazconfig])
138 AC_MSG_RESULT(Not found)
141 if test "X$YAZVERSION" != "XNONE"; then
142 AC_MSG_CHECKING([for YAZ version])
143 AC_MSG_RESULT([$YAZVERSION])
145 have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
146 req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
147 if test "$have_yaz_version" -lt "$req_yaz_version"; then
148 AC_MSG_ERROR([$YAZVERSION. Requires YAZ $2 or later])