summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-02-14 13:29:44 +0100
committerMichael Adam <obnox@samba.org>2008-02-14 14:17:57 +0100
commit8e3ae7baaf287f70123eda7aa478ac82812e7c81 (patch)
treea023fc1b4a499fa7084aacbde73681b7588a1633 /source3/configure.in
parent879b32806df9304b46fc311073e623295ecbb974 (diff)
downloadsamba-8e3ae7baaf287f70123eda7aa478ac82812e7c81.tar.gz
samba-8e3ae7baaf287f70123eda7aa478ac82812e7c81.tar.bz2
samba-8e3ae7baaf287f70123eda7aa478ac82812e7c81.zip
Add support for building and using shared and static libtdb library.
This should work with m4_include(lib/tdb/libtdb.m4) like already done with talloc, but currently this does not work (yet) - tdb code has to be merged from s4 before that. Michael (This used to be commit e92fdf6b202bd67a9bb6fcc1ced56513a2d0bd3f)
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in67
1 files changed, 66 insertions, 1 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 70d573c7a2..aa024c6e59 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -280,10 +280,26 @@ for obj in ${TALLOC_OBJ}; do
done
AC_SUBST(TALLOC_OBJS)
+# 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$tdbdir/include"
+AC_SUBST(TDB_CFLAGS)
+TDB_OBJ="common/tdb.o common/dump.o common/transaction.o common/error.o common/traverse.o"
+TDB_OBJ="$TDB_OBJ common/freelist.o common/freelistcheck.o common/io.o common/lock.o common/open.o"
+AC_SUBST(TDB_OBJ)
+
+TDB_OBJS=""
+for obj in ${TDB_OBJ}; do
+ TDB_OBJS="${TDB_OBJS} ${tdbdir}/${obj}"
+done
+AC_SUBST(TDB_OBJS)
+
SAMBA_CPPFLAGS="-Iinclude -I${srcdir-.}/include -I. -I${srcdir-.}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/lib/replace"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TALLOC_CFLAGS}"
-SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/lib/tdb/include"
+SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TDB_CFLAGS}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/libaddns"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
@@ -337,6 +353,12 @@ AC_SUBST(LIBTALLOC_SHARED)
AC_SUBST(LIBTALLOC_STATIC)
AC_SUBST(LIBTALLOC_LIBS)
+AC_SUBST(LIBTDB_STATIC_TARGET)
+AC_SUBST(LIBTDB_SHARED_TARGET)
+AC_SUBST(LIBTDB_SHARED)
+AC_SUBST(LIBTDB_STATIC)
+AC_SUBST(LIBTDB_LIBS)
+
AC_SUBST(INSTALL_LIBWBCLIENT)
AC_SUBST(UNINSTALL_LIBWBCLIENT)
AC_SUBST(LIBWBCLIENT_SHARED)
@@ -5211,6 +5233,49 @@ if test $enable_static = yes; then
LIBTALLOC_STATIC=$LIBTALLOC_STATIC_TARGET
fi
+#################################################
+# should we build libtdb?
+LIBTDB_SHARED_TARGET=bin/libtdb.$SHLIBEXT
+LIBTDB_STATIC_TARGET=bin/libtdb.a
+LIBTDB_SHARED=
+LIBTDB_STATIC=
+LIBTDB_LIBS=
+
+AC_MSG_CHECKING(whether to build the libtdb shared library)
+AC_ARG_WITH(libtdb,
+[AS_HELP_STRING([--with-libtdb],
+ [Build the libtdb shared library (default=yes if shared libs supported)])],
+[
+case "$withval" in
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ yes)
+ samba_cv_with_libtdb=yes
+ ;;
+esac
+],
+[
+# if unspecified, default is to build it if possible.
+samba_cv_with_libtdb=yes
+]
+)
+
+if test x"$samba_cv_with_libtdb" = "xyes" -a $BLDSHARED = true; then
+ LIBTDB_SHARED=$LIBTDB_SHARED_TARGET
+ AC_MSG_RESULT(yes)
+ if test x"$LINK_LIBTDB" = "xSTATIC" ; then
+ LIBTDB_STATIC=$LIBTDB_STATIC_TARGET
+ else
+ LIBTDB_LIBS=-ltdb
+ fi
+else
+ enable_static=yes
+ AC_MSG_RESULT(no shared library support -- will supply static library)
+fi
+if test $enable_static = yes; then
+ LIBTDB_STATIC=$LIBTDB_STATIC_TARGET
+fi
#################################################
# should we build libnetapi?