]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
fix windows compilation
authorEric Bollengier <eric@baculasystems.com>
Fri, 4 Mar 2022 20:35:22 +0000 (21:35 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:27 +0000 (09:03 +0100)
bacula/src/baconfig.h
bacula/src/win32/Makefile
bacula/src/win32/compat/mingwconfig.h
bacula/src/win32/filed/plugins/Makefile
bacula/src/win32/filed/plugins/exchange-fd.h

index 44608036e51fd9a49f892e7c0aa96ed16a6f7cd3..9aaed0eae47c2175bfa919f8dd0f64e18365fe6e 100644 (file)
@@ -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 _
index 93c9a44da114d160d82d565154523b46741ba774..1bbbf21422c53d5c4eb63ff8dcf0d60f11d8c70b 100644 (file)
@@ -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 >> $@
index cfa5bbda8237b4c784baaa5d9441778d82284d95..02444294c84ddfb8e3fcfeb4069a6d4a6e00ac4b 100644 (file)
@@ -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
index c99339187a204a664c76ae6654e28f16711bd7ec..54c80d3490da8959eb200c869288357c29b8c363 100644 (file)
@@ -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)
index 4d816e592f304335c405086b9fc7c484f73fb599..c2ac6b5122e273e3f68810843b97f2e9be050b13 100644 (file)
 #  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 <sys/bitypes.h>
 #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"