r18129: moved the system includes into libreplace - this gives much more
authorAndrew Tridgell <tridge@samba.org>
Wed, 6 Sep 2006 04:44:32 +0000 (04:44 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:17:36 +0000 (14:17 -0500)
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)

35 files changed:
source/configure.ac
source/lib/ldb/include/includes.h
source/lib/replace/libreplace.m4
source/lib/replace/replace.c
source/lib/replace/replace.h
source/lib/replace/system/README [moved from source/include/system/README with 100% similarity]
source/lib/replace/system/capability.h [moved from source/include/system/capability.h with 94% similarity]
source/lib/replace/system/config.m4 [moved from source/include/system/config.m4 with 100% similarity]
source/lib/replace/system/dir.h [moved from source/include/system/dir.h with 97% similarity]
source/lib/replace/system/filesys.h [moved from source/include/system/filesys.h with 98% similarity]
source/lib/replace/system/glob.h [moved from source/include/system/glob.h with 94% similarity]
source/lib/replace/system/iconv.h [moved from source/include/system/iconv.h with 95% similarity]
source/lib/replace/system/kerberos.h [moved from source/include/system/kerberos.h with 99% similarity]
source/lib/replace/system/locale.h [moved from source/include/system/locale.h with 93% similarity]
source/lib/replace/system/network.h [moved from source/include/system/network.h with 97% similarity]
source/lib/replace/system/passwd.h [moved from source/include/system/passwd.h with 97% similarity]
source/lib/replace/system/printing.h [moved from source/include/system/printing.h with 94% similarity]
source/lib/replace/system/readline.h [moved from source/include/system/readline.h with 95% similarity]
source/lib/replace/system/select.h [moved from source/include/system/select.h with 94% similarity]
source/lib/replace/system/shmem.h [moved from source/include/system/shmem.h with 95% similarity]
source/lib/replace/system/syslog.h [moved from source/include/system/syslog.h with 96% similarity]
source/lib/replace/system/terminal.h [moved from source/include/system/terminal.h with 95% similarity]
source/lib/replace/system/time.h [moved from source/include/system/time.h with 95% similarity]
source/lib/replace/system/wait.h [moved from source/include/system/wait.h with 94% similarity]
source/lib/replace/test/testsuite.c
source/lib/talloc/talloc.c
source/lib/talloc/testsuite.c
source/lib/tdb/Makefile.in
source/lib/tdb/autogen.sh
source/lib/tdb/common/tdb_private.h
source/lib/tdb/configure.ac
source/lib/tdb/tools/tdbbackup.c
source/lib/tdb/tools/tdbdump.c
source/lib/tdb/tools/tdbtest.c
source/lib/tdb/tools/tdbtorture.c

index 795e6e04510e159c90efccad8aa479008ddf03b1..67a56aacd7fa15b5cd88782605aaeea4092bb989 100644 (file)
@@ -16,7 +16,6 @@ SMB_EXT_LIB(DL, $LIBDL)
 m4_include(lib/replace/win32/config.m4)
 m4_include(lib/replace/repdir/config.m4)
 m4_include(lib/smbreadline/readline.m4)
 m4_include(lib/replace/win32/config.m4)
 m4_include(lib/replace/repdir/config.m4)
 m4_include(lib/smbreadline/readline.m4)
-m4_include(include/system/config.m4)
 m4_include(build/m4/rewrite.m4)
 m4_include(heimdal_build/config.m4)
 m4_include(lib/util/fault.m4)
 m4_include(build/m4/rewrite.m4)
 m4_include(heimdal_build/config.m4)
 m4_include(lib/util/fault.m4)
index f761d358c96dbcb91c8e85f8cef228c7c9812ac1..800ffdf568282931525d181a158cb94ab56f2907 100644 (file)
@@ -9,39 +9,14 @@
 #define HAVE_ILDAP 1
 #endif
 
 #define HAVE_ILDAP 1
 #endif
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include "replace.h"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <unistd.h>
-#include <fnmatch.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
 #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
 #define discard_const_p(type, ptr) ((type *)discard_const(ptr))
 
 #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
 #define discard_const_p(type, ptr) ((type *)discard_const(ptr))
 
+#include "replace.h"
+#include "system/filesys.h"
+#include "system/network.h"
+#include "system/time.h"
 #include "talloc.h"
 #include "talloc.h"
-
 #include "ldb.h"
 #include "ldb_errors.h"
 #include "ldb_private.h"
 #include "ldb.h"
 #include "ldb_errors.h"
 #include "ldb_private.h"
index ce36ee39b40c1eac17c0a1a03b309dfa43211107..146575626140954125ee6c1fe6d1846c6cb3417a 100644 (file)
@@ -168,6 +168,7 @@ AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
 
 m4_include(getpass.m4)
 m4_include(cc_features.m4)
 
 m4_include(getpass.m4)
 m4_include(cc_features.m4)
+m4_include(system/config.m4)
 
 LIBREPLACE_C99_STRUCT_INIT(c99_struct_initialization=yes,
                        c99_struct_initialization=no)
 
 LIBREPLACE_C99_STRUCT_INIT(c99_struct_initialization=yes,
                        c99_struct_initialization=no)
index b9c106d5820e959e13ac37bb6f4b1830040bb8a8..733cb758bd15990db880b1364720c8462977e2db 100644 (file)
 
 #include "replace.h"
 
 
 #include "replace.h"
 
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
+#include "system/filesys.h"
+#include "system/time.h"
+#include "system/passwd.h"
+#include "system/syslog.h"
 
 void replace_dummy(void);
 void replace_dummy(void) {}
 
 void replace_dummy(void);
 void replace_dummy(void) {}
index 566be225be0767f5a2442ae67edc84b0d69303cb..38b4e08704ac94cc28b669780613b37baa1a5173 100644 (file)
 #define _replace_h
 
 #include "config.h"
 #define _replace_h
 
 #include "config.h"
+
+#include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <errno.h>
 
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #include "lib/replace/win32/replace.h"
 
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #include "lib/replace/win32/replace.h"
 #include <inttypes.h>
 #endif
 
 #include <inttypes.h>
 #endif
 
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]
@@ -70,7 +82,7 @@ void *rep_memmove(void *dest,const void *src,int size);
 #endif
 
 #if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM)
 #endif
 
 #if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM)
-#include <sys/time.h>
+#include "system/time.h"
 #endif
 
 #ifndef HAVE_MKTIME
 #endif
 
 #ifndef HAVE_MKTIME
@@ -286,6 +298,4 @@ typedef int bool;
 #define __STRING(x)    #x
 #endif
 
 #define __STRING(x)    #x
 #endif
 
-
-
 #endif
 #endif
similarity index 94%
rename from source/include/system/capability.h
rename to source/lib/replace/system/capability.h
index 5a5bc93aa379c94968cdaeb5fb96ec5f2b6efe03..6ed8ae8de027de180ebe3e2855039f123be825d1 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_capability_h
+#define _system_capability_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -36,3 +38,4 @@
 
 #endif
 
 
 #endif
 
+#endif
similarity index 97%
rename from source/include/system/dir.h
rename to source/lib/replace/system/dir.h
index 14b36c0da0a16bde1fcfeb63dc0caa3dec2e960e..64e413c90795aeebc2cee996bdb3b40a5bd65874 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_dir_h
+#define _system_dir_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -59,3 +61,4 @@
                        )
 #endif
 
                        )
 #endif
 
+#endif
similarity index 98%
rename from source/include/system/filesys.h
rename to source/lib/replace/system/filesys.h
index e81eec13e9d85300406e7ca438b54dce1f87d022..1e48f7ab40408a25a7fef509b56f33e5bbd6ceaa 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_filesys_h
+#define _system_filesys_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
 #define SEEK_SET 0
 #endif
 
 #define SEEK_SET 0
 #endif
 
+#endif
similarity index 94%
rename from source/include/system/glob.h
rename to source/lib/replace/system/glob.h
index 9de316803213d27e4a94bbb2824e79876f59fb1a..0e51f397c6964f6fd001509f514f18237377cf0b 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_glob_h
+#define _system_glob_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -27,3 +29,5 @@
 #ifdef HAVE_FNMATCH_H
 #include <fnmatch.h>
 #endif
 #ifdef HAVE_FNMATCH_H
 #include <fnmatch.h>
 #endif
+
+#endif
similarity index 95%
rename from source/include/system/iconv.h
rename to source/lib/replace/system/iconv.h
index d5cbe84d8fe42831e67c3eb649617e3f8ac75a49..75ee1d83ba3f96b26d4cfcdb323333ca043e6023 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_iconv_h
+#define _system_iconv_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -35,3 +37,4 @@
 #define EILSEQ EIO
 #endif
 
 #define EILSEQ EIO
 #endif
 
+#endif
similarity index 99%
rename from source/include/system/kerberos.h
rename to source/lib/replace/system/kerberos.h
index 5037cbc54266e73284047790163fe34f96f49c11..b24196fc252deec212425f7deb285f83f99afa5b 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _system_kerberos_h
+#define _system_kerberos_h
+
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
 #include "heimdal/lib/gssapi/gssapi.h"
 #include "heimdal/lib/com_err/com_err.h"
 #endif
 #include "heimdal/lib/gssapi/gssapi.h"
 #include "heimdal/lib/com_err/com_err.h"
 #endif
+
+#endif
similarity index 93%
rename from source/include/system/locale.h
rename to source/lib/replace/system/locale.h
index e4be4a128b95d38030b8f928a25263f692c22640..82b179dc5b8a7e8dfc90c7161983298b00afe67b 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _system_locale_h
+#define _system_locale_h
+
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -27,3 +30,5 @@
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
+
+#endif
similarity index 97%
rename from source/include/system/network.h
rename to source/lib/replace/system/network.h
index b2c31583dcb50dccea8e781fc9e96efa648bbf8c..9b7346692469ce7c86ee4bc90c0517bfc9c5af4f 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_network_h
+#define _system_network_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -98,3 +100,4 @@ char *rep_inet_ntoa(struct in_addr ip);
 #define INADDR_NONE 0xffffffff
 #endif
 
 #define INADDR_NONE 0xffffffff
 #endif
 
+#endif
similarity index 97%
rename from source/include/system/passwd.h
rename to source/lib/replace/system/passwd.h
index 219ec306ae3bdef0f7a54962796458dfe1cfa0d1..6f8d729a7c0b5ba63b46a939982e757ef6cfa6d0 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _system_passwd_h
+#define _system_passwd_h
+
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -90,3 +93,4 @@
 int initgroups(char *name,gid_t id);
 #endif
 
 int initgroups(char *name,gid_t id);
 #endif
 
+#endif
similarity index 94%
rename from source/include/system/printing.h
rename to source/lib/replace/system/printing.h
index 9eb93a776e5490e56eb7f0cd7516ef0043c49d8e..489ccb1da8cba8116562996d1028d226d2fafd63 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _system_printing_h
+#define _system_printing_h
+
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -40,3 +43,4 @@
 #define PRINTCAP_NAME "/etc/printcap"
 #endif
 
 #define PRINTCAP_NAME "/etc/printcap"
 #endif
 
+#endif
similarity index 95%
rename from source/include/system/readline.h
rename to source/lib/replace/system/readline.h
index c3e565399d16bfe632153058c0cafd0b3de87496..4a64ef13766a2be0457f90d34bdd2eece9c4f78b 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_readline_h
+#define _system_readline_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -42,3 +44,5 @@
 /* This type is missing from libreadline<4.0  (approximately) */
 #  define RL_COMPLETION_CAST
 #endif /* HAVE_NEW_LIBREADLINE */
 /* This type is missing from libreadline<4.0  (approximately) */
 #  define RL_COMPLETION_CAST
 #endif /* HAVE_NEW_LIBREADLINE */
+
+#endif
similarity index 94%
rename from source/include/system/select.h
rename to source/lib/replace/system/select.h
index c0595492cd27df0e9c59d0353a6bd7646e6d4d56..0d1eabbc35d217148ce3d662ce06f3d668c11d64 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_select_h
+#define _system_select_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -36,3 +38,5 @@
 #if WITH_EPOLL
 #include <sys/epoll.h>
 #endif
 #if WITH_EPOLL
 #include <sys/epoll.h>
 #endif
+
+#endif
similarity index 95%
rename from source/include/system/shmem.h
rename to source/lib/replace/system/shmem.h
index e197cd146f1369e57830761cbdc584bfdc151099..9c0458363a807c1df5ab02dce48e5cb1a46b23a7 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_shmem_h
+#define _system_shmem_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -46,3 +48,4 @@
 #define MAP_FILE 0
 #endif
 
 #define MAP_FILE 0
 #endif
 
+#endif
similarity index 96%
rename from source/include/system/syslog.h
rename to source/lib/replace/system/syslog.h
index 7182e2e2d683b79d764313b869f3551e7fb1238f..e123830a7097b85e966025cf0471a8b352a23650 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_syslog_h
+#define _system_syslog_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -61,3 +63,4 @@
 #define LOG_DEBUG       7       /* debug-level messages */
 #endif
 
 #define LOG_DEBUG       7       /* debug-level messages */
 #endif
 
+#endif
similarity index 95%
rename from source/include/system/terminal.h
rename to source/lib/replace/system/terminal.h
index b727f8e7fa386d99d3fa0bb402ae179273fc3d32..94d6b5cc98d8c54abf3edf5effe7fa68310e7dea 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_terminal_h
+#define _system_terminal_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -37,3 +39,4 @@
 #include <sys/termio.h>
 #endif
 
 #include <sys/termio.h>
 #endif
 
+#endif
similarity index 95%
rename from source/include/system/time.h
rename to source/lib/replace/system/time.h
index 7d27a56c9ed2b0cd8e3a693b4a91e65f6163243e..e7c88f133d40de5a3a4ee66ed59107911d4af430 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_time_h
+#define _system_time_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -35,7 +37,4 @@
 #include <utime.h>
 #endif
 
 #include <utime.h>
 #endif
 
-#ifndef HAVE_TIMEGM
-time_t timegm(struct tm *tm);
 #endif
 #endif
-
similarity index 94%
rename from source/include/system/wait.h
rename to source/lib/replace/system/wait.h
index dc129ac1088e6bdaf8b58a76f21c1146465adcc2..be8c203f73e01167c0c24332e74027b255154a70 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _system_wait_h
+#define _system_wait_h
 /* 
    Unix SMB/CIFS implementation.
 
 /* 
    Unix SMB/CIFS implementation.
 
@@ -32,3 +34,4 @@
 #define SIGNAL_CAST (RETSIGTYPE (*)(int))
 #endif
 
 #define SIGNAL_CAST (RETSIGTYPE (*)(int))
 #endif
 
+#endif
index af50edc2a37d81bc199ea060b1ec358e57cf707b..9dddc017be81275b5b1075e4c0e93d8c16aff710 100644 (file)
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include "../replace.h"
-#include <stdio.h>
+#include "replace.h"
 
 
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <fcntl.h>
-#include <errno.h>
+/*
+  we include all the system/*.h include files here so that libreplace tests
+  them in the build farm
+*/
+#include "system/capability.h"
+#include "system/dir.h"
+#include "system/filesys.h"
+#include "system/glob.h"
+#include "system/iconv.h"
+#include "system/locale.h"
+#include "system/network.h"
+#include "system/passwd.h"
+#include "system/printing.h"
+#include "system/readline.h"
+#include "system/select.h"
+#include "system/shmem.h"
+#include "system/syslog.h"
+#include "system/terminal.h"
+#include "system/time.h"
+#include "system/wait.h"
 
 #define TESTFILE "testfile.dat"
 
 
 #define TESTFILE "testfile.dat"
 
index f92d76bb3d4d75009c09654aa575c51821c46d11..d2f7a5d828f0b8c41f9453f3b617d9030003fd17 100644 (file)
 
 #ifndef _TALLOC_SAMBA3
 #include "replace.h"
 
 #ifndef _TALLOC_SAMBA3
 #include "replace.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#if defined(HAVE_STDARG_H)
-#include <stdarg.h>
-#elif defined (HAVE_VARARGS_H)
-#include <varargs.h>
-#else
-#error "no var arg header"
-#endif
-
 #include "talloc.h"
 #endif /* not _TALLOC_SAMBA3 */
 
 #include "talloc.h"
 #endif /* not _TALLOC_SAMBA3 */
 
index 766cf039c0e758783188450f7cc9a4b11031bf82..1fa2c7bfe4bb81afeaedea65bcbd680ee19d3999 100644 (file)
 #include "version.h"
 #endif /* _SAMBA_BUILD_ */
 
 #include "version.h"
 #endif /* _SAMBA_BUILD_ */
 
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-
-#include <sys/time.h>
-#include <time.h>
-
+#include "replace.h"
+#include "system/time.h"
 #include "talloc.h"
 
 #ifndef False
 #include "talloc.h"
 
 #ifndef False
index 1e5884a9681b2311fece9df3cc4822c0d705ab50..64a6dc089121a26703f596baebce0c06c92778a9 100644 (file)
@@ -9,13 +9,13 @@ exec_prefix = @exec_prefix@
 bindir = @bindir@
 includedir = @includedir@
 libdir = @libdir@
 bindir = @bindir@
 includedir = @includedir@
 libdir = @libdir@
-VPATH = @srcdir@
+VPATH = @srcdir@:@libreplacedir@
 srcdir = @srcdir@
 builddir = @builddir@
 srcdir = @srcdir@
 builddir = @builddir@
-CFLAGS = -I$(srcdir)/include -Iinclude @CFLAGS@
+CFLAGS = -I$(srcdir)/include -Iinclude -I@libreplacedir@ @CFLAGS@
 
 PROGS = bin/tdbtool bin/tdbtorture
 
 PROGS = bin/tdbtool bin/tdbtorture
-TDB_OBJ = @TDBOBJ@
+TDB_OBJ = @TDBOBJ@ @LIBREPLACEOBJ@
 
 DIRS = lib bin common tools examples
 
 
 DIRS = lib bin common tools examples
 
@@ -24,7 +24,7 @@ all: dirs $(PROGS)
 .c.o:
        @echo Compiling $*.c
        @mkdir -p `dirname $@`
 .c.o:
        @echo Compiling $*.c
        @mkdir -p `dirname $@`
-       $(CC) $(CFLAGS) -c $< -o $@
+       @$(CC) $(CFLAGS) -c $< -o $@
 
 dirs:
        @mkdir -p $(DIRS)
 
 dirs:
        @mkdir -p $(DIRS)
index d46a4279f308caca8fc2f854121236600c331925..bf84eeee19a9116f3dc79177449a91321b3e8c31 100755 (executable)
@@ -3,8 +3,9 @@
 rm -rf autom4te.cache
 rm -f configure config.h.in
 
 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
 
 
 rm -rf autom4te.cache
 
index e77b2f209897f2f3c69d11882a8069c17558119e..cef2ae8a912fc136de8d1a7e1a9ad238b4abdf75 100644 (file)
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
    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/time.h"
 #include "system/shmem.h"
-#include "system/filesys.h"
-#endif
+#include "system/select.h"
+#include "tdb.h"
 
 #ifndef u32
 #define u32 unsigned
 
 #ifndef u32
 #define u32 unsigned
@@ -101,10 +78,6 @@ typedef u32 tdb_off_t;
 #define ACTIVE_LOCK      4
 #define TRANSACTION_LOCK 8
 
 #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
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *)-1)
 #endif
index 0943bbeeb855ac0b735c8499abfd24447ecba8c6..09cc353e39b636a5b87980c9caaa085a9235e2ca 100644 (file)
@@ -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
 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)
 m4_include(libtdb.m4)
 AC_OUTPUT(Makefile tdb.pc)
index 872ca99f0df4121219314b96031f2ea4022ed2d4..45beb5e292f0e398982fc28ad6fc3d314d6fee5d 100644 (file)
 
  */
 
 
  */
 
-#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 "tdb.h"
+#include "system/filesys.h"
 
 /*
   see if one file is newer than another
 
 /*
   see if one file is newer than another
index 74ba64fdd978eac94d4a96705c0cfc4b31dfcb3e..9111b739abde149e6e838dbc23e8647ddb368d4e 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
    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"
 #include "tdb.h"
-
-#else
-
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
 #include "system/locale.h"
 #include "system/filesys.h"
 
 #include "system/locale.h"
 #include "system/filesys.h"
 
-#endif
-
 static void print_data(TDB_DATA d)
 {
        unsigned char *p = (unsigned char *)d.dptr;
 static void print_data(TDB_DATA d)
 {
        unsigned char *p = (unsigned char *)d.dptr;
index edf12ecfdd4539dafd2c91de62190cd5cf6a75df..c7a09789fe0867cf913b1043aaea857c7883ac1d 100644 (file)
@@ -1,26 +1,9 @@
 /* a test program for tdb - the trivial database */
 
 /* 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"
 #include "tdb.h"
-#else
-
-#include "includes.h"
 #include "system/filesys.h"
 #include "system/time.h"
 #include "system/filesys.h"
 #include "system/time.h"
-#include "lib/tdb/include/tdb.h"
-
-#endif
 
 #include <gdbm.h>
 
 
 #include <gdbm.h>
 
index 9b0a60348c8d41bfbee7626b1bd174f966be6d10..14a2b48cdc78d4bf5e4d215b1f2cd354e08312cc 100644 (file)
@@ -2,33 +2,12 @@
    writers - that stresses the locking code. 
 */
 
    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"
 #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"
 
 #include "system/time.h"
 #include "system/wait.h"
 #include "system/filesys.h"
 
-#endif
-
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #endif
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #endif