From: Eric Bollengier Date: Fri, 4 Mar 2022 20:35:22 +0000 (+0100) Subject: fix windows compilation X-Git-Tag: Release-11.3.2~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=881a8c8dd5db6fea435cfe958b380e70da4005fa;p=thirdparty%2Fbacula.git fix windows compilation --- diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index 44608036e..9aaed0eae 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -585,10 +585,7 @@ void t_msg(const char *file, int line, int64_t level, const char *fmt,...); /* #define strncpy bad_call_on_strncpy_use_bstrncpy */ /** Use our strdup with smartalloc */ -#ifndef HAVE_WXCONSOLE -#undef strdup -#define strdup(buf) bad_call_on_strdup_use_bstrdup(buf) -#else +#ifdef HAVE_WXCONSOLE /* Groan, WxWidgets has its own way of doing NLS so cleanup */ #ifndef ENABLE_NLS #undef _ diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index 93c9a44da..1bbbf2142 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -42,10 +42,10 @@ distclean: clean clean: $(DIRS) win32_installer win64_installer $(MAKE) -C tools clean $(ECHO_CMD)-rm -rf release32 release64 - $(ECHO_CMD)-rm -rf ../qt-console/obj32 ../qt-console/obj64 - $(ECHO_CMD)-rm -f ../qt-console/release/bat.exe ../qt-console/debug/bat.exe - $(ECHO_CMD)-rm -rf ../qt-console/tray-monitor/obj32 ../qt-console/tray-monitor/obj64 - $(ECHO_CMD)-rm -f ../qt-console/tray-monitor/release/bacula-tray-monitor.exe ../qt-console/tray-monitor/debug/bacula-tray-monitor.exe + $(ECHO_CMD)-rm -rf ../qt-console/obj32 ../qt-console/obj64 ../qt-console/ui32 ../qt-console/ui64 + $(ECHO_CMD)-rm -rf ../qt-console/release ../qt-console/debug + $(ECHO_CMD)-rm -rf ../qt-console/tray-monitor/obj32 ../qt-console/tray-monitor/obj64 ../qt-console/tray-monitor/ui32 ../qt-console/tray-monitor/ui64 + $(ECHO_CMD)-rm -rf ../qt-console/tray-monitor/release ../qt-console/tray-monitor/debug is_depkgs_set: @if test -z $${DEPKGS} ; then \ @@ -60,7 +60,7 @@ release32/bat.exe: is_depkgs_set test -f release32/bacula-tray-monitor.exe ./sign-binaries release32/bat.exe release32/bacula-tray-monitor.exe release32/Qt*dll release32/q*.dll -bat32: release32/bat.exe +bat32: release32/bat.exe release32/bacula-tray-monitor.exe release64/bat.exe: is_depkgs_set ( cd ../qt-console; ./make-win32 "64" ) @@ -68,7 +68,7 @@ release64/bat.exe: is_depkgs_set test -f release64/bacula-tray-monitor.exe ./sign-binaries release64/bat.exe release64/bacula-tray-monitor.exe release64/Qt*dll release64/q*.dll -bat64: release64/bat.exe +bat64: release64/bat.exe release64/bacula-tray-monitor.exe # a target that quickly build windows bacula-fd.exe winfiled: @@ -186,3 +186,4 @@ Makefile.inc: -e "s^@WIN32BINDIR@^$${BINDIR}^" \ -e "s^@WIN32INCDIR@^$${INCDIR}^" \ -e "s^@WIN32DLLDIR@^$${DLLDIR}^" < Makefile.inc.in > $@ + @grep EXTRA ../../autoconf/Make.common >> $@ diff --git a/bacula/src/win32/compat/mingwconfig.h b/bacula/src/win32/compat/mingwconfig.h index cfa5bbda8..02444294c 100644 --- a/bacula/src/win32/compat/mingwconfig.h +++ b/bacula/src/win32/compat/mingwconfig.h @@ -37,7 +37,7 @@ #define USE_LOCKMGR /* Define if you want SmartAlloc debug code enabled */ -#define SMARTALLOC 1 +#define SMARTALLOC SMARTALLOC /* Use EmptyWorkSet as malloc_trim emulation */ #define HAVE_MALLOC_TRIM 1 diff --git a/bacula/src/win32/filed/plugins/Makefile b/bacula/src/win32/filed/plugins/Makefile index c99339187..54c80d349 100644 --- a/bacula/src/win32/filed/plugins/Makefile +++ b/bacula/src/win32/filed/plugins/Makefile @@ -106,21 +106,12 @@ $(BINDIR)/cdp-fd.dll: $(CDP_OBJS) $(LIBS_BACULA) $(BINDIR)/exchange-fd.dll: DLL_DEFINE=BUILDING_DLL -$(BINDIR)/exchange-fd.dll: $(EXCHANGE_OBJS) exchange-fd.def +$(BINDIR)/exchange-fd.dll: $(EXCHANGE_OBJS) exchange-fd.def $(LIBS_BACULA) @echo "Linking $@" $(call checkdir,$@) - $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/exchange-fd.a $^ $(LIBS_DLL) -o $@ + $(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/exchange-fd.a $^ $(LIBS_DLL) -o $@ $(BUILDDIR)/sign-binaries $@ -$(BINDIR)/cdp-fd.dll: DLL_DEFINE=BUILDING_DLL - -$(BINDIR)/cdp-fd.dll: $(CDP_OBJS) $(LIBS_BACULA) - @echo "Linking $@" - $(call checkdir,$@) - $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/cdp-fd.a $^ $(LIBS_DLL) -o $@ - $(BUILDDIR)/sign-binaries $@ - - $(BINDIR)/bpipe-fd.dll: DLL_DEFINE=BUILDING_DLL $(BINDIR)/bpipe-fd.dll: $(BPIPE_OBJS) bpipe-fd.def $(LIBS_BACULA) diff --git a/bacula/src/win32/filed/plugins/exchange-fd.h b/bacula/src/win32/filed/plugins/exchange-fd.h index 4d816e592..c2ac6b512 100644 --- a/bacula/src/win32/filed/plugins/exchange-fd.h +++ b/bacula/src/win32/filed/plugins/exchange-fd.h @@ -33,40 +33,6 @@ # define DLL_IMP_EXP #endif -#if defined(HAVE_WIN32) -#if defined(HAVE_MINGW) -#include "winhdrs.h" -#else -#include "winconfig.h" -#endif -#else -#include "config.h" -#endif -#define __CONFIG_H - -enum { - /* Keep M_ABORT=1 for dlist.h */ - M_ABORT = 1, /* MUST abort immediately */ - M_DEBUG, /* debug message */ - M_FATAL, /* Fatal error, stopping job */ - M_ERROR, /* Error, but recoverable */ - M_WARNING, /* Warning message */ - M_INFO, /* Informational message */ - M_SAVED, /* Info on saved file */ - M_NOTSAVED, /* Info on notsaved file */ - M_SKIPPED, /* File skipped during backup by option setting */ - M_MOUNT, /* Mount requests */ - M_ERROR_TERM, /* Error termination request (no dump) */ - M_TERM, /* Terminating daemon normally */ - M_RESTORED, /* ls -l of restored files */ - M_SECURITY, /* security violation */ - M_ALERT, /* tape alert messages */ - M_VOLMGMT /* Volume management messages */ -}; - -#define FT_REG 3 -#define FT_DIREND 5 - #define _REENTRANT 1 #define _THREAD_SAFE 1 #define _POSIX_PTHREAD_SEMANTICS 1 @@ -81,14 +47,10 @@ enum { #include #endif -//#include "bacula.h" +#include "bacula.h" #include "compat.h" #include "bc_types.h" -typedef int64_t boffset_t; -//#define bstrdup(str) strcpy((char *)bmalloc(strlen((str))+1),(str)) -#define bstrdup(str) strdup(str) - #include "fd_plugins.h" #include "exch_api.h"