1 ## $Id: idzebra-2.0.m4,v 1.1 2006-08-14 12:18:49 adam Exp $
3 # Use this m4 function for autoconf if you use ID Zebra in your own
6 AC_DEFUN([IDZEBRA_2_0_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-2.0.0)], [idzebrapath=$withval])
15 if test "x$idzebrapath" != "xNONE"; then
16 idzebraconfig=$idzebrapath/idzebra-config-2.0
18 if test "x$srcdir" = "x"; then
23 for dir in ${idzebrasrcdir}/../idzebra* ${idzebrasrcdir}/../idzebra ../idzebra* ../zebra; do
25 conf=$dir/idzebra-config-2.0
26 if test -r $conf; then
31 if test "x$idzebraconfig" = "xNONE"; then
32 AC_PATH_PROG(idzebraconfig, idzebra-config-2.0, NONE)
35 AC_MSG_CHECKING(for idzebra)
36 if $idzebraconfig --version >/dev/null 2>&1; then
37 IDZEBRA_LIBS=`$idzebraconfig --libs $1`
38 IDZEBRA_LALIBS=`$idzebraconfig --lalibs $1`
39 IDZEBRA_CFLAGS=`$idzebraconfig --cflags $1`
40 IDZEBRA_VERSION=`$idzebraconfig --version`
41 AC_MSG_RESULT([$idzebraconfig])
43 AC_MSG_RESULT(Not found)
46 if test "X$IDZEBRA_VERSION" != "XNONE"; then
47 AC_MSG_CHECKING([for idzebra version])
48 AC_MSG_RESULT([$IDZEBRA_VERSION])
50 have_idzebra_version=`echo "$IDZEBRA_VERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
51 req_idzebra_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
52 if test "$have_idzebra_version" -lt "$req_idzebra_version"; then
53 AC_MSG_ERROR([$IDZEBRA_VERSION. Requires idzebra $2 or later])