1 # Use this m4 function for autoconf if you use YAZ in your own
4 dnl ----- Setup Docbook documentation for YAZ
7 AC_SUBST(XSLTPROC_COMPILE)
8 XSLTPROC_COMPILE='xsltproc -path ".:$(srcdir)"'
10 MAN_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.man.xsl'
11 AC_SUBST(HTML_COMPILE)
12 HTML_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.htmlhelp.xsl'
14 TKL_COMPILE='$(XSLTPROC_COMPILE) $(srcdir)/common/id.tkl.xsl'
17 AC_ARG_WITH(docbook-dtd,[[ --with-docbook-dtd=DIR use docbookx.dtd in DIR]],
19 if test -f "$withval/docbookx.dtd"; then
23 AC_MSG_CHECKING(for docbookx.dtd)
25 for d in /usr/lib/sgml/dtd/docbook-xml \
26 /usr/share/sgml/docbook/dtd/4.2 \
27 /usr/share/sgml/docbook/dtd/xml/4.* \
28 /usr/share/sgml/docbook/xml-dtd-4.* \
29 /usr/local/share/xml/docbook/4.*
31 if test -f $d/docbookx.dtd; then
35 if test -z "$DTD_DIR"; then
36 AC_MSG_RESULT(Not found)
42 AC_ARG_WITH(docbook-dsssl,[[ --with-docbook-dsssl=DIR use Docbook DSSSL in DIR/{html,print}/docbook.dsl]],
44 if test -f "$withval/html/docbook.dsl"; then
48 AC_MSG_CHECKING(for docbook.dsl)
50 for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
51 /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
52 /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh \
53 /usr/local/share/sgml/docbook/dsssl/modular
55 if test -f $d/html/docbook.dsl; then
61 if test -z "$DSSSL_DIR"; then
62 AC_MSG_RESULT(Not found)
66 AC_ARG_WITH(docbook-xsl,[[ --with-docbook-xsl=DIR use Docbook XSL in DIR/{htmlhelp,xhtml}]],
68 if test -f "$withval/htmlhelp/htmlhelp.xsl"; then
72 AC_MSG_CHECKING(for htmlhelp.xsl)
73 for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \
74 /usr/local/share/xsl/docbook \
75 /usr/share/sgml/docbook/xsl-stylesheets-1.*
77 if test -f $d/htmlhelp/htmlhelp.xsl; then
83 if test -z "$XSL_DIR"; then
84 AC_MSG_RESULT(Not found)
97 AC_ARG_WITH(yaz, [ --with-yaz=DIR use yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval])
98 if test "x$yazpath" != "xNONE"; then
99 yazconfig=$yazpath/yaz-config
101 if test "x$srcdir" = "x"; then
106 for i in ${yazsrcdir}/../../yaz ${yazsrcdir}/../yaz-* ${yazsrcdir}/../yaz; do
108 if test -r $i/yaz-config; then
109 yazconfig=$i/yaz-config
113 if test "x$yazconfig" = "xNONE"; then
114 AC_PATH_PROG(yazconfig, yaz-config, NONE)
117 AC_MSG_CHECKING(for YAZ)
118 if $yazconfig --version >/dev/null 2>&1; then
119 YAZLIB=`$yazconfig --libs $1`
120 # if this is empty, it's a simple version YAZ 1.6 script
121 # so we have to source it instead...
122 if test "X$YAZLIB" = "X"; then
125 YAZLALIB=`$yazconfig --lalibs $1`
126 YAZINC=`$yazconfig --cflags $1`
127 YAZVERSION=`$yazconfig --version`
129 AC_MSG_RESULT([$yazconfig])
131 AC_MSG_RESULT(Not found)
134 if test "X$YAZVERSION" != "XNONE"; then
135 AC_MSG_CHECKING([for YAZ version])
136 AC_MSG_RESULT([$YAZVERSION])
138 have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
139 req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
140 if test "$have_yaz_version" -lt "$req_yaz_version"; then
141 AC_MSG_ERROR([$YAZVERSION. Requires YAZ $2 or later])
143 if test "$req_yaz_version" -gt "2000028"; then
144 YAZINC="$YAZINC -DYAZ_USE_NEW_LOG=1"