Conflict resolution
[elliptics.git] / config / ac_check_eblob.m4
blob82d667f2bbf858287af5899574f908f57e3fe3d1
1 AC_DEFUN([AC_CHECK_EBLOB],[
2 AC_MSG_CHECKING([whether libeblob development version is installed])
3 EBLOB_LIBS="-leblob"
4 ac_have_eblob="no"
6 AC_ARG_WITH([eblob-path],
7         AC_HELP_STRING([--with-eblob-path=@<:@ARG@:>@],
8                 [Build with the different path to eblob (ARG=string)]),
9         [
10                 EBLOB_LIBS="-L$withval/lib -leblob"
11                 EBLOB_CFLAGS="-I$withval/include"
12         ]
15 saved_CFLAGS="$CFLAGS"
16 saved_LIBS="$LIBS"
17 LIBS="$EBLOB_LIBS $LIBS"
18 CFLAGS="$EBLOB_CFLAGS $CFLAGS"
20 AC_TRY_LINK([#include <eblob/blob.h>],
21         [struct eblob_backend *b = eblob_init(NULL);],
22         [
23                 AC_DEFINE(HAVE_EBLOB_SUPPORT, 1, [Define this if libeblob is installed])
24                 ac_have_eblob="yes"
25                 AC_MSG_RESULT([yes])
26         ], [
27                 EBLOB_LIBS=""
28                 EBLOB_CFLAGS=""
29                 AC_MSG_ERROR([no])
30         ])
32 AC_SUBST(EBLOB_LIBS)
33 AC_SUBST(EBLOB_CFLAGS)
34 LIBS="$saved_LIBS"
35 CFLAGS="$saved_CFLAGS"
36 AM_CONDITIONAL(HAVE_EBLOB, [test "f$ac_have_eblob" = "fyes"])