1 # Use this m4 function for autoconf if you use ID Zebra in your own
4 AC_DEFUN([IDZEBRA_2_0_INIT],
7 AC_SUBST(IDZEBRA_LALIBS)
8 AC_SUBST(IDZEBRA_CFLAGS)
9 AC_SUBST(IDZEBRA_VERSION)
12 AC_ARG_WITH(idzebra, [ --with-idzebra=DIR use idzebra-config in DIR (example /home/idzebra-2.0.0)], [idzebrapath=$withval])
13 if test "x$idzebrapath" != "xNONE"; then
14 idzebraconfig=$idzebrapath/idzebra-config-2.0
16 if test "x$srcdir" = "x"; then
21 for dir in ${idzebrasrcdir}/../idzebra* ${idzebrasrcdir}/../idzebra ../idzebra* ../zebra; do
23 conf=$dir/idzebra-config-2.0
24 if test -r $conf; then
29 if test "x$idzebraconfig" = "xNONE"; then
30 AC_PATH_PROG(idzebraconfig, idzebra-config-2.0, NONE)
33 AC_MSG_CHECKING(for idzebra)
34 if $idzebraconfig --version >/dev/null 2>&1; then
35 IDZEBRA_LIBS=`$idzebraconfig --libs`
36 IDZEBRA_LALIBS=`$idzebraconfig --lalibs`
37 IDZEBRA_CFLAGS=`$idzebraconfig --cflags`
38 IDZEBRA_VERSION=`$idzebraconfig --version`
39 AC_MSG_RESULT([$idzebraconfig])
41 AC_MSG_RESULT(Not found)
44 if test "X$IDZEBRA_VERSION" != "XNONE"; then
45 AC_MSG_CHECKING([for idzebra version])
46 AC_MSG_RESULT([$IDZEBRA_VERSION])
48 have_idzebra_version=`echo "$IDZEBRA_VERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
49 req_idzebra_version=`echo "$1" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
50 if test "$have_idzebra_version" -lt "$req_idzebra_version"; then
51 AC_MSG_ERROR([$IDZEBRA_VERSION. Requires idzebra $1 or later])