1 ## $Id: idzebra.m4,v 1.1 2006-03-30 18:00:51 adam Exp $
3 # Use this m4 function for autoconf if you use ID Zebra in your own
6 AC_DEFUN([IDZEBRA_INIT],
9 AC_SUBST(IDZEBRA_LALIBS)
10 AC_SUBST(IDZEBRA_CFLAGS)
11 AC_SUBST(IDZEBRA_VERSION)
14 AC_ARG_WITH(idzebra, [ --with-idzebra=DIR use idzebra-config in DIR (example /home/idzebra-1.4.0)], [idzebrapath=$withval])
15 if test "x$idzebrapath" != "xNONE"; then
16 idzebraconfig=$idzebrapath/idzebra-config
18 if test "x$srcdir" = "x"; then
23 for i in ${idzebrasrcdir}/../idzebra* ${idzebrasrcdir}/../idzebra ../idzebra* ../zebra; do
25 if test -r $i/idzebra-config; then
26 idzebraconfig=$i/idzebra-config
30 if test "x$idzebraconfig" = "xNONE"; then
31 AC_PATH_PROG(idzebraconfig, idzebra-config, NONE)
34 AC_MSG_CHECKING(for idzebra)
35 if $idzebraconfig --version >/dev/null 2>&1; then
36 IDZEBRA_LIBS=`$idzebraconfig --libs $1`
37 IDZEBRA_LALIBS=`$idzebraconfig --lalibs $1`
38 IDZEBRA_CFLAGS=`$idzebraconfig --cflags $1`
39 IDZEBRA_VERSION=`$idzebraconfig --version`
40 AC_MSG_RESULT([$idzebraconfig])
42 AC_MSG_RESULT(Not found)
45 if test "X$IDZEBRA_VERSION" != "XNONE"; then
46 AC_MSG_CHECKING([for idzebra version])
47 AC_MSG_RESULT([$IDZEBRA_VERSION])
49 have_idzebra_version=`echo "$IDZEBRA_VERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
50 req_idzebra_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
51 if test "$have_idzebra_version" -lt "$req_idzebra_version"; then
52 AC_MSG_ERROR([$IDZEBRA_VERSION. Requires $2 or later])