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