]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/win32/build-depkgs-mingw-w64
Fix class member shadowing.
[bacula/bacula] / bacula / src / win32 / build-depkgs-mingw-w64
index 998c28d01793cf2b2ac9fb7ceb5862400b531fef..2c965e4a72a71efe115914977af6bdae512f8ffb 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/sh
 #
+#  This file may help you build the dependency packages that
+#  are needed to cross compile the Win64 bit version of the Bacula
+#  File daemon.  This file is provided as is, and we don't guarantee
+#  that it will work. We run it only on Ubuntu Hardy.  Trying to use
+#  it on any other GNU/Linux distro will probably require changes.
+#
 #  This file is driven by the parameters that are defined in
 #    the file External-mingw-w64
 #
@@ -36,13 +42,14 @@ SCRIPT_DIR=`pwd`
 
 cd ../../..
 TOP_DIR=`pwd`
+TOP_DIR=${DEPKGS:-${TOP_DIR}}
 
 if [ -e ${TOP_DIR}/cross-tools/mingw-w64/bin/x86_64-pc-mingw32-gcc ]
 then
    cd ${TOP_DIR}/cross-tools/mingw-w64/bin
    BIN_DIR=`pwd`
 else
-   echo "The GCC cross compiler isn\'t installed."
+   echo "The GCC cross compiler is not installed."
    echo "You must run build-win64-cross-tools first"
    exit 1
 fi
@@ -158,6 +165,15 @@ do_make()
    fi | tee -a make.log | parse_output
 }
 
+process_rsync()
+{
+   get_source "${URL_RSYNC}" "${DIR_RSYNC}" "${MKD_RSYNC}"
+   ./configure --host=x86_64-pc-mingw32
+   make -k # rdiff.exe has a problem
+   cp .libs/librsync.a ${DEPPKG_DIR}/lib
+   cp librsync*h ${DEPPKG_DIR}/include
+}
+
 process_zlib()
 {
    if get_source "${URL_ZLIB}" "${DIR_ZLIB}" "${MKD_ZLIB}"
@@ -215,7 +231,7 @@ process_pthreads()
    then
            echo Patching pthreads
            >patch.log
-           do_patch pthreads-w64+bacula.patch
+           do_patch pthreads-w64.patch
    fi
    echo Building pthreads
    > make.log
@@ -236,6 +252,11 @@ process_openssl()
            >patch.log
            do_patch openssl-w64.patch
            echo Configuring openssl
+           echo ./Configure --prefix=${DEPPKG_DIR} \
+                       shared zlib-dynamic no-dso no-hw \
+                       threads \
+                       --with-zlib-include=${DEPPKG_DIR}/include \
+                       mingw64
            ./Configure --prefix=${DEPPKG_DIR} \
                        shared zlib-dynamic no-dso no-hw \
                        threads \
@@ -246,16 +267,26 @@ process_openssl()
    perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def
    perl util/mkdef.pl 32 ssleay >ms/ssleay32.def
    perl util/mkdef.pl crypto ssl NT update
-   CFLAG=-I${DEPPKG_DIR}/include do_make Makefile all
+   sed -i 's/CC=/CC=mingw32-gcc #/' crypto/comp/Makefile
+   sed -i 's/AR=/AR=mingw32-ar r #/'  crypto/comp/Makefile
+   sed -i "s:^CFLAGS=:CFLAGS= -I${DEPPKG_DIR}/include:" crypto/comp/Makefile
+
+   do_make Makefile all
+   cd engines
+   touch lib4758cca.bad libaep.bad libatalla.bad libcswift.bad libchil.bad libgmp.bad libnuron.bad libsureware.bad libubsec.bad libcapi.bad
+   cd ..
+   do_make Makefile all
    echo Installing openssl
-   do_make Makefile install_sw
+   do_make Makefile install_sw install
+   cp *.dll ${DEPPKG_DIR}/bin
 }
 
 if [ "$#" -eq 0 ]
 then
-#   process_zlib
-#   process_pcre
-#   process_pthreads
+   process_zlib
+   process_rsync
+   process_pcre
+   process_pthreads
    process_openssl
 else
    for dependency in "$@"