1 ## $Id: yaz.m4,v 1.1 2004-04-30 19:39:32 adam Exp $
3 # Use this m4 function for autoconf if you use YAZ in your own
14 AC_ARG_WITH(yazconfig, [ --with-yazconfig=DIR yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval])
15 if test "x$yazpath" != "xNONE"; then
16 yazconfig=$yazpath/yaz-config
18 if test "x$srcdir" = "x"; then
23 for i in ${yazsrcdir}/../yaz* ${yazsrcdir}/../yaz ../yaz* ../yaz; do
25 if test -r $i/yaz-config; then
26 yazconfig=$i/yaz-config
30 if test "x$yazconfig" = "xNONE"; then
31 AC_PATH_PROG(yazconfig, yaz-config, NONE)
34 AC_MSG_CHECKING(for YAZ)
35 if $yazconfig --version >/dev/null 2>&1; then
36 YAZLIB=`$yazconfig --libs $1`
37 # if this is empty, it's a simple version YAZ 1.6 script
38 # so we have to source it instead...
39 if test "X$YAZLIB" = "X"; then
42 YAZLALIB=`$yazconfig --lalibs $1`
43 YAZINC=`$yazconfig --cflags $1`
44 YAZVERSION=`$yazconfig --version`
46 AC_MSG_RESULT([$yazconfig])
48 AC_MSG_RESULT(Not found)
51 if test "X$YAZVERSION" != "XNONE"; then
52 AC_MSG_CHECKING([for YAZ version])
53 AC_MSG_RESULT([$YAZVERSION])
55 have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
56 req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
57 if test "$have_yaz_version" -lt "$req_yaz_version"; then
58 AC_MSG_ERROR([$YAZVERSION. Requires $2 or later])
64 dnl ----- Setup Docbook documentation for YAZ
68 AC_ARG_WITH(dtd, [ --with-dtd[=DIR] use docbookx.dtd in DIR],
70 if test -f "$withval/docbookx.dtd"; then
74 AC_MSG_CHECKING(for docbookx.dtd)
76 for d in /usr/share/sgml/docbook/dtd/xml/4.1.2 \
77 /usr/share/sgml/docbook/xml-dtd-4.1.2* \
78 /usr/share/sgml/docbook/xml-dtd-4.1 \
79 /usr/share/sgml/docbook/dtd/xml/4.0 \
80 /usr/lib/sgml/dtd/docbook-xml
82 if test -f $d/docbookx.dtd; then
88 if test -z "$DTD_DIR"; then
89 AC_MSG_RESULT(Not found)
93 AC_ARG_WITH(dsssl,[ --with-dsssl[=DIR] use Docbook DSSSL in DIR/{html,print}/docbook.dsl],
95 if test -f "$withval/html/docbook.dsl"; then
99 AC_MSG_CHECKING(for docbook.dsl)
101 for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
102 /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
103 /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh
105 if test -f $d/html/docbook.dsl; then
111 if test -z "$DSSSL_DIR"; then
112 AC_MSG_RESULT(Not found)
116 AC_ARG_WITH(xsl,[ --with-xsl[=DIR] use Docbook XSL in DIR/{htmlhelp,xhtml}],
118 if test -f "$withval/htmlhelp/htmlhelp.xsl"; then
122 AC_MSG_CHECKING(for htmlhelp.xsl)
123 for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \
124 /usr/share/sgml/docbook/xsl-stylesheets-1.*
126 if test -f $d/htmlhelp/htmlhelp.xsl; then
132 if test -z "$XSL_DIR"; then
133 AC_MSG_RESULT(Not found)