summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-06-19 19:02:04 +0200
committerMichael Adam <obnox@samba.org>2009-06-19 21:13:37 +0200
commit5ceda58b8dc27bef915128c23f3e9e4a2886b998 (patch)
tree0bbbead40fea54959efd44cb3cc06793dba0ed67
parentec154a1d81dd2e71ec9fec7ed8abd1329153048e (diff)
downloadsamba-5ceda58b8dc27bef915128c23f3e9e4a2886b998.tar.gz
samba-5ceda58b8dc27bef915128c23f3e9e4a2886b998.tar.bz2
samba-5ceda58b8dc27bef915128c23f3e9e4a2886b998.zip
s3:build: check for availability of external libtdb and use it if available
Link internal libtalloc statiaclly if extenal libtalloc is not found or does not have appropriate version. Michael
-rw-r--r--source3/configure.in52
1 files changed, 34 insertions, 18 deletions
diff --git a/source3/configure.in b/source3/configure.in
index bed7184ab7..24276f5806 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -33,26 +33,9 @@ done
AC_SUBST(LIBTEVENT_OBJ0)
LIBS="${LIBS} ${TEVENT_LIBS}"
-# TODO: These should come from m4_include(lib/tdb/libtdb.m4)
-# but currently this fails: things have to get merged from s4.
-tdbdir="../lib/tdb"
-AC_SUBST(tdbdir)
-TDB_CFLAGS="-I${srcdir-.}/$tdbdir/include"
-AC_SUBST(TDB_CFLAGS)
-
-LIBTDB_OBJ0=""
-for o in common/tdb.o common/dump.o common/transaction.o common/error.o \
- common/traverse.o common/freelist.o common/freelistcheck.o \
- common/io.o common/lock.o common/open.o;
-do
- LIBTDB_OBJ0="$LIBTDB_OBJ0 $tdbdir/$o"
-done
-
-AC_SUBST(LIBTDB_OBJ0)
SAMBA_CPPFLAGS="-Iinclude -I${srcdir-.}/include -I. -I${srcdir-.}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/replace"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TEVENT_CFLAGS}"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/libaddns"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/.."
@@ -4746,7 +4729,40 @@ then
AC_SUBST(LIBTALLOC_OBJ0)
fi
-SMB_LIBRARY(tdb, 1)
+
+AC_ARG_ENABLE(external_libtdb,
+ [AS_HELP_STRING([--enable-external-libtdb],
+ [Enable external tdb [default=auto]])],
+ [ enable_external_libtalloc=$enableval ],
+ [ enable_external_libtalloc=auto ])
+
+if test "x$enable_external_libtdb" != xno
+then
+ PKG_CHECK_MODULES(LIBTDB, tdb >= 1.1.4,
+ [ enable_external_libtdb=yes ],
+ [
+ if test x$enable_external_libtdb = xyes; then
+ AC_MSG_ERROR([Unable to find libtdb])
+ else
+ enable_external_libtdb=no
+ fi
+ ])
+fi
+
+AC_SUBST(LIBTDB_OBJ0)
+if test "x$enable_external_libtdb" = xno
+then
+ m4_include(../lib/tdb/libtdb.m4)
+ LINK_LIBTDB=STATIC
+ SMB_LIBRARY(tdb, 1)
+ LIBTDB_OBJ0=""
+ for obj in ${TDB_OBJ}; do
+ LIBTDB_OBJ0="${LIBTDB_OBJ0} ${tdbdir}/${obj}"
+ done
+ AC_SUBST(LIBTDB_OBJ0)
+ SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
+fi
+
SMB_LIBRARY(netapi, 0)
SMB_LIBRARY(smbclient, 0)
SMB_LIBRARY(smbsharemodes, 0)