]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl update makefiles to support win64 build
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 25 Mar 2009 14:03:01 +0000 (14:03 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 25 Mar 2009 14:03:01 +0000 (14:03 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8598 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/win32/Makefile
bacula/src/win32/Makefile.inc.in
bacula/src/win32/README.mingw32
bacula/src/win32/lib/Makefile
bacula/src/win32/libwin32/bacula.rc

index 2b83bdc02b981c3ddf9ddac1745dedf64c42b0ae..c0049f9bae86db33eb005b2fea8d88fcca34f767 100644 (file)
@@ -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}^" \
index a174a4a8d6c0395f3c1ef12abd694f976a92d6f4..b335ca7ecd6b28fa148a13139dd413f732402abd 100644 (file)
@@ -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 \
index d43c87a9ab9279786aefade484842bc13b4ef60e..9e4aba984405041f9771c04a95ad5c713c2c3a08 100644 (file)
@@ -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 <symbol> 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
 
index 7ab1036799a3b4164da0ba33453037988a07fe25..0504d82fa2fcefcc751ae748e5a6057125c02e5b 100644 (file)
@@ -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
 
index af458961fec64e507fca59b51ede2ecb869a6efd..6befbe5511da15885b00b6c8c1fcb9e4dd279f35 100644 (file)
@@ -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