summaryrefslogtreecommitdiffstats
path: root/src/external/libldb.m4
blob: 3e26b15a0815e60106f12bf1ffdc34fd0dee4cc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
AC_SUBST(LDB_OBJ)
AC_SUBST(LDB_CFLAGS)
AC_SUBST(LDB_LIBS)

PKG_CHECK_MODULES(LDB, ldb >= 0.9.2)

AC_CHECK_HEADERS(ldb.h ldb_module.h,
   [AC_CHECK_LIB(ldb, ldb_init, [LDB_LIBS="-lldb"], , -ltevent -ltdb -ldl -lldap) ],
   [AC_MSG_ERROR([LDB header files are not installed])]
)

AC_ARG_WITH([ldb-lib-dir],
            [AC_HELP_STRING([--with-ldb-lib-dir=PATH],
                            [Path to store ldb modules [${libdir}/ldb]]
                           )
            ]
           )

if test x"$with_ldb_lib_dir" != x; then
    ldblibdir=$with_ldb_lib_dir
else
    ldblibdir="`$PKG_CONFIG --variable=modulesdir ldb`"
    if ! test -d $ldblibdir; then
        ldblibdir="${libdir}/ldb"
    fi
fi

AC_MSG_CHECKING([feature ldb runtime version check])
AC_ARG_ENABLE(ldb-version-check,
              [AS_HELP_STRING([--enable-ldb-version-check],
                              [compile with ldb runtime version check [default=no]])],
              enable_ldb_version_check="$enableval",
              enable_ldb_version_check="no")
if test x"$enable_ldb_version_check" = xyes ; then
    AC_MSG_RESULT([yes])
    AC_DEFINE([SSS_LDB_VERSION_CHECK], [1],
              [Define to 1 if you want ldb version check.])
else
    AC_MSG_RESULT([no])
fi

AC_MSG_NOTICE([ldb lib directory: $ldblibdir])
AC_SUBST(ldblibdir)