1 # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # Use this m4 funciton for autoconf if you use YAZ in your own
26 AC_ARG_WITH(yazconfig, [ --with-yazconfig=DIR yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval])
27 if test "x$yazpath" != "xNONE"; then
28 yazconfig=$yazpath/yaz-config
30 if test "x$srcdir" = "x"; then
35 for i in ${yazsrcdir}/../yaz* ${yazsrcdir}/../yaz ../yaz* ../yaz; do
37 if test -r $i/yaz-config; then
38 yazconfig=$i/yaz-config
42 if test "x$yazconfig" = "xNONE"; then
43 AC_PATH_PROG(yazconfig, yaz-config, NONE)
46 AC_MSG_CHECKING(for YAZ)
47 if $yazconfig --version >/dev/null 2>&1; then
48 YAZLIB=`$yazconfig --libs $1`
49 # if this is empty, it's a simple version YAZ 1.6 script
50 # so we have to source it instead...
51 if test "X$YAZLIB" = "X"; then
54 YAZLALIB=`$yazconfig --lalibs $1`
55 YAZINC=`$yazconfig --cflags $1`
56 YAZVERSION=`$yazconfig --version`
58 AC_MSG_RESULT([$yazconfig])
60 AC_MSG_RESULT(Not found)
63 if test "X$YAZVERSION" != "XNONE"; then
64 AC_MSG_CHECKING([for YAZ version])
65 AC_MSG_RESULT([$YAZVERSION])
67 have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
68 req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
69 if test "$have_yaz_version" -lt "$req_yaz_version"; then
70 AC_MSG_ERROR([$YAZVERSION. Requires $2 or later])