summaryrefslogtreecommitdiff
path: root/lib/ntdb
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-06-19 12:43:17 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-19 07:31:06 +0200
commit7e80b89d48a3c9c048be4d75bae11f12a6d37f2c (patch)
treea652e49dd2b6f6611ea95432fab676a17efd5ef5 /lib/ntdb
parent1fe797aada0f546e8d557625a78843274b7e5fc5 (diff)
downloadsamba-7e80b89d48a3c9c048be4d75bae11f12a6d37f2c.tar.gz
samba-7e80b89d48a3c9c048be4d75bae11f12a6d37f2c.tar.bz2
samba-7e80b89d48a3c9c048be4d75bae11f12a6d37f2c.zip
ntdb: add autoconf support.
This is copied from tdb; we build the utilities, but as nothing else links against it, we shouldn't be adding anything to the normal samba binary sizes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Tue Jun 19 07:31:06 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib/ntdb')
-rw-r--r--lib/ntdb/libntdb.m441
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/ntdb/libntdb.m4 b/lib/ntdb/libntdb.m4
new file mode 100644
index 0000000000..b713ababfd
--- /dev/null
+++ b/lib/ntdb/libntdb.m4
@@ -0,0 +1,41 @@
+dnl find the ntdb sources. This is meant to work both for
+dnl ntdb standalone builds, and builds of packages using ntdb
+ntdbdir=""
+ntdbpaths=". lib/ntdb ntdb ../ntdb ../lib/ntdb"
+for d in $ntdbpaths; do
+ if test -f "$srcdir/$d/ntdb.c"; then
+ ntdbdir="$d"
+ AC_SUBST(ntdbdir)
+ break;
+ fi
+done
+if test x"$ntdbdir" = "x"; then
+ AC_MSG_ERROR([cannot find ntdb source in $ntdbpaths])
+fi
+NTDB_OBJ="check.o free.o hash.o io.o lock.o ntdb.o open.o pyntdb.o summary.o transaction.o traverse.o"
+AC_SUBST(NTDB_OBJ)
+AC_SUBST(LIBREPLACEOBJ)
+AC_SUBST(CCAN_OBJ)
+
+NTDB_LIBS=""
+AC_SUBST(NTDB_LIBS)
+
+NTDB_DEPS=""
+if test x$libreplace_cv_HAVE_FDATASYNC_IN_LIBRT = xyes ; then
+ NTDB_DEPS="$NTDB_DEPS -lrt"
+fi
+AC_SUBST(NTDB_DEPS)
+
+NTDB_CFLAGS="-I$ntdbdir"
+AC_SUBST(NTDB_CFLAGS)
+
+AC_CHECK_FUNCS(mmap pread pwrite getpagesize utime)
+AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h)
+
+AC_HAVE_DECL(pread, [#include <unistd.h>])
+AC_HAVE_DECL(pwrite, [#include <unistd.h>])
+
+if test x"$VERSIONSCRIPT" != "x"; then
+ EXPORTSFILE=ntdb.exports
+ AC_SUBST(EXPORTSFILE)
+fi