Only use 0.8.0-15 cocaine for now
[elliptics.git] / config / ac_check_smack.m4
blobad9866afa23f9d5d0bc643b57c173d78e592dd68
1 AC_DEFUN([AC_CHECK_SMACK],[
2 AC_MSG_CHECKING([whether SMACK development version is installed])
3 SMACK_LIBS="-lsmack"
4 ac_have_smack="no"
6 AC_ARG_WITH([smack-path],
7         AC_HELP_STRING([--with-smack-path=@<:@ARG@:>@],
8                 [Build with the different path to SMACK (ARG=string)]),
9         [
10                 SMACK_LIBS="-L$withval/lib64 -L$withval/lib -lsmack -Wl,-rpath,$withval/lib64 -Wl,-rpath,$withval/lib"
11                 SMACK_CFLAGS="-I$withval/include"
12         ]
15 saved_CFLAGS="$CFLAGS"
16 saved_LIBS="$LIBS"
17 LIBS="$SMACK_LIBS $LIBS"
18 CFLAGS="$SMACK_CFLAGS $CFLAGS"
20 AC_TRY_LINK([#include <smack/smack.h>],
21         [int err; struct smack_ctl *ctl = smack_init(NULL, &err);],
22         [
23                 AC_DEFINE(HAVE_SMACK_SUPPORT, 1, [Define this if SMACK is installed])
24                 ac_have_smack="yes"
25                 AC_MSG_RESULT([yes])
26         ], [
27                 ac_have_smack="no"
28                 SMACK_LIBS=""
29                 SMACK_CFLAGS=""
30                 AC_MSG_RESULT([no])
31         ])
33 AC_SUBST(SMACK_LIBS)
34 AC_SUBST(SMACK_CFLAGS)
35 LIBS="$saved_LIBS"
36 CFLAGS="$saved_CFLAGS"
37 AM_CONDITIONAL(HAVE_SMACK, [test "f$ac_have_smack" = "fyes"])