r25987: libreplace: rename AC_LD_SHLDFLAGS into AC_LIBREPLACE_SHLD_FLAGS
[jelmer/samba4-debian.git] / source / lib / ldb / configure.ac
1 AC_PREREQ(2.50)
2 AC_DEFUN([AC_CHECK_LIB_EXT], [
3         AC_CHECK_LIB([$1],[$3],[$4],[$5],[$7])
4         ac_cv_lib_ext_$1_$3=$ac_cv_lib_$1_$3
5 ])
6 AC_DEFUN([AC_CHECK_FUNC_EXT], [
7         AC_CHECK_FUNC([$1],[$3],[$4])
8         ac_cv_func_ext_$1=$ac_cv_func_$1
9 ])
10 AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
11 AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
12 AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
13 AC_DEFUN([SMB_ENABLE], [echo -n ""])
14 AC_INIT(ldb, 0.9.1)
15 AC_CONFIG_SRCDIR([common/ldb.c])
16
17 AC_LIBREPLACE_ALL_CHECKS
18
19 if test "$ac_cv_prog_gcc" = yes; then
20    CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
21 fi
22
23 WITH_GCOV=0
24 AC_ARG_ENABLE(gcov,
25         AS_HELP_STRING([--enable-gcov],[enable GCOV code coverage tests]),
26         [ WITH_GCOV=1])
27 AC_SUBST(WITH_GCOV)
28 if test x"$with_gcov_support" = x"yes"; then
29    CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs"
30    LIBS="$LIBS -lgcov"
31 fi
32
33 AC_PATH_PROG(XSLTPROC,xsltproc)
34 AC_PATH_PROG(DOXYGEN,doxygen)
35 AC_PATH_PROG(GCOV,gcov)
36 AC_PATH_PROG(SLAPD,slapd)
37 AC_CHECK_HEADERS(stdint.h dlfcn.h)
38 AC_CONFIG_HEADER(include/config.h)
39
40 AC_DEFINE_UNQUOTED(LDB_MODULESDIR, LIBDIR "/ldb" , [Modules directory] )
41 AC_SUBST(LDB_MODULESDIR)
42
43 TESTS=""
44 EXTRA_OBJ=""
45
46 m4_include(libpopt.m4)
47 m4_include(libtalloc.m4)
48 m4_include(libtdb.m4)
49
50 m4_include(ldap.m4)
51 if test x"$with_ldap_support" = x"yes"; then
52    CFLAGS="$CFLAGS -DHAVE_LDB_LDAP=1"
53    EXTRA_OBJ="$EXTRA_OBJ ldb_ldap/ldb_ldap.o"
54    LDAP_LIBS="-llber -lldap"
55    AC_SUBST(LDAP_LIBS)
56    TESTS="$TESTS test-ldap.sh"
57 fi
58
59 m4_include(sqlite3.m4)
60 if test x"$with_sqlite3_support" = x"yes"; then
61    LIBS="$LIBS -lsqlite3"
62    CFLAGS="$CFLAGS -DHAVE_LDB_SQLITE3=1"
63    EXTRA_OBJ="$EXTRA_OBJ ldb_sqlite3/ldb_sqlite3.o"
64    TESTS="$TESTS test-sqlite3.sh"
65 fi
66
67 AC_SUBST(TESTS)
68 AC_SUBST(EXTRA_OBJ)
69
70 AC_LD_EXPORT_DYNAMIC
71 AC_LD_PICFLAG
72 AC_LD_SHLIBEXT
73 AC_LD_SONAMEFLAG
74 AC_LIBREPLACE_SHLD_FLAGS
75 AC_LIBREPLACE_MDLD
76 AC_LIBREPLACE_MDLD_FLAGS
77
78 m4_include(libldb.m4)
79 AC_OUTPUT(Makefile ldb.pc)