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 -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'
22 AC_ARG_WITH(docbook-dtd,[[ --with-docbook-dtd=DIR use docbookx.dtd in DIR]],
24 if test -f "$withval/docbookx.dtd"; then
28 AC_MSG_CHECKING(for docbookx.dtd)
30 for d in /usr/lib/sgml/dtd/docbook-xml \
31 /usr/share/sgml/docbook/dtd/4.2 \
32 /usr/share/sgml/docbook/dtd/xml/4.* \
33 /usr/share/sgml/docbook/xml-dtd-4.* \
34 /usr/local/share/xml/docbook/4.*
36 if test -f $d/docbookx.dtd; then
40 if test -z "$DTD_DIR"; then
41 AC_MSG_RESULT(Not found)
47 AC_ARG_WITH(docbook-dsssl,[[ --with-docbook-dsssl=DIR use Docbook DSSSL in DIR/{html,print}/docbook.dsl]],
49 if test -f "$withval/html/docbook.dsl"; then
53 AC_MSG_CHECKING(for docbook.dsl)
55 for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
56 /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
57 /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh \
58 /usr/local/share/sgml/docbook/dsssl/modular
60 if test -f $d/html/docbook.dsl; then
66 if test -z "$DSSSL_DIR"; then
67 AC_MSG_RESULT(Not found)
71 AC_ARG_WITH(docbook-xsl,[[ --with-docbook-xsl=DIR use Docbook XSL in DIR/{htmlhelp,xhtml}]],
73 if test -f "$withval/htmlhelp/htmlhelp.xsl"; then
77 AC_MSG_CHECKING(for htmlhelp.xsl)
78 for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \
79 /usr/local/share/xsl/docbook \
80 /usr/share/sgml/docbook/xsl-stylesheets-1.*
82 if test -f $d/htmlhelp/htmlhelp.xsl; then
88 if test -z "$XSL_DIR"; then
89 AC_MSG_RESULT(Not found)
102 AC_ARG_WITH(yaz, [ --with-yaz=DIR use yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval])
103 if test "x$yazpath" != "xNONE"; then
104 yazconfig=$yazpath/yaz-config
106 if test "x$srcdir" = "x"; then
111 for i in ${yazsrcdir}/../../yaz ${yazsrcdir}/../yaz-* ${yazsrcdir}/../yaz; do
113 if test -r $i/yaz-config; then
114 yazconfig=$i/yaz-config
118 if test "x$yazconfig" = "xNONE"; then
119 AC_PATH_PROG(yazconfig, yaz-config, NONE)
122 AC_MSG_CHECKING(for YAZ)
123 if $yazconfig --version >/dev/null 2>&1; then
124 YAZLIB=`$yazconfig --libs $1`
125 # if this is empty, it's a simple version YAZ 1.6 script
126 # so we have to source it instead...
127 if test "X$YAZLIB" = "X"; then
130 YAZLALIB=`$yazconfig --lalibs $1`
131 YAZINC=`$yazconfig --cflags $1`
132 YAZVERSION=`$yazconfig --version`
134 AC_MSG_RESULT([$yazconfig])
136 AC_MSG_RESULT(Not found)
139 if test "X$YAZVERSION" != "XNONE"; then
140 AC_MSG_CHECKING([for YAZ version])
141 AC_MSG_RESULT([$YAZVERSION])
143 have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
144 req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
145 if test "$have_yaz_version" -lt "$req_yaz_version"; then
146 AC_MSG_ERROR([$YAZVERSION. Requires YAZ $2 or later])
148 if test "$req_yaz_version" -gt "2000028"; then
149 YAZINC="$YAZINC -DYAZ_USE_NEW_LOG=1"