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.* \
19 /usr/share/sgml/docbook/xml-dtd-4.*
21 if test -f $d/docbookx.dtd; then
26 if test -z "$DTD_DIR"; then
27 AC_MSG_RESULT(Not found)
31 AC_ARG_WITH(docbook-dsssl,[[ --with-docbook-dsssl=DIR use Docbook DSSSL in DIR/{html,print}/docbook.dsl]],
33 if test -f "$withval/html/docbook.dsl"; then
37 AC_MSG_CHECKING(for docbook.dsl)
39 for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
40 /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
41 /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh
43 if test -f $d/html/docbook.dsl; then
49 if test -z "$DSSSL_DIR"; then
50 AC_MSG_RESULT(Not found)
54 AC_ARG_WITH(docbook-xsl,[[ --with-docbook-xsl=DIR use Docbook XSL in DIR/{htmlhelp,xhtml}]],
56 if test -f "$withval/htmlhelp/htmlhelp.xsl"; then
60 AC_MSG_CHECKING(for htmlhelp.xsl)
61 for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \
62 /usr/share/sgml/docbook/xsl-stylesheets-1.*
64 if test -f $d/htmlhelp/htmlhelp.xsl; then
70 if test -z "$XSL_DIR"; then
71 AC_MSG_RESULT(Not found)
84 AC_ARG_WITH(yaz, [ --with-yaz=DIR use yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval])
85 if test "x$yazpath" != "xNONE"; then
86 yazconfig=$yazpath/yaz-config
88 if test "x$srcdir" = "x"; then
93 for i in ${yazsrcdir}/../../yaz ${yazsrcdir}/../yaz* ${yazsrcdir}/../yaz; do
95 if test -r $i/yaz-config; then
96 yazconfig=$i/yaz-config
100 if test "x$yazconfig" = "xNONE"; then
101 AC_PATH_PROG(yazconfig, yaz-config, NONE)
104 AC_MSG_CHECKING(for YAZ)
105 if $yazconfig --version >/dev/null 2>&1; then
106 YAZLIB=`$yazconfig --libs $1`
107 # if this is empty, it's a simple version YAZ 1.6 script
108 # so we have to source it instead...
109 if test "X$YAZLIB" = "X"; then
112 YAZLALIB=`$yazconfig --lalibs $1`
113 YAZINC=`$yazconfig --cflags $1`
114 YAZVERSION=`$yazconfig --version`
116 AC_MSG_RESULT([$yazconfig])
118 AC_MSG_RESULT(Not found)
121 if test "X$YAZVERSION" != "XNONE"; then
122 AC_MSG_CHECKING([for YAZ version])
123 AC_MSG_RESULT([$YAZVERSION])
125 have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
126 req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
127 if test "$have_yaz_version" -lt "$req_yaz_version"; then
128 AC_MSG_ERROR([$YAZVERSION. Requires $2 or later])
130 if test "$req_yaz_version" -gt "2000028"; then
131 YAZINC="$YAZINC -DYAZ_USE_NEW_LOG=1"