From: Eric Bollengier Date: Fri, 27 Jun 2008 15:17:59 +0000 (+0000) Subject: ebl update X-Git-Tag: Release-3.0.0~1220 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b81b8def6f828b2ab45b26f78a202f16aa51fccb;p=bacula%2Fbacula ebl update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7247 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/testing/tcdbm_mingw.patch b/bacula/patches/testing/tcdbm_mingw.patch index 1387477263..7f6805adfd 100644 --- a/bacula/patches/testing/tcdbm_mingw.patch +++ b/bacula/patches/testing/tcdbm_mingw.patch @@ -1,8 +1,8 @@ -Index: tokyocabinet/myconf.h +Index: myconf.h =================================================================== ---- tokyocabinet/myconf.h (révision 7137) -+++ tokyocabinet/myconf.h (copie de travail) -@@ -206,13 +206,16 @@ +--- myconf.h (revision 7238) ++++ myconf.h (working copy) +@@ -206,13 +206,18 @@ #include #include #include @@ -12,7 +12,9 @@ Index: tokyocabinet/myconf.h #include #include + -+#ifndef HAVE_WIN32 ++#ifdef HAVE_WIN32 ++#include "compat.h" ++#else +#include +#include #include @@ -21,129 +23,19 @@ Index: tokyocabinet/myconf.h #if TCUSEPTHREAD #include -Index: tokyocabinet/tcutil.c +Index: tcutil.c =================================================================== ---- tokyocabinet/tcutil.c (révision 7137) -+++ tokyocabinet/tcutil.c (copie de travail) -@@ -2271,7 +2271,7 @@ - return (a < b) ? a : b; - } - -- -+#ifndef HAVE_WIN32 - /* Get a random number as long integer based on uniform distribution. */ - unsigned long tclrand(void){ - static unsigned int cnt = 0; -@@ -2288,7 +2288,6 @@ - return (mask ^ cnt++) ^ (unsigned long)rand_r(&seed); - } - -- - /* Get a random number as double decimal based on uniform distribution. */ - double tcdrand(void){ - return tclrand() / (ULONG_MAX + 0.01); -@@ -2300,6 +2299,7 @@ - assert(sd >= 0.0); - return sqrt(-2.0 * log(tcdrand())) * cos(2 * 3.141592653589793 * tcdrand()) * sd + avg; - } -+#endif - - - /* Compare two strings with case insensitive evaluation. */ -@@ -2681,7 +2681,7 @@ - return buf; - } - -- -+#ifndef HAVE_WIN32 - /* Check whether a string matches a regular expression. */ - bool tcregexmatch(const char *str, const char *regex){ - assert(str && regex); -@@ -2744,7 +2744,22 @@ - return tcxstrtomalloc(xstr); - } - -+#endif - -+#ifdef HAVE_WIN32 -+ -+struct timezone { -+ int tz_minuteswest; /* minutes à l'ouest de Greenwich */ -+ int tz_dsttime; /* type de changement horaire */ -+}; -+ -+int gettimeofday(struct timeval *tv, struct timezone *tz) -+{ -+ return -1; -+} -+ -+#endif -+ - /* Get the time of day in seconds. */ - double tctime(void){ - struct timeval tv; -@@ -2752,6 +2767,7 @@ - return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0; - } - -+#ifndef HAVE_WIN32 - - /* Get the Gregorian calendar of a time. */ - void tccalendar(int64_t t, int jl, int *yearp, int *monp, int *dayp, -@@ -3064,7 +3080,6 @@ - return 0; - } +--- tcutil.c (revision 7238) ++++ tcutil.c (working copy) +@@ -17,7 +17,6 @@ + #include "tcutil.h" + #include "myconf.h" - - /* Get the day of week of a date. */ - int tcdayofweek(int year, int mon, int day){ - if(mon < 3){ -@@ -3105,8 +3120,10 @@ - #endif - } - -+#endif /* HAVE_WIN32 */ - - -+ /************************************************************************************************* - * filesystem utilities + * basic utilities *************************************************************************************************/ -@@ -3115,6 +3132,7 @@ - #define TCFILEMODE 00644 // permission of a creating file - #define TCIOBUFSIZ 16384 // size of an I/O buffer - -+#ifndef HAVE_WIN32 - - /* Get the canonicalized absolute path of a file. */ - char *tcrealpath(const char *path){ -@@ -3124,6 +3142,7 @@ - return tcstrdup(buf); - } - -+#endif /* HAVE_WIN32 */ - - /* Read whole data of a file. */ - void *tcreadfile(const char *path, int limit, int *sp){ -@@ -3251,6 +3270,7 @@ - return list; - } - -+#ifndef HAVE_WIN32 - - /* Expand a pattern into a list of matched paths. */ - TCLIST *tcglobpat(const char *pattern){ -@@ -3267,6 +3287,9 @@ - return list; - } - -+#else -+#define lstat stat -+#endif - - /* Remove a file or a directory and its sub ones recursively. */ - bool tcremovelink(const char *path){ -@@ -3333,6 +3356,7 @@ +@@ -3333,6 +3332,7 @@ /* Lock a file. */ bool tclock(int fd, bool ex, bool nb){ @@ -151,7 +43,7 @@ Index: tokyocabinet/tcutil.c assert(fd >= 0); struct flock lock; memset(&lock, 0, sizeof(struct flock)); -@@ -3344,6 +3368,7 @@ +@@ -3344,6 +3344,7 @@ while(fcntl(fd, nb ? F_SETLK : F_SETLKW, &lock) == -1){ if(errno != EINTR) return false; } @@ -159,158 +51,3 @@ Index: tokyocabinet/tcutil.c return true; } -@@ -5009,6 +5034,122 @@ - return wp - obuf;; - } - -+#ifdef HAVE_WIN32 - -+#include -+#include - -+int msync(void *start, size_t length, int flags) -+{ -+ return 0; -+} -+int fsync(int fd) -+{ -+ return 0; -+} -+/* -+ * Emulation of mmap and unmmap for tokyo dbm -+ */ -+void *mmap(void *start, size_t length, int prot, int flags, -+ int fd, off_t offset) -+{ -+ DWORD fm_access = 0; -+ DWORD mv_access = 0; -+ HANDLE h; -+ HANDLE mv; -+ -+ if (length == 0) { -+ return MAP_FAILED; -+ } -+ if (!fd) { -+ return MAP_FAILED; -+ } -+ -+ if (flags & PROT_WRITE) { -+ fm_access |= PAGE_READWRITE; -+ } else if (flags & PROT_READ) { -+ fm_access |= PAGE_READONLY; -+ } -+ -+ if (flags & PROT_READ) { -+ mv_access |= FILE_MAP_READ; -+ } -+ if (flags & PROT_WRITE) { -+ mv_access |= FILE_MAP_WRITE; -+ } -+ -+ h = CreateFileMapping((HANDLE)_get_osfhandle (fd), -+ NULL /* security */, -+ fm_access, -+ 0 /* MaximumSizeHigh */, -+ 0 /* MaximumSizeLow */, -+ NULL /* name of the file mapping object */); -+ -+ if (!h || h == INVALID_HANDLE_VALUE) { -+ return MAP_FAILED; -+ } -+ -+ mv = MapViewOfFile(h, mv_access, -+ 0 /* offset hi */, -+ 0 /* offset lo */, -+ length); -+ CloseHandle(h); -+ -+ if (!mv || mv == INVALID_HANDLE_VALUE) { -+ return MAP_FAILED; -+ } -+ -+ return (void *) mv; -+} -+ -+int munmap(void *start, size_t length) -+{ -+ if (!start) { -+ return -1; -+ } -+ UnmapViewOfFile(start); -+ return 0; -+} -+ -+ssize_t pread(int fd, void *buf, size_t count, off_t offset) -+{ -+ __int64 cur_pos; -+ ssize_t num_read; -+ -+ if ((cur_pos = _lseeki64(fd, 0, SEEK_CUR)) == (off_t)-1) -+ return -1; -+ -+ if (_lseeki64(fd, offset, SEEK_SET) == (off_t)-1) -+ return -1; -+ -+ num_read = read(fd, buf, count); -+ -+ if (_lseeki64(fd, cur_pos, SEEK_SET) == (off_t)-1) -+ return -1; -+ -+ return num_read; -+} -+ -+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) -+{ -+ __int64 cur_pos; -+ ssize_t num_write; -+ -+ if ((cur_pos = _lseeki64(fd, 0, SEEK_CUR)) == (off_t)-1) -+ return -1; -+ -+ if (_lseeki64(fd, offset, SEEK_SET) == (off_t)-1) -+ return -1; -+ -+ num_write = write(fd, buf, count); -+ -+ if (_lseeki64(fd, cur_pos, SEEK_SET) == (off_t)-1) -+ return -1; -+ -+ return num_write; -+} -+ -+#endif -+ -+ - // END OF FILE -Index: tokyocabinet/tcutil.h -=================================================================== ---- tokyocabinet/tcutil.h (révision 7137) -+++ tokyocabinet/tcutil.h (copie de travail) -@@ -2160,8 +2160,27 @@ - #define TCMAPRNUM(TC_map) \ - ((TC_map)->rnum) - -+#ifdef HAVE_WIN32 -+#include - -+/* mmap implementation for tokyodbm */ -+#define PROT_WRITE 0x2 /* Page can be written. */ -+#define PROT_READ 0x1 /* page can be read */ -+#define MAP_SHARED 0x01 /* Share changes. */ -+#define MAP_FAILED ((void *) -1) -+#define MS_SYNC 0 - -+void *mmap(void *start, size_t length, int prot, int flags, -+ int fd, off_t offset); -+int munmap(void *start, size_t length); -+int msync(void *start, size_t length, int flags); -+int fsync(int fd); -+ssize_t pread(int fd, void *buf, size_t count, off_t offset); -+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); -+ -+#endif -+ -+ - __TCUTIL_CLINKAGEEND - #endif /* duplication check */ - diff --git a/bacula/patches/testing/tcdbm_mingw_makefile.patch b/bacula/patches/testing/tcdbm_mingw_makefile.patch new file mode 100644 index 0000000000..fc40539b6f --- /dev/null +++ b/bacula/patches/testing/tcdbm_mingw_makefile.patch @@ -0,0 +1,92 @@ +--- Makefile 2008-06-27 17:15:12.000000000 +0200 ++++ Makefile.mingw 2008-06-27 17:15:04.000000000 +0200 +@@ -22,7 +22,7 @@ + # Targets + HEADERFILES = tcutil.h tchdb.h tcbdb.h tcadb.h + LIBRARYFILES = libtokyocabinet.a libtokyocabinet.so.3.6.0 libtokyocabinet.so.3 libtokyocabinet.so +-LIBOBJFILES = tcutil.o tchdb.o tcbdb.o tcadb.o myconf.o ++LIBOBJFILES = tcutil.o tchdb.o tcbdb.o tcadb.o myconf.o compat.o + COMMANDFILES = tcutest tcumttest tcucodec tchtest tchmttest tchmgr tcbtest tcbmttest tcbmgr tcatest tcamgr + MAN1FILES = tcutest.1 tcumttest.1 tcucodec.1 tchtest.1 tchmttest.1 tchmgr.1 tcbtest.1 tcbmttest.1 tcbmgr.1 tcatest.1 tcamgr.1 + MAN3FILES = tokyocabinet.3 tcutil.3 tcxstr.3 tclist.3 tcmap.3 tcmdb.3 tcmpool.3 tchdb.3 tcbdb.3 tcadb.3 +@@ -45,17 +45,17 @@ + + # Building configuration + CC = i586-mingw32msvc-gcc +-CPPFLAGS = -I. -I$(INCLUDEDIR) -L/home/eric/include -L/usr/local/include -DNDEBUG -D_GNU_SOURCE=1 -UNDEBUG \ ++CPPFLAGS = -I. -I$(INCLUDEDIR) -I/home/eric/include -L/usr/local/include -DNDEBUG -D_GNU_SOURCE=1 -UNDEBUG \ + -D_TC_PREFIX="\"$(prefix)\"" -D_TC_INCLUDEDIR="\"$(INCLUDEDIR)\"" \ + -D_TC_LIBDIR="\"$(LIBDIR)\"" -D_TC_BINDIR="\"$(BINDIR)\"" -D_TC_LIBEXECDIR="\"$(LIBEXECDIR)\"" \ + -D_TC_APPINC="\"-I$(INCLUDEDIR)\"" -D_TC_APPLIBS="\"-L$(LIBDIR) -ltokyocabinet -lm \"" +-CFLAGS = -std=c99 -Wall -fPIC -pedantic -fsigned-char -g ++CFLAGS = --std=c99 -Wall -pedantic -fsigned-char -g -DHAVE_WIN32 + LDFLAGS = -L. -L$(LIBDIR) -L/home/eric/lib -L/usr/local/lib -static +-LIBS = -lm ++LIBS = -lm -lz -lpthreadGCE + LDENV = LD_RUN_PATH=/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:$(LIBDIR):. + RUNENV = LD_LIBRARY_PATH=.:/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:$(LIBDIR) + POSTCMD = true +-NO_ECHO = @ ++NO_ECHO = + + + #================================================================ +@@ -447,47 +447,47 @@ + ln -f -s libtokyocabinet.$(LIBVER).$(LIBREV).0.dylib $@ + + +-tcutest : tcutest.o $(LIBRARYFILES) ++tcutest.exe : tcutest.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tcumttest : tcumttest.o $(LIBRARYFILES) ++tcumttest.exe : tcumttest.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tcucodec : tcucodec.o $(LIBRARYFILES) ++tcucodec.exe : tcucodec.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tchtest : tchtest.o $(LIBRARYFILES) ++tchtest.exe : tchtest.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tchmttest : tchmttest.o $(LIBRARYFILES) ++tchmttest.exe : tchmttest.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tchmgr : tchmgr.o $(LIBRARYFILES) ++tchmgr.exe : tchmgr.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tcbtest : tcbtest.o $(LIBRARYFILES) ++tcbtest.exe : tcbtest.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tcbmttest : tcbmttest.o $(LIBRARYFILES) ++tcbmttest.exe : tcbmttest.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tcbmgr : tcbmgr.o $(LIBRARYFILES) ++tcbmgr.exe : tcbmgr.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tcatest : tcatest.o $(LIBRARYFILES) ++tcatest.exe : tcatest.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + + +-tcamgr : tcamgr.o $(LIBRARYFILES) ++tcamgr.exe : tcamgr.o $(LIBRARYFILES) + $(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -ltokyocabinet $(LIBS) + +