summaryrefslogtreecommitdiff
path: root/source4/lib/tdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-06 04:44:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:36 -0500
commita983b06d37c3b87a02444d9a9862777b88629344 (patch)
tree531e396a45b073f476fd091e068c2d6f175a618b /source4/lib/tdb
parent3e11f4c06131542565149496d659f0050411a68f (diff)
downloadsamba-a983b06d37c3b87a02444d9a9862777b88629344.tar.gz
samba-a983b06d37c3b87a02444d9a9862777b88629344.tar.bz2
samba-a983b06d37c3b87a02444d9a9862777b88629344.zip
r18129: moved the system includes into libreplace - this gives much more
isolation of our portability environment from the main code, and also simplifies the includes system (no separate #ifdef _SAMBA_BUILD for tdb. ldb etc now) (This used to be commit 77d1a468e06290aba789e2f3affc769fc5159a21)
Diffstat (limited to 'source4/lib/tdb')
-rw-r--r--source4/lib/tdb/Makefile.in8
-rwxr-xr-xsource4/lib/tdb/autogen.sh5
-rw-r--r--source4/lib/tdb/common/tdb_private.h35
-rw-r--r--source4/lib/tdb/configure.ac1
-rw-r--r--source4/lib/tdb/tools/tdbbackup.c28
-rw-r--r--source4/lib/tdb/tools/tdbdump.c22
-rw-r--r--source4/lib/tdb/tools/tdbtest.c19
-rw-r--r--source4/lib/tdb/tools/tdbtorture.c23
8 files changed, 17 insertions, 124 deletions
diff --git a/source4/lib/tdb/Makefile.in b/source4/lib/tdb/Makefile.in
index 1e5884a968..64a6dc0891 100644
--- a/source4/lib/tdb/Makefile.in
+++ b/source4/lib/tdb/Makefile.in
@@ -9,13 +9,13 @@ exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
-VPATH = @srcdir@
+VPATH = @srcdir@:@libreplacedir@
srcdir = @srcdir@
builddir = @builddir@
-CFLAGS = -I$(srcdir)/include -Iinclude @CFLAGS@
+CFLAGS = -I$(srcdir)/include -Iinclude -I@libreplacedir@ @CFLAGS@
PROGS = bin/tdbtool bin/tdbtorture
-TDB_OBJ = @TDBOBJ@
+TDB_OBJ = @TDBOBJ@ @LIBREPLACEOBJ@
DIRS = lib bin common tools examples
@@ -24,7 +24,7 @@ all: dirs $(PROGS)
.c.o:
@echo Compiling $*.c
@mkdir -p `dirname $@`
- $(CC) $(CFLAGS) -c $< -o $@
+ @$(CC) $(CFLAGS) -c $< -o $@
dirs:
@mkdir -p $(DIRS)
diff --git a/source4/lib/tdb/autogen.sh b/source4/lib/tdb/autogen.sh
index d46a4279f3..bf84eeee19 100755
--- a/source4/lib/tdb/autogen.sh
+++ b/source4/lib/tdb/autogen.sh
@@ -3,8 +3,9 @@
rm -rf autom4te.cache
rm -f configure config.h.in
-autoheader || exit 1
-autoconf || exit 1
+IPATHS="-I libreplace -I lib/replace -I ../libreplace -I ../replace"
+autoconf $IPATHS || exit 1
+autoheader $IPATHS || exit 1
rm -rf autom4te.cache
diff --git a/source4/lib/tdb/common/tdb_private.h b/source4/lib/tdb/common/tdb_private.h
index e77b2f2098..cef2ae8a91 100644
--- a/source4/lib/tdb/common/tdb_private.h
+++ b/source4/lib/tdb/common/tdb_private.h
@@ -24,35 +24,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _SAMBA_BUILD_
-#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include "tdb.h"
-
-#else
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
+#include "replace.h"
+#include "system/filesys.h"
#include "system/time.h"
#include "system/shmem.h"
-#include "system/filesys.h"
-#endif
+#include "system/select.h"
+#include "tdb.h"
#ifndef u32
#define u32 unsigned
@@ -101,10 +78,6 @@ typedef u32 tdb_off_t;
#define ACTIVE_LOCK 4
#define TRANSACTION_LOCK 8
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
#endif
diff --git a/source4/lib/tdb/configure.ac b/source4/lib/tdb/configure.ac
index 0943bbeeb8..09cc353e39 100644
--- a/source4/lib/tdb/configure.ac
+++ b/source4/lib/tdb/configure.ac
@@ -11,5 +11,6 @@ AC_CHECK_SIZEOF(off_t,cross)
AC_CHECK_SIZEOF(size_t,cross)
AC_CHECK_SIZEOF(ssize_t,cross)
AC_FUNC_MMAP
+m4_include(libreplace.m4)
m4_include(libtdb.m4)
AC_OUTPUT(Makefile tdb.pc)
diff --git a/source4/lib/tdb/tools/tdbbackup.c b/source4/lib/tdb/tools/tdbbackup.c
index 872ca99f0d..45beb5e292 100644
--- a/source4/lib/tdb/tools/tdbbackup.c
+++ b/source4/lib/tdb/tools/tdbbackup.c
@@ -41,33 +41,9 @@
*/
-#ifndef _SAMBA_BUILD_
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <ctype.h>
-#include <signal.h>
-
-#else
-
-#include "includes.h"
-#include "system/filesys.h"
-
-#endif
-
+#include "replace.h"
#include "tdb.h"
+#include "system/filesys.h"
/*
see if one file is newer than another
diff --git a/source4/lib/tdb/tools/tdbdump.c b/source4/lib/tdb/tools/tdbdump.c
index 74ba64fdd9..9111b739ab 100644
--- a/source4/lib/tdb/tools/tdbdump.c
+++ b/source4/lib/tdb/tools/tdbdump.c
@@ -18,31 +18,11 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef _SAMBA_BUILD_
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <ctype.h>
-#include <signal.h>
+#include "replace.h"
#include "tdb.h"
-
-#else
-
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
#include "system/locale.h"
#include "system/filesys.h"
-#endif
-
static void print_data(TDB_DATA d)
{
unsigned char *p = (unsigned char *)d.dptr;
diff --git a/source4/lib/tdb/tools/tdbtest.c b/source4/lib/tdb/tools/tdbtest.c
index edf12ecfdd..c7a09789fe 100644
--- a/source4/lib/tdb/tools/tdbtest.c
+++ b/source4/lib/tdb/tools/tdbtest.c
@@ -1,26 +1,9 @@
/* a test program for tdb - the trivial database */
-#ifndef _SAMBA_BUILD_
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <signal.h>
+#include "replace.h"
#include "tdb.h"
-#else
-
-#include "includes.h"
#include "system/filesys.h"
#include "system/time.h"
-#include "lib/tdb/include/tdb.h"
-
-#endif
#include <gdbm.h>
diff --git a/source4/lib/tdb/tools/tdbtorture.c b/source4/lib/tdb/tools/tdbtorture.c
index 9b0a60348c..14a2b48cdc 100644
--- a/source4/lib/tdb/tools/tdbtorture.c
+++ b/source4/lib/tdb/tools/tdbtorture.c
@@ -2,33 +2,12 @@
writers - that stresses the locking code.
*/
-#ifndef _SAMBA_BUILD_
-#define _GNU_SOURCE
-#include <stdlib.h>
-#include <time.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/wait.h>
+#include "replace.h"
#include "tdb.h"
-
-#else
-
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
#include "system/time.h"
#include "system/wait.h"
#include "system/filesys.h"
-#endif
-
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif