65bb934f17a3693fdf3c4e37c0d5fb1452511a28
[yazproxy-moved-to-github.git] / yazpp.m4
1 ## $Id: yazpp.m4,v 1.3 2004-04-22 07:52:51 adam Exp $
2 AC_DEFUN([YAZPP_INIT],
3 [
4         AC_SUBST(YAZPPLIB)
5         AC_SUBST(YAZPPLALIB)
6         AC_SUBST(YAZPPINC)
7         AC_SUBST(YAZPPVERSION)
8         yazppconfig=NONE
9         yazpppath=NONE
10         AC_ARG_WITH(yazpp, [  --with-yazpp=DIR        yaz++-config in DIR (example /home/yaz++-0.8)], [yazpppath=$withval])
11         if test "x$yazpppath" != "xNONE"; then
12                 yazppconfig=$yazpppath/yaz++-config
13         else
14                 if test "x$srcdir" = "x"; then
15                         yazppsrcdir=.
16                 else
17                         yazppsrcdir=$srcdir
18                 fi
19                 for i in ${yazppsrcdir}/../yaz++-* ${yazppsrcdir}/../yaz++; do
20                         if test -d $i; then
21                                 if test -r $i/yaz++-config; then
22                                         yazppconfig=$i/yaz++-config
23                                 fi
24                         fi
25                 done
26                 if test "x$yazppconfig" = "xNONE"; then
27                         AC_PATH_PROG(yazppconfig, yaz++-config, NONE)
28                 fi
29         fi
30         AC_MSG_CHECKING(for YAZ++)
31         if $yazppconfig --version >/dev/null 2>&1; then
32                 YAZPPLIB=`$yazppconfig --libs $1`
33                 YAZPPLALIB=`$yazppconfig --lalibs $1`
34                 YAZPPINC=`$yazppconfig --cflags $1`
35                 YAZPPVERSION=`$yazppconfig --version`
36                 AC_MSG_RESULT($yazppconfig)
37         else
38                 AC_MSG_RESULT(Not found)
39                 YAZVERSION=NONE
40         fi
41 ])
42