From 1944a53b146b05be747c89b7934615ce5ba4bfc4 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 25 Mar 2009 14:03:01 +0000 Subject: [PATCH] ebl update makefiles to support win64 build git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8598 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/Makefile | 29 ++++++++++++++++++++++------- bacula/src/win32/Makefile.inc.in | 23 ++++++++++++++++------- bacula/src/win32/README.mingw32 | 8 ++++---- bacula/src/win32/lib/Makefile | 6 +++--- bacula/src/win32/libwin32/bacula.rc | 10 +++++++++- 5 files changed, 54 insertions(+), 22 deletions(-) diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index 2b83bdc02b..c0049f9bae 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -1,6 +1,12 @@ ECHO_CMD=@ -DIRS= lib \ +ifeq ($(WIN64),yes) + DIRS= lib \ + filed \ + filed/plugins \ + scripts +else + DIRS= lib \ cats \ filed \ filed/plugins \ @@ -9,12 +15,14 @@ DIRS= lib \ console \ wx-console \ tools \ - scripts + scripts +endif .PHONY: $(DIRS) clean all Makefile.inc installer newinstaller all: Makefile.inc $(DIRS) installer newinstaller + clean: $(DIRS) installer newinstaller $(ECHO_CMD)-rm -rf release @@ -48,14 +56,18 @@ $(DIRS): Makefile.inc: @echo Creating $@ $(ECHO_CMD)TOPDIR=`(cd ../../..;pwd)`; \ - if test -e ../../../cross-tools/mingw32/bin/mingw32-gcc; then \ + if test "$(WIN64)" = yes -a -e ../../../cross-tools/mingw-w64/bin/x86_64-pc-mingw32-gcc; then \ + BINDIR=$${TOPDIR}/cross-tools/mingw-w64/bin; \ + INCDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/include; \ + DLLDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/bin; \ + DEPKGSDIR=depkgs-mingw-w64; \ + DEPKGSDIR32=depkgs-mingw32; \ + elif test -e ../../../cross-tools/mingw32/bin/mingw32-gcc; then \ BINDIR=$${TOPDIR}/cross-tools/mingw32/bin; \ INCDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/include; \ DLLDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/bin; \ - elif test -e /mingw/bin/mingw32-gcc; then \ - BINDIR=/mingw/bin; \ - INCDIR=/mingw/include; \ - DLLDIR=/mingw/bin; \ + DEPKGSDIR=depkgs-mingw32; \ + DEPKGSDIR32=depkgs-mingw32; \ else \ echo "\nThe GCC cross compiler isn't installed."; \ echo "You must run build-win32-cross-tools and build-dependencies first.\n"; \ @@ -64,6 +76,9 @@ Makefile.inc: BUILDDIR=`(pwd)`; \ MAINDIR=`(cd ../..;pwd)`; \ sed \ + -e "s^@WIN64@^$${WIN64}^" \ + -e "s^@WIN32DEPKGS@^$${DEPKGSDIR}^" \ + -e "s^@WIN32DEPKGS32@^$${DEPKGSDIR32}^" \ -e "s^@WIN32BUILDDIR@^$${BUILDDIR}^" \ -e "s^@WIN32MAINDIR@^$${MAINDIR}^" \ -e "s^@WIN32TOPDIR@^$${TOPDIR}^" \ diff --git a/bacula/src/win32/Makefile.inc.in b/bacula/src/win32/Makefile.inc.in index a174a4a8d6..b335ca7ecd 100644 --- a/bacula/src/win32/Makefile.inc.in +++ b/bacula/src/win32/Makefile.inc.in @@ -21,7 +21,8 @@ BUILDDIR := @WIN32BUILDDIR@ TOPDIR := @WIN32TOPDIR@ # # where we find depkgs -DEPKGS := $(TOPDIR)/depkgs-mingw32 +DEPKGS := $(TOPDIR)/@WIN32DEPKGS@ +DEPKGS32 := $(TOPDIR)/@WIN32DEPKGS32@ DOCDIR := $(TOPDIR)/docs BINDIR := $(BUILDDIR)/release @@ -37,12 +38,22 @@ CXX = $(MINGW_BIN)/mingw32-g++ $(DEFINES) $(INCLUDES) AR := $(MINGW_BIN)/mingw32-ar RANLIB := $(MINGW_BIN)/mingw32-ranlib WINDRES := $(MINGW_BIN)/mingw32-windres -DLLTOOL := $(MINGW_BIN)/../mingw32/bin/dlltool +DLLTOOL := $(MINGW_BIN)/mingw32-dlltool OBJCPY := $(MINGW_BIN)/mingw32-objcopy -NSIS_DIR := $(DEPKGS)/nsis -STAB2CV := $(DEPKGS)/tools/bin/stab2cv +NSIS_DIR := $(DEPKGS32)/nsis +STAB2CV := $(DEPKGS32)/tools/bin/stab2cv +WIN64=@WIN64@ + +ifeq ($(WIN64),yes) + CFLAGS := -g -Wall -mno-cygwin -mthreads -O3 -fno-strict-aliasing -DHAVE_VSS64 + LIBS_NETWORK := -lws2_32 + WIN_VERSION := 64 +else + CFLAGS := -g -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing + LIBS_NETWORK := -lwsock32 + WIN_VERSION := 32 +endif -CFLAGS := -g -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing LDFLAGS := -g -Wall -mno-cygwin -Wl,--disable-auto-import INCLUDE_DDK := -I$(MINGW_INCLUDE)/ddk @@ -89,8 +100,6 @@ LIBS_CATS := \ LIBS_BACULA := \ $(LIBDIR)/libbacula.a -LIBS_NETWORK := -lwsock32 - HAVES := \ -DHAVE_WIN32 \ -DHAVE_MINGW \ diff --git a/bacula/src/win32/README.mingw32 b/bacula/src/win32/README.mingw32 index d43c87a9ab..9e4aba9844 100644 --- a/bacula/src/win32/README.mingw32 +++ b/bacula/src/win32/README.mingw32 @@ -224,7 +224,7 @@ simply do the following: cd .../bacula/src/win32/lib make (to build the .o files, note the link will fail) - ./make_def >bacula.def + ./make_def >bacula32.def # or >bacula64.def This should rebuild the bacula.def file, but it uses relative paths and assumes you have the directory structure noted above. If you @@ -232,7 +232,7 @@ are using something different, you can set the NM variable at the top of the make_def file to use an absolute path to the correct directory. -===== manual changing of bacula.def no longer necessary ===== +===== manual changing of bacula32.def or bacula64.def no longer necessary ===== If you want to do it manually, please see below: Exporting a function requires a bit more work. You must determine the C++ mangled name of the new function. @@ -249,8 +249,8 @@ which contains the new function. Replace with the name of the new function. Remove the leading underscore and place the result in the file - .../bacula/src/win32/lib/bacula.def -=== end manual changing of bacula.def ========== + .../bacula/src/win32/lib/bacula32.def +=== end manual changing of bacula32.def or bacula64.def ========== If you add a new file, you will need to specify its name in diff --git a/bacula/src/win32/lib/Makefile b/bacula/src/win32/lib/Makefile index 7ab1036799..0504d82fa2 100644 --- a/bacula/src/win32/lib/Makefile +++ b/bacula/src/win32/lib/Makefile @@ -126,7 +126,7 @@ clean: @echo "Cleaning `pwd`" $(call clean_obj,$(ALL_OBJS)) $(call clean_exe,$(BINDIR)/bacula.dll) - $(ECHO_CMD)rm -f $(OBJDIR)/bacula.a $(LIBDIR)/libbacula.a + $(ECHO_CMD)rm -f $(OBJDIR)/bacula.a $(LIBDIR)/libbacula.a bacula.def # # Rules for generating from ../lib @@ -147,8 +147,8 @@ $(BINDIR)/bacula.dll: $(DLL_OBJS) bacula.def $(call checkdir,$@) $(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/bacula.a $^ $(LIBS_DLL) -o $@ -bacula.def: bacula32.def - $(ECHO_CMD)cp bacula32.def bacula.def +bacula.def: bacula$(WIN_VERSION).def + $(ECHO_CMD)cp bacula$(WIN_VERSION).def bacula.def include ../Makefile.rules diff --git a/bacula/src/win32/libwin32/bacula.rc b/bacula/src/win32/libwin32/bacula.rc index af458961fe..6befbe5511 100644 --- a/bacula/src/win32/libwin32/bacula.rc +++ b/bacula/src/win32/libwin32/bacula.rc @@ -104,14 +104,18 @@ END * About Dialog */ IDD_ABOUT DIALOG 0, 0, 250, 145 +#ifndef MINGW64 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +#endif CAPTION "About Bacula" FONT 8, "MS Sans Serif" BEGIN +#ifndef MINGW64 DEFPUSHBUTTON "OK",IDOK,190,120,50,15 +#endif // CONTROL "\3", IDC_BACULABMP,"Static",SS_ICON | SS_CENTERIMAGE | // SS_SUNKEN,7,5,73,65 -#ifndef HAVE_MINGW +#if !defined(HAVE_MINGW) && !defined(MINGW64) CONTROL IDB_BACULABMP,IDB_BACULABMP,"Static",SS_BITMAP|SS_SUNKEN,7,5,32,32 #endif @@ -132,10 +136,14 @@ END * Status Dialog */ IDD_STATUS DIALOGEX 0, 0, 411, 244 +#ifndef MINGW64 STYLE DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +#endif CAPTION "Bacula Status" FONT 8, "Courier New" BEGIN +#ifndef MINGW64 DEFPUSHBUTTON "&OK",IDOK,355,5,51,15 EDITTEXT IDC_TEXTDISPLAY, 2, 2, 350, 240, WS_VSCROLL | WS_HSCROLL | WS_BORDER | ES_READONLY | ES_MULTILINE +#endif END -- 2.39.5