1 # Use this m4 function for autoconf if you use YAZ in your own
4 dnl ----- Setup Docbook documentation for YAZ
8 AC_ARG_WITH(docbook-dtd, [ --with-docbook-dtd[=DIR] use docbookx.dtd in DIR],
10 if test -f "$withval/docbookx.dtd"; then
14 AC_MSG_CHECKING(for docbookx.dtd)
16 for d in /usr/lib/sgml/dtd/docbook-xml \
17 /usr/share/sgml/docbook/dtd/4.2 \
18 /usr/share/sgml/docbook/dtd/xml/4.0 \
19 /usr/share/sgml/docbook/dtd/xml/4.1.2 \
20 /usr/share/sgml/docbook/xml-dtd-4.1 \
21 /usr/share/sgml/docbook/xml-dtd-4.1.2*
23 if test -f $d/docbookx.dtd; then
29 if test -z "$DTD_DIR"; then
30 AC_MSG_RESULT(Not found)
34 AC_ARG_WITH(docbook-dsssl,[ --with-docbook-dsssl[=DIR] use Docbook DSSSL in DIR/{html,print}/docbook.dsl],
36 if test -f "$withval/html/docbook.dsl"; then
40 AC_MSG_CHECKING(for docbook.dsl)
42 for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
43 /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
44 /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh
46 if test -f $d/html/docbook.dsl; then
52 if test -z "$DSSSL_DIR"; then
53 AC_MSG_RESULT(Not found)
57 AC_ARG_WITH(docbook-xsl,[ --with-docbook-xsl[=DIR] use Docbook XSL in DIR/{htmlhelp,xhtml}],
59 if test -f "$withval/htmlhelp/htmlhelp.xsl"; then
63 AC_MSG_CHECKING(for htmlhelp.xsl)
64 for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \
65 /usr/share/sgml/docbook/xsl-stylesheets-1.*
67 if test -f $d/htmlhelp/htmlhelp.xsl; then
73 if test -z "$XSL_DIR"; then
74 AC_MSG_RESULT(Not found)
87 AC_ARG_WITH(yaz, [ --with-yaz=DIR use yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval])
88 if test "x$yazpath" != "xNONE"; then
89 yazconfig=$yazpath/yaz-config
91 if test "x$srcdir" = "x"; then
96 for i in ${yazsrcdir}/../../yaz ${yazsrcdir}/../yaz* ${yazsrcdir}/../yaz; do
98 if test -r $i/yaz-config; then
99 yazconfig=$i/yaz-config
103 if test "x$yazconfig" = "xNONE"; then
104 AC_PATH_PROG(yazconfig, yaz-config, NONE)
107 AC_MSG_CHECKING(for YAZ)
108 if $yazconfig --version >/dev/null 2>&1; then
109 YAZLIB=`$yazconfig --libs $1`
110 # if this is empty, it's a simple version YAZ 1.6 script
111 # so we have to source it instead...
112 if test "X$YAZLIB" = "X"; then
115 YAZLALIB=`$yazconfig --lalibs $1`
116 YAZINC=`$yazconfig --cflags $1`
117 YAZVERSION=`$yazconfig --version`
119 AC_MSG_RESULT([$yazconfig])
121 AC_MSG_RESULT(Not found)
124 if test "X$YAZVERSION" != "XNONE"; then
125 AC_MSG_CHECKING([for YAZ version])
126 AC_MSG_RESULT([$YAZVERSION])
128 have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
129 req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
130 if test "$have_yaz_version" -lt "$req_yaz_version"; then
131 AC_MSG_ERROR([$YAZVERSION. Requires $2 or later])
133 if test "$req_yaz_version" -gt "2000028"; then
134 YAZINC="$YAZINC -DYAZ_USE_NEW_LOG=1"