From f30f5f3dcf16def6b12591fd6b3837da8c9d38b9 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Sat, 1 Jul 2006 14:58:41 +0000 Subject: [PATCH] Create patches subdirectory. Move mingw-utils.patch into patches. Add dependency patches and build script. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3109 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/build-dependencies | 361 ++++++++++++++++++ bacula/src/win32/build-win32-cross-tools | 2 +- .../src/win32/{ => patches}/mingw-utils.patch | 0 bacula/src/win32/patches/nsis.patch | 296 ++++++++++++++ bacula/src/win32/patches/openssl.patch | 297 ++++++++++++++ bacula/src/win32/patches/pcre.patch | 130 +++++++ bacula/src/win32/patches/postgresql.patch | 123 ++++++ bacula/src/win32/patches/pthreads.patch | 69 ++++ bacula/src/win32/patches/sqlite.patch | 180 +++++++++ bacula/src/win32/patches/wx.patch | 37 ++ bacula/src/win32/patches/wx.sed | 9 + bacula/src/win32/patches/zlib.patch | 150 ++++++++ 12 files changed, 1653 insertions(+), 1 deletion(-) create mode 100755 bacula/src/win32/build-dependencies rename bacula/src/win32/{ => patches}/mingw-utils.patch (100%) create mode 100644 bacula/src/win32/patches/nsis.patch create mode 100644 bacula/src/win32/patches/openssl.patch create mode 100644 bacula/src/win32/patches/pcre.patch create mode 100644 bacula/src/win32/patches/postgresql.patch create mode 100644 bacula/src/win32/patches/pthreads.patch create mode 100644 bacula/src/win32/patches/sqlite.patch create mode 100644 bacula/src/win32/patches/wx.patch create mode 100644 bacula/src/win32/patches/wx.sed create mode 100644 bacula/src/win32/patches/zlib.patch diff --git a/bacula/src/win32/build-dependencies b/bacula/src/win32/build-dependencies new file mode 100755 index 0000000000..1b053b5359 --- /dev/null +++ b/bacula/src/win32/build-dependencies @@ -0,0 +1,361 @@ +VERBOSE=n +OVERWRITE=n + +URL_ZLIB=http://www.zlib.net/zlib-1.2.3.tar.gz +#URL_ZLIB=http://superb-west.dl.sourceforge.net/sourceforge/libpng/zlib-1.2.3.tar.gz +DIR_ZLIB= +URL_PCRE=http://superb-west.dl.sourceforge.net/sourceforge/pcre/pcre-6.3.tar.bz2 +DIR_PCRE= +URL_PTHREADS=ftp://sources.redhat.com/pub/pthreads-win32/pthreads-snap-2004-06-22.tar.gz +DIR_PTHREADS= +URL_OPENSSL=http://www.openssl.org/source/openssl-0.9.8b.tar.gz +DIR_OPENSSL= +URL_MYSQL=http://mirror.x10.com/mirror/mysql/Downloads/MySQL-5.0/mysql-noinstall-5.0.22-win32.zip +DIR_MYSQL=mysql-5.0.22-win32 +URL_POSTGRESQL=ftp://ftp2.us.postgresql.org/postgresql/source/v8.1.4/postgresql-base-8.1.4.tar.bz2 +DIR_POSTGRESQL=postgresql-8.1.4 +URL_SQLITE=http://www.sqlite.org/sqlite-3.3.6.tar.gz +DIR_SQLITE= +URL_WX=http://superb-west.dl.sourceforge.net/sourceforge/wxwindows/wxWidgets-2.6.3.tar.gz +DIR_WX= +URL_SCONS=http://superb-west.dl.sourceforge.net/sourceforge/scons/scons-0.96.92.tar.gz +DIR_SCONS= +URL_NSIS_BIN=http://superb-west.dl.sourceforge.net/sourceforge/nsis/nsis-2.17.zip +DIR_NSIS_BIN= +URL_NSIS_SRC=http://superb-west.dl.sourceforge.net/sourceforge/nsis/nsis-2.17-src.tar.bz2 +DIR_NSIS_SRC= + +cwd=`pwd` +cd `dirname $0` +SCRIPT_DIR=`pwd` + +cd ../../.. +TOP_DIR=`pwd` + +if [ ! -e ${TOP_DIR}/cross-tools/mingw32/bin/mingw32-gcc ] +then + echo The GCC cross compiler isn\'t installed. + echo You must run build-win32-cross-tools first + exit 1 +fi + +cd ${TOP_DIR}/cross-tools/mingw32/bin +BIN_DIR=`pwd` + +[ ! -e ${TOP_DIR}/depkgs-mingw32 ] && mkdir ${TOP_DIR}/depkgs-mingw32 +cd ${TOP_DIR}/depkgs-mingw32 +DEPPKG_DIR=`pwd` +cd ${DEPPKG_DIR} + +case "${VERBOSE}" in +y*|t*) VERBOSE=true ;; +n*|f*) VERBOSE=false ;; +*) VERBOSE=false ;; +esac + +case ${OVERWRITE} in +y*|t*) OVERWRITE=true ;; +n*|f*) OVERWRITE=false ;; +*) OVERWRITE=true ;; +esac + +export PATH=${BIN_DIR}:${PATH} + +[ ! -e bin ] && mkdir bin +[ ! -e src ] && mkdir src +[ ! -e include ] && mkdir include +[ ! -e lib ] && mkdir lib + +get_source() +{ + URL=$1 + SRC_DIR=$2 + ARCHIVE=`basename ${URL}` + + case ${ARCHIVE} in + *.tar.gz) ARCHIVER="tar xzf"; [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.gz'`;; + *.tar.bz2) ARCHIVER="tar xjf"; [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.bz2'`;; + *.zip) ARCHIVER="unzip -q"; [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;; + *) echo Unsupported archive type - $ARCHIVE; exit 1;; + esac + + cd ${DEPPKG_DIR}/src + + if [ ! -e "${ARCHIVE}" ] + then + echo Downloading "${URL}" + if wget --passive-ftp "${URL}" + then + : + else + echo Unable to download ${ARCHIVE} + exit 1 + fi + fi + + if [ ! -e "${SRC_DIR}" -o "${OVERWRITE}" = "true" ] + then + rm -rf ${SRC_DIR} + echo Extracting ${ARCHIVE} + ${ARCHIVER} ${ARCHIVE} &> ${ARCHIVE}.log + cd ${SRC_DIR} + return 0 + fi + + cd ${SRC_DIR} + return 1 +} + +parse_output() +{ + if [ "${VERBOSE}" = "true" ] + then + cat + else + sed -ne '/\\$/N' -e 's/\\\n//' -e 's/\t\+/ /g' -e 's/ \+/ /g' \ + -e '/ error: /p' \ + -e "s%.*Entering directory[ ]\\+.${DEPPKG_DIR}/\\([^ ]\+\).%Entering \\1%p" \ + -e "s%.*Leaving directory[ ]\\+.${DEPPKG_DIR}/\\([^ ]\+.\).%Leaving \\1%p" \ + -e '/gcc \|g\+\+ \|ar /!d' \ + -e 's/ \(\.\.\/\)\+/ /g' \ + -e 's/.* \([^ ]\+\(\.c\|\.cpp\|\.cc\|\.cxx\)\)\( .*\|\)$/Compiling \1/p' \ + -e 's/.* \([^ ]\+\.s\)\( .*\|\)$/Assembling \1/p' \ + -e 's/.*ar [^ ]\+ \([^ ]\+\)\(\( [^ ]\+\.o\)\+\)/Updating \1 -\2/p' \ + -e 's/.* -o \([^ ]\+\)\( .*\|\)$/Linking \1/p' + fi +} + +do_patch() +{ + PATCH_FILE=${SCRIPT_DIR}/patches/$1; shift + + if patch -f -p0 "$@" >patch.log < ${PATCH_FILE} + then + : + else + echo Patch failed - Check `pwd`/patch.log > /dev/tty + exit 1 + fi +} + +do_make() +{ + if make -f "$@" 2>&1 + then + : + else + echo Make failed - Check `pwd`/make.log > /dev/tty + exit 1 + fi | tee -a make.log | parse_output +} + +process_zlib() +{ + if get_source "${URL_ZLIB}" "${DIR_ZLIB}" + then + echo Patching zlib + do_patch zlib.patch + fi + echo Building zlib + > make.log + do_make win32/Makefile.mingw32 PREFIX=${DEPPKG_DIR} all + echo Installing zlib + do_make win32/Makefile.mingw32 PREFIX=${DEPPKG_DIR} install +} + +process_pcre() +{ + if get_source "${URL_PCRE}" "${DIR_PCRE}" + then + echo Patching PCRE + do_patch pcre.patch + fi + echo Configuring PCRE + ./configure CC_FOR_BUILD=gcc CXX_FOR_BUILD=g++ --host=mingw32 --prefix=${DEPPKG_DIR} --enable-utf8 --enable-unicode-properties &>make.log + echo Building PCRE + do_make Makefile PREFIX=${DEPPKG_DIR} all + echo Installing PCRE + do_make Makefile PREFIX=${DEPPKG_DIR} install +} + +process_pthreads() +{ + if get_source "${URL_PTHREADS}" "${DIR_PTHREADS}" + then + echo Patching pthreads + do_patch pthreads.patch + fi + echo Building pthreads + > make.log + do_make GNUmakefile GCE + echo Installing pthreads + rm -rf ${DEPPKG_DIR}/include/pthreads + mkdir ${DEPPKG_DIR}/include/pthreads + cp -p *.h ${DEPPKG_DIR}/include/pthreads + cp -p *.dll ${DEPPKG_DIR}/bin + cp -p *.a ${DEPPKG_DIR}/lib +} + +process_openssl() +{ + if get_source "${URL_OPENSSL}" "${DIR_OPENSSL}" + then + echo Patching openssl + do_patch openssl.patch + fi + echo Configuring openssl + ./Configure --prefix=${DEPPKG_DIR} shared zlib-dynamic threads --with-zlib-include=${DEPPKG_DIR}/include mingw32 &> make.log + echo Building openssl + perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def + perl util/mkdef.pl 32 ssleay >ms/ssleay32.def + do_make Makefile all + echo Installing openssl + do_make Makefile install_sw +} + +process_mysql() +{ + get_source "${URL_MYSQL}" "${DIR_MYSQL}" + echo Converting mysql lib file + ${BIN_DIR}/../mingw32/bin/reimp --dlltool ${BIN_DIR}/mingw32-dlltool --as ${BIN_DIR}/mingw32-as lib/opt/libmysql.lib + echo Installing mysql + cp -p liblibmysql.a ../../lib/libmysql.a + rm -rf ../../include/mysql + mkdir ../../include/mysql + cp -p include/* ../../include/mysql 2>&1 | grep -v 'omitting directory' + cp -p lib/opt/libmysql.dll ../../bin +} + +process_postgreSQL() +{ + if get_source "${URL_POSTGRESQL}" "${DIR_POSTGRESQL}" + then + echo Patching postgreSQL + do_patch postgresql.patch + fi + echo Configuring postgreSQL + ./configure --host=mingw32 --enable-shared --enable-thread-safety --prefix=${DEPPKG_DIR} --with-includes=${DEPPKG_DIR}/include:${DEPPKG_DIR}/include/pthreads --with-libraries=${DEPPKG_DIR}/lib &> make.log + echo Building postgreSQL + if [ -e /usr/sbin/zic ]; then ZIC=/usr/sbin/zic + elif [ -e /sbin/zic ]; then ZIC=/sbin/zic + elif [ -e /usr/bin/zic ]; then ZIC=/usr/bin/zic + elif [ -e /bin/zic ]; then ZIC=/bin/zic + else ZIC=./zic + fi + do_make Makefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC} clean all + echo Installing postgreSQL + do_make Makefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC} install +} + +process_sqlite() +{ + if get_source "${URL_SQLITE}" "${DIR_SQLITE}" + then + echo Patching SQLite + do_patch sqlite.patch + fi + echo Configuring SQLite + [ ! -e bld ] && mkdir bld + cd bld + echo Building SQLite + > make.log + do_make ../Makefile.mingw32 CROSSTOOLS=${BIN_DIR} TLIBS="-L${DEPPKG_DIR}/lib" TCL_FLAGS="-I${DEPPKG_DIR}/include" clean all + echo Installing SQLite + cp -p sqlite3.exe ${DEPPKG_DIR}/bin + cp -p libsqlite3.a ${DEPPKG_DIR}/lib + cp -p sqlite3.h ${DEPPKG_DIR}/include +} + +process_wxWidgets() +{ + if get_source "${URL_WX}" "${DIR_WX}" + then + echo Patching wxWidgets + do_patch wx.patch -o build/msw/config.mingw32 + find . -name makefile.gcc -exec sh -c 'sed -f ${SCRIPT_DIR}/patches/wx.sed {} > `echo {} | sed s/\.gcc$/\.mingw32/`' \; + fi + echo Building wxWidgets + cd build/msw + > make.log + do_make makefile.mingw32 SHARED=1 VENDOR=bacula + echo Installing wxWidgets + cd ../.. + rm -rf ../../include/wx + mkdir ../../include/wx + cp -p include/wx/* ../../include/wx 2>&1 | grep -v 'omitting directory' + mkdir ../../include/wx/generic + cp -p include/wx/generic/* ../../include/wx/generic 2>&1 | grep -v 'omitting directory' + mkdir ../../include/wx/msw + cp -p include/wx/msw/* ../../include/wx/msw 2>&1 | grep -v 'omitting directory' + cp -p lib/gcc_dll/*.dll ../../bin + rm -rf ../../lib/wx_dll + mkdir ../../lib/wx_dll + cp -p lib/gcc_dll/*.a ../../lib/wx_dll + mkdir ../../lib/wx_dll/msw + cp -p lib/gcc_dll/msw/* ../../lib/wx_dll/msw 2>&1 | grep -v 'omitting directory' + mkdir ../../lib/wx_dll/msw/wx + cp -p lib/gcc_dll/msw/wx/* ../../lib/wx_dll/msw/wx 2>&1 | grep -v 'omitting directory' + mkdir ../../lib/wx_dll/msw/wx/msw + cp -p lib/gcc_dll/msw/wx/msw/* ../../lib/wx_dll/msw/wx/msw 2>&1 | grep -v 'omitting directory' +} + +process_scons() +{ + get_source "${URL_SCONS}" "${DIR_SCONS}" + echo Installing scons + if python setup.py install --prefix=${DEPPKG_DIR}/scons &> make.log + then + : + else + echo Make failed - Check `pwd`/make.log + exit 1 + fi +} + +process_nsis() +{ + get_source "${URL_NSIS_BIN}" "${DIR_NSIS_BIN}" + cd .. + rm -rf ../nsis + mv nsis-2.17 ../nsis + if get_source "${URL_NSIS_SRC}" "${DIR_NSIS_SRC}" + then + echo Patching nsis + do_patch nsis.patch + fi + echo Building nsis + if ../../scons/bin/scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all \ + PREFIX=${DEPPKG_DIR}/nsis PREFIX_BIN=${DEPPKG_DIR}/nsis/Bin \ + PREFIX_CONF=${DEPPKG_DIR}/nsis PREFIX_DATA=${DEPPKG_DIR}/nsis \ + PREFIX_DOC=${DEPPKG_DIR}/nsis/Docs 2>&1 | tee make.log | parse_output + then + : + else + echo Scons failed - Check `pwd`/make.log + exit 1 + fi + echo Installing nsis + cp -p build/release/makensis/makensis ../../nsis +} + +if [ "$#" -eq 0 ] +then + process_zlib + process_pcre + process_pthreads + process_openssl + process_mysql + process_sqlite + process_postgreSQL + process_wxWidgets + process_scons + process_nsis +else + for dependency in "$@" + do + eval "process_${dependency}" + done + +fi +#vss +#Need to download from Microsoft diff --git a/bacula/src/win32/build-win32-cross-tools b/bacula/src/win32/build-win32-cross-tools index bdb4a3d617..3f72bbddc2 100755 --- a/bacula/src/win32/build-win32-cross-tools +++ b/bacula/src/win32/build-win32-cross-tools @@ -419,7 +419,7 @@ function patch_mingw_utils MINGW_UTILS=`tar -tzf "$SRCDIR/$MINGW_UTILS_ARCHIVE" | head -n 1` cd "${SRCDIR}/${MINGW_UTILS}" echo "Patching mingw-utils" - patch -p0 < ${SCRIPTDIR}/mingw-utils.patch &> patch.log + patch -p0 < ${SCRIPTDIR}/patches/mingw-utils.patch &> patch.log cd "$BUILDDIR" } diff --git a/bacula/src/win32/mingw-utils.patch b/bacula/src/win32/patches/mingw-utils.patch similarity index 100% rename from bacula/src/win32/mingw-utils.patch rename to bacula/src/win32/patches/mingw-utils.patch diff --git a/bacula/src/win32/patches/nsis.patch b/bacula/src/win32/patches/nsis.patch new file mode 100644 index 0000000000..7037410c99 --- /dev/null +++ b/bacula/src/win32/patches/nsis.patch @@ -0,0 +1,296 @@ +Index: SCons/Config/gnu +--- ../nsis-2.17-src-rel/SCons/Config/gnu 2006-04-28 08:54:41.000000000 -0700 ++++ ./SCons/Config/gnu 2006-06-19 23:12:11.000000000 -0700 +@@ -65,7 +65,7 @@ + cross_env(stub_env) + + if not defenv['DEBUG']: +- stub_env.Append(CCFLAGS = '-Os') # optimize for size ++ stub_env.Append(CCFLAGS = '-Os -fno-strict-aliasing') # optimize for size + stub_env.Append(CCFLAGS = '-Wall') # all warnings + stub_env.Append(CCFLAGS = '-x c') # force compile as c + +@@ -82,7 +82,7 @@ + makensis_env = defenv.Copy() + + if not defenv['DEBUG']: +- makensis_env.Append(CCFLAGS = '-O2') # optimize ++ makensis_env.Append(CCFLAGS = '-O2 -fno-strict-aliasing') # optimize + makensis_env.Append(CCFLAGS = '-Wall') # all warnings + + conf = FlagsConfigure(makensis_env) +@@ -97,7 +97,7 @@ + cross_env(plugin_env) + + if not defenv['DEBUG']: +- plugin_env.Append(CCFLAGS = '-Os') # optimize for size ++ plugin_env.Append(CCFLAGS = '-Os -fno-strict-aliasing') # optimize for size + plugin_env.Append(CCFLAGS = '-Wall') # level 3 warnings + + if not defenv['DEBUG']: +@@ -111,7 +111,7 @@ + cp_util_env = defenv.Copy() + + if not defenv['DEBUG']: +- cp_util_env.Append(CCFLAGS = '-O2') # optimize ++ cp_util_env.Append(CCFLAGS = '-O2 -fno-strict-aliasing') # optimize + cp_util_env.Append(CCFLAGS = '-Wall') # all warnings + + conf = FlagsConfigure(cp_util_env) +Index: Source/DialogTemplate.cpp +--- ../nsis-2.17-src-rel/Source/DialogTemplate.cpp 2006-03-24 10:36:24.000000000 -0800 ++++ ./Source/DialogTemplate.cpp 2006-06-20 00:04:01.000000000 -0700 +@@ -93,7 +93,7 @@ + if (IS_INTRESOURCE(x)) { \ + *(WORD*)seeker = 0xFFFF; \ + seeker += sizeof(WORD); \ +- *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \ ++ *(WORD*)seeker = ConvertEndianness(WORD(ULONG_PTR(x))); \ + seeker += sizeof(WORD); \ + } \ + else { \ +@@ -629,7 +629,7 @@ + } + } + +- assert((DWORD) seeker - (DWORD) pbDlg == dwSize); ++ assert((ULONG_PTR) seeker - (ULONG_PTR) pbDlg == dwSize); + + // DONE! + return pbDlg; +Index: Source/Platform.h +--- ../nsis-2.17-src-rel/Source/Platform.h 2006-05-03 08:43:54.000000000 -0700 ++++ ./Source/Platform.h 2006-06-20 00:14:31.000000000 -0700 +@@ -16,15 +16,15 @@ + // basic types + typedef unsigned char BYTE, *PBYTE, *LPBYTE; + typedef unsigned short WORD, *LPWORD; +-typedef unsigned long DWORD, *LPDWORD; ++typedef unsigned int DWORD, *LPDWORD; + typedef short SHORT; + typedef unsigned short USHORT; + typedef unsigned int UINT; + typedef unsigned int UINT32; + typedef int INT; + typedef int INT32; +-typedef long LONG; +-typedef unsigned long ULONG; ++typedef int LONG; ++typedef unsigned int ULONG; + typedef long long INT64, LARGE_INTEGER; + typedef unsigned long long UINT64, ULARGE_INTEGER; + typedef int BOOL, *LPBOOL; +@@ -35,13 +35,14 @@ + typedef const char *LPCCH, *PCSTR, *LPCSTR; + typedef unsigned short WCHAR, *PWCHAR, *LPWCH, *PWCH, *NWPSTR, *LPWSTR, *PWSTR; + typedef const unsigned short *LPCWCH, *PCWCH, *LPCWSTR, *PCWSTR; +-typedef unsigned int UINT_PTR; ++typedef unsigned long UINT_PTR; ++typedef unsigned long ULONG_PTR; + // basic stuff + typedef void * HANDLE; +-typedef unsigned long HKEY; ++typedef unsigned int HKEY; + // some gdi +-typedef unsigned long COLORREF; +-typedef unsigned long HBRUSH; ++typedef unsigned int COLORREF; ++typedef unsigned int HBRUSH; + // bool + # define FALSE 0 + # define TRUE 1 +@@ -129,13 +130,13 @@ + + #ifndef _WIN32 + # ifndef FIELD_OFFSET +-# define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f)) ++# define FIELD_OFFSET(t,f) ((ULONG_PTR)&(((t*)0)->f)) + # endif + # ifndef MAKEINTRESOURCE + # define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i))) + # endif + # ifndef IMAGE_FIRST_SECTION +-# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \ ++# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (ULONG_PTR) h + \ + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \ + FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) ) + # endif +@@ -166,9 +167,9 @@ + # define FOF_NOERRORUI 0x0400 + #endif + +-#ifndef ULONG_PTR +-# define ULONG_PTR DWORD +-#endif ++//#ifndef ULONG_PTR ++//# define ULONG_PTR ULONG ++//#endif + + #ifndef IDC_HAND + # define IDC_HAND MAKEINTRESOURCE(32649) +Index: Source/ResourceEditor.cpp +--- ../nsis-2.17-src-rel/Source/ResourceEditor.cpp 2006-04-05 11:40:09.000000000 -0700 ++++ ./Source/ResourceEditor.cpp 2006-06-20 00:26:25.000000000 -0700 +@@ -545,7 +545,7 @@ + rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries); + + CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY)); +- crd->m_dwWrittenAt = DWORD(seeker); ++ crd->m_dwWrittenAt = ULONG_PTR(seeker); + seeker += sizeof(IMAGE_RESOURCE_DIRECTORY); + + for (int i = 0; i < crd->CountEntries(); i++) { +@@ -566,7 +566,7 @@ + rDirE.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0; + + CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY)); +- crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker); ++ crd->GetEntry(i)->m_dwWrittenAt = ULONG_PTR(seeker); + seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY); + } + qDirs.pop(); +@@ -582,7 +582,7 @@ + rDataE.Size = ConvertEndianness(cRDataE->GetSize()); + + CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY)); +- cRDataE->m_dwWrittenAt = DWORD(seeker); ++ cRDataE->m_dwWrittenAt = ULONG_PTR(seeker); + seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY); + + qDataEntries.pop(); +@@ -594,7 +594,7 @@ + while (!qStrings.empty()) { + CResourceDirectoryEntry* cRDirE = qStrings.front(); + +- PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec)); ++ PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->NameString.NameOffset = ConvertEndianness(DWORD(ULONG_PTR(seeker) - ULONG_PTR(pbRsrcSec))); + + char* szName = cRDirE->GetName(); + WORD iLen = strlen(szName) + 1; +@@ -626,7 +626,7 @@ + while (!qDataEntries2.empty()) { + CResourceDataEntry* cRDataE = qDataEntries2.front(); + CopyMemory(seeker, cRDataE->GetData(), cRDataE->GetSize()); +- PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(seeker - pbRsrcSec + m_dwResourceSectionVA); ++ PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(DWORD(seeker - pbRsrcSec + m_dwResourceSectionVA)); + + seeker += RALIGN(cRDataE->GetSize(), 8); + +@@ -636,7 +636,7 @@ + /* + * Set all of the directory entries offsets. + */ +- SetOffsets(m_cResDir, DWORD(pbRsrcSec)); ++ SetOffsets(m_cResDir, ULONG_PTR(pbRsrcSec)); + } + + // Sets the offsets in directory entries +@@ -650,7 +650,7 @@ + SetOffsets(resDir->GetEntry(i)->GetSubDirectory(), newResDirAt); + } + else { +- rde->OffsetToData = ConvertEndianness(resDir->GetEntry(i)->GetDataEntry()->m_dwWrittenAt - newResDirAt); ++ rde->OffsetToData = ConvertEndianness(DWORD(resDir->GetEntry(i)->GetDataEntry()->m_dwWrittenAt - newResDirAt)); + } + } + } +@@ -758,7 +758,7 @@ + // Returns -1 if can not be found + int CResourceDirectory::Find(char* szName) { + if (IS_INTRESOURCE(szName)) +- return Find((WORD) (DWORD) szName); ++ return Find((WORD) (ULONG_PTR) szName); + else + if (szName[0] == '#') + return Find(WORD(atoi(szName + 1))); +@@ -836,7 +836,7 @@ + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (ULONG_PTR) szName; + } + else { + m_bHasName = true; +@@ -851,7 +851,7 @@ + if (IS_INTRESOURCE(szName)) { + m_bHasName = false; + m_szName = 0; +- m_wId = (WORD) (DWORD) szName; ++ m_wId = (WORD) (ULONG_PTR) szName; + } + else { + m_bHasName = true; +Index: Source/ResourceEditor.h +--- ../nsis-2.17-src-rel/Source/ResourceEditor.h 2006-04-28 08:54:42.000000000 -0700 ++++ ./Source/ResourceEditor.h 2006-06-20 00:20:39.000000000 -0700 +@@ -173,7 +173,7 @@ + + void Destroy(); + +- DWORD m_dwWrittenAt; ++ ULONG_PTR m_dwWrittenAt; + + private: + IMAGE_RESOURCE_DIRECTORY m_rdDir; +@@ -197,7 +197,7 @@ + + CResourceDataEntry* GetDataEntry(); + +- DWORD m_dwWrittenAt; ++ ULONG_PTR m_dwWrittenAt; + + private: + bool m_bHasName; +@@ -226,7 +226,7 @@ + DWORD GetSize(); + DWORD GetCodePage(); + +- DWORD m_dwWrittenAt; ++ ULONG_PTR m_dwWrittenAt; + + private: + BYTE* m_pbData; +Index: Source/util.cpp +--- ../nsis-2.17-src-rel/Source/util.cpp 2006-04-28 08:54:42.000000000 -0700 ++++ ./Source/util.cpp 2006-06-20 00:41:16.000000000 -0700 +@@ -312,7 +312,7 @@ + FIX_ENDIAN_INT32_INPLACE(rdEntry.OffsetToData); + MY_ASSERT(!rdEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); + +- PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); ++ PRESOURCE_DIRECTORY rdIcons = PRESOURCE_DIRECTORY(rdEntry.DirectoryOffset.OffsetToDirectory + ULONG_PTR(rdRoot)); + + MY_ASSERT((size_t)rdIcons - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + +@@ -325,7 +325,7 @@ + FIX_ENDIAN_INT32_INPLACE(icoEntry.OffsetToData); + + MY_ASSERT(!icoEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); +- PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + DWORD(rdRoot)); ++ PRESOURCE_DIRECTORY rd = PRESOURCE_DIRECTORY(icoEntry.DirectoryOffset.OffsetToDirectory + ULONG_PTR(rdRoot)); + + MY_ASSERT((size_t)rd - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + +@@ -334,7 +334,7 @@ + + MY_ASSERT(datEntry.DirectoryOffset.DataIsDirectory, "bad resource directory"); + +- PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + DWORD(rdRoot)); ++ PIMAGE_RESOURCE_DATA_ENTRY rde = PIMAGE_RESOURCE_DATA_ENTRY(datEntry.OffsetToData + ULONG_PTR(rdRoot)); + + MY_ASSERT((size_t)rde - (size_t)exeHeader > exeHeaderSize, "corrupted EXE - invalid pointer"); + +@@ -355,10 +355,10 @@ + } + + // Set offset +- DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + DWORD(rdRoot) - dwResourceSectionVA - DWORD(exeHeader); ++ DWORD dwOffset = FIX_ENDIAN_INT32(rde->OffsetToData) + ULONG_PTR(rdRoot) - dwResourceSectionVA - ULONG_PTR(exeHeader); + *(LPDWORD) seeker = FIX_ENDIAN_INT32(dwOffset); + +- MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (DWORD)rdRoot - (DWORD)exeHeader, "invalid data offset - icon resource probably compressed"); ++ MY_ASSERT(dwOffset > exeHeaderSize || dwOffset < (ULONG_PTR)rdRoot - (ULONG_PTR)exeHeader, "invalid data offset - icon resource probably compressed"); + } + + LPBYTE seeker = uninstIconData; diff --git a/bacula/src/win32/patches/openssl.patch b/bacula/src/win32/patches/openssl.patch new file mode 100644 index 0000000000..1be8fe1927 --- /dev/null +++ b/bacula/src/win32/patches/openssl.patch @@ -0,0 +1,297 @@ +Index: Configure +--- ../tmp/openssl-0.9.8b/Configure 2006-04-03 02:15:40.000000000 -0700 ++++ ./Configure 2006-06-27 02:39:02.000000000 -0700 +@@ -132,7 +132,7 @@ + # seems to be sufficient? + my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT"; + +-#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags ++#config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $ar : $nm + + my %table=( + # File 'TABLE' (created by 'make TABLE') contains the data from this list, +@@ -468,6 +468,9 @@ + # Borland C++ 4.5 + "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", + ++# MinGW32 ++"mingw32", "mingw32-gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a:mingw32-ranlib::mingw32-ar:mingw32-nm", ++ + # MinGW + "mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall -D_WIN32_WINNT=0x333:::MINGW32:-lwsock32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_coff_asm}:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -shared:.dll.a", + +@@ -558,6 +561,8 @@ + my $idx_shared_extension = $idx++; + my $idx_ranlib = $idx++; + my $idx_arflags = $idx++; ++my $idx_ar= $idx++; ++my $idx_nm= $idx++; + + my $prefix=""; + my $openssldir=""; +@@ -920,7 +925,7 @@ + + $IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin"); + +-$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw"); ++$exe_ext=".exe" if ($target eq "Cygwin" || $target eq "DJGPP" || $target eq "mingw" || $target eq "mingw32"); + $exe_ext=".pm" if ($target =~ /vos/); + $openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq ""); + $prefix=$openssldir if $prefix eq ""; +@@ -964,6 +969,8 @@ + my $shared_extension = $fields[$idx_shared_extension]; + my $ranlib = $fields[$idx_ranlib]; + my $arflags = $fields[$idx_arflags]; ++my $ar = $fields[$idx_ar]; ++my $nm = $fields[$idx_nm]; + + my $no_shared_warn=0; + my $no_user_cflags=0; +@@ -1172,6 +1179,18 @@ + { + $ranlib = $default_ranlib; + } ++if ($arflags eq "") ++ { ++ $arflags = "r"; ++ } ++if ($ar eq "") ++ { ++ $ar = "ar"; ++ } ++if ($nm eq "") ++ { ++ $nm = "nm"; ++ } + + #my ($bn1)=split(/\s+/,$bn_obj); + #$bn1 = "" unless defined $bn1; +@@ -1307,6 +1326,8 @@ + s/^PROCESSOR=.*/PROCESSOR= $processor/; + s/^RANLIB=.*/RANLIB= $ranlib/; + s/^ARFLAGS=.*/ARFLAGS= $arflags/; ++ s/^AR=.*/AR= $ar/; ++ s/^NM=.*/NM= $nm/; + s/^PERL=.*/PERL= $perl/; + s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/; + s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/; +@@ -1358,6 +1379,8 @@ + print "PROCESSOR =$processor\n"; + print "RANLIB =$ranlib\n"; + print "ARFLAGS =$arflags\n"; ++print "AR =$ar\n"; ++print "NM =$nm\n"; + print "PERL =$perl\n"; + print "KRB5_INCLUDES =",$withargs{"krb5-include"},"\n" + if $withargs{"krb5-include"} ne ""; +@@ -1737,7 +1760,7 @@ + my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj, + my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj, + my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag, +- my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags)= ++ my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags, my $ar, my $nm)= + split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); + + print < lib$(LIBNAME).exp; \ ++ ${NM} -Pg $$SHOBJECTS | grep ' [BDT] ' | cut -f1 -d' ' > lib$(LIBNAME).exp; \ + LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \ + LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ + LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ +@@ -112,7 +113,20 @@ + ( $(SET_X); rm -f lib$(LIBNAME).exp ) + + SYMLINK_SO= \ +- if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \ ++ if [ -n "$$INHIBIT_SYMLINKS" ]; then \ ++ prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ ++ if [ -n "$$SHLIB_COMPAT" ]; then \ ++ for x in $$SHLIB_COMPAT; do \ ++ ( $(SET_X); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \ ++ ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \ ++ prev=$$SHLIB$$x$$SHLIB_SUFFIX; \ ++ done; \ ++ fi; \ ++ if [ -n "$$SHLIB_SOVER" ]; then \ ++ ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \ ++ cp -p $$prev $$SHLIB$$SHLIB_SUFFIX ); \ ++ fi; \ ++ else \ + prev=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ + if [ -n "$$SHLIB_COMPAT" ]; then \ + for x in $$SHLIB_COMPAT; do \ +@@ -249,6 +263,9 @@ + INHIBIT_SYMLINKS=yes; \ + SHLIB=cyg$(LIBNAME); \ + expr $(PLATFORM) : 'mingw' > /dev/null && SHLIB=$(LIBNAME)eay32; \ ++ if [ "$(PLATFORM)" = "mingw32" -a "$(LIBNAME)" = "crypto" ]; then \ ++ SHLIB=libeay32; \ ++ fi; \ + SHLIB_SUFFIX=.dll; \ + SHLIB_SOVER=-$(LIBVERSION); \ + ALLSYMSFLAGS='-Wl,--whole-archive'; \ +@@ -258,8 +275,8 @@ + [ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \ + [ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \ + $(LINK_SO_A) || exit 1; \ +- cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX apps/; \ +- cp -p $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX test/ ++ cp -p $$SHLIB$$SHLIB_SUFFIX apps/; \ ++ cp -p $$SHLIB$$SHLIB_SUFFIX test/ + link_app.cygwin: + $(LINK_APP) + diff --git a/bacula/src/win32/patches/pcre.patch b/bacula/src/win32/patches/pcre.patch new file mode 100644 index 0000000000..189ac45555 --- /dev/null +++ b/bacula/src/win32/patches/pcre.patch @@ -0,0 +1,130 @@ +Index: /Makefile.in +--- ../orig/pcre-6.3/Makefile.in 2005-08-18 06:08:28.000000000 -0700 ++++ ./Makefile.in 2006-06-30 09:11:02.000000000 -0700 +@@ -103,12 +103,10 @@ + LIBTOOL = @LIBTOOL@ + LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) -I. -I$(top_srcdir) $(NEWLINE) $(LINK_SIZE) $(MATCH_LIMIT) $(NO_RECURSE) $(EBCDIC) + LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) -c $(CXXFLAGS) -I. -I$(top_srcdir) $(NEWLINE) $(LINK_SIZE) $(MATCH_LIMIT) $(NO_RECURSE) $(EBCDIC) +-@ON_WINDOWS@LINK = $(CC) $(LDFLAGS) -I. -I$(top_srcdir) -L.libs +-@NOT_ON_WINDOWS@LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -I. -I$(top_srcdir) ++LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -I. -I$(top_srcdir) + LINKLIB = $(LIBTOOL) --mode=link $(CC) -export-symbols-regex '^[^_]|__?pcre_.*utf8|__?pcre_printint' $(LDFLAGS) -I. -I$(top_srcdir) + LINK_FOR_BUILD = $(LIBTOOL) --mode=link $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -I. -I$(top_srcdir) +-@ON_WINDOWS@CXXLINK = $(CXX) $(LDFLAGS) -I. -I$(top_srcdir) -L.libs +-@NOT_ON_WINDOWS@CXXLINK = $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -I. -I$(top_srcdir) ++CXXLINK = $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -I. -I$(top_srcdir) + CXXLINKLIB = $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -I. -I$(top_srcdir) + + # These are the version numbers for the shared libraries +@@ -355,54 +353,54 @@ + + # Some Windows-specific targets for MinGW. Do not use for Cygwin. + +-winshared : .libs/@WIN_PREFIX@pcre.dll .libs/@WIN_PREFIX@pcreposix.dll \ +- .libs/@WIN_PREFIX@pcrecpp.dll ++winshared : .libs/pcre.dll .libs/pcreposix.dll \ ++ .libs/pcrecpp.dll + +-.libs/@WIN_PREFIX@pcre.dll : libpcre.la ++.libs/pcre.dll : libpcre.la + $(CC) $(CFLAGS) -shared -o $@ \ + -Wl,--whole-archive .libs/libpcre.a \ + -Wl,--out-implib,.libs/libpcre.dll.a \ +- -Wl,--output-def,.libs/@WIN_PREFIX@pcre.dll-def \ ++ -Wl,--output-def,.libs/pcre.dll-def \ + -Wl,--export-all-symbols \ + -Wl,--no-whole-archive +- sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcre.dll'#" \ ++ sed -e "s#dlname=''#dlname='../bin/pcre.dll'#" \ + -e "s#library_names=''#library_names='libpcre.dll.a'#" \ + < .libs/libpcre.lai > .libs/libpcre.lai.tmp && \ + mv -f .libs/libpcre.lai.tmp .libs/libpcre.lai +- sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcre.dll'#" \ ++ sed -e "s#dlname=''#dlname='../bin/pcre.dll'#" \ + -e "s#library_names=''#library_names='libpcre.dll.a'#" \ + < libpcre.la > libpcre.la.tmp && \ + mv -f libpcre.la.tmp libpcre.la + + +-.libs/@WIN_PREFIX@pcreposix.dll: libpcreposix.la libpcre.la ++.libs/pcreposix.dll: libpcreposix.la libpcre.la + $(CC) $(CFLAGS) -shared -o $@ \ + -Wl,--whole-archive .libs/libpcreposix.a \ +- -Wl,--out-implib,.libs/@WIN_PREFIX@pcreposix.dll.a \ +- -Wl,--output-def,.libs/@WIN_PREFIX@libpcreposix.dll-def \ ++ -Wl,--out-implib,.libs/libpcreposix.dll.a \ ++ -Wl,--output-def,.libs/libpcreposix.dll-def \ + -Wl,--export-all-symbols \ + -Wl,--no-whole-archive .libs/libpcre.a +- sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcreposix.dll'#" \ ++ sed -e "s#dlname=''#dlname='../bin/pcreposix.dll'#" \ + -e "s#library_names=''#library_names='libpcreposix.dll.a'#"\ + < .libs/libpcreposix.lai > .libs/libpcreposix.lai.tmp && \ + mv -f .libs/libpcreposix.lai.tmp .libs/libpcreposix.lai +- sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcreposix.dll'#" \ ++ sed -e "s#dlname=''#dlname='../bin/pcreposix.dll'#" \ + -e "s#library_names=''#library_names='libpcreposix.dll.a'#"\ + < libpcreposix.la > libpcreposix.la.tmp && \ + mv -f libpcreposix.la.tmp libpcreposix.la + +-.libs/@WIN_PREFIX@pcrecpp.dll: libpcrecpp.la libpcre.la ++.libs/pcrecpp.dll: libpcrecpp.la libpcre.la + $(CXX) $(CXXFLAGS) -shared -o $@ \ + -Wl,--whole-archive .libs/libpcrecpp.a \ +- -Wl,--out-implib,.libs/@WIN_PREFIX@pcrecpp.dll.a \ +- -Wl,--output-def,.libs/@WIN_PREFIX@libpcrecpp.dll-def \ ++ -Wl,--out-implib,.libs/libpcrecpp.dll.a \ ++ -Wl,--output-def,.libs/libpcrecpp.dll-def \ + -Wl,--export-all-symbols \ + -Wl,--no-whole-archive .libs/libpcre.a +- sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcrecpp.dll'#" \ ++ sed -e "s#dlname=''#dlname='../bin/pcrecpp.dll'#" \ + -e "s#library_names=''#library_names='libpcrecpp.dll.a'#"\ + < .libs/libpcrecpp.lai > .libs/libpcrecpp.lai.tmp && \ + mv -f .libs/libpcrecpp.lai.tmp .libs/libpcrecpp.lai +- sed -e "s#dlname=''#dlname='../bin/@WIN_PREFIX@pcrecpp.dll'#" \ ++ sed -e "s#dlname=''#dlname='../bin/pcrecpp.dll'#" \ + -e "s#library_names=''#library_names='libpcrecpp.dll.a'#"\ + < libpcrecpp.la > libpcrecpp.la.tmp && \ + mv -f libpcrecpp.la.tmp libpcrecpp.la +@@ -411,15 +409,15 @@ + wininstall : winshared + $(mkinstalldirs) $(DESTDIR)$(LIBDIR) + $(mkinstalldirs) $(DESTDIR)$(BINDIR) +- $(INSTALL) .libs/@WIN_PREFIX@pcre.dll $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcre.dll +- $(INSTALL) .libs/@WIN_PREFIX@pcreposix.dll $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcreposix.dll +- $(INSTALL) .libs/@WIN_PREFIX@libpcreposix.dll.a $(DESTDIR)$(LIBDIR)/@WIN_PREFIX@libpcreposix.dll.a +- $(INSTALL) .libs/@WIN_PREFIX@libpcre.dll.a $(DESTDIR)$(LIBDIR)/@WIN_PREFIX@libpcre.dll.a +-@HAVE_CPP@ $(INSTALL) .libs/@WIN_PREFIX@pcrecpp.dll $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcrecpp.dll +-@HAVE_CPP@ $(INSTALL) .libs/@WIN_PREFIX@libpcrecpp.dll.a $(DESTDIR)$(LIBDIR)/@WIN_PREFIX@libpcrecpp.dll.a +- -strip -g $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcre.dll +- -strip -g $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcreposix.dll +-@HAVE_CPP@ -strip -g $(DESTDIR)$(BINDIR)/@WIN_PREFIX@pcrecpp.dll ++ $(INSTALL) .libs/pcre.dll $(DESTDIR)$(BINDIR)/pcre.dll ++ $(INSTALL) .libs/pcreposix.dll $(DESTDIR)$(BINDIR)/pcreposix.dll ++ $(INSTALL) .libs/libpcreposix.dll.a $(DESTDIR)$(LIBDIR)/libpcreposix.dll.a ++ $(INSTALL) .libs/libpcre.dll.a $(DESTDIR)$(LIBDIR)/libpcre.dll.a ++@HAVE_CPP@ $(INSTALL) .libs/pcrecpp.dll $(DESTDIR)$(BINDIR)/pcrecpp.dll ++@HAVE_CPP@ $(INSTALL) .libs/libpcrecpp.dll.a $(DESTDIR)$(LIBDIR)/libpcrecpp.dll.a ++ -strip -g $(DESTDIR)$(BINDIR)/pcre.dll ++ -strip -g $(DESTDIR)$(BINDIR)/pcreposix.dll ++@HAVE_CPP@ -strip -g $(DESTDIR)$(BINDIR)/pcrecpp.dll + -strip $(DESTDIR)$(BINDIR)/pcregrep@EXEEXT@ + -strip $(DESTDIR)$(BINDIR)/pcretest@EXEEXT@ + +@@ -555,12 +553,12 @@ + + check: runtest + +-@WIN_PREFIX@pcre.dll : winshared +- cp .libs/@WIN_PREFIX@pcre.dll . ++pcre.dll : winshared ++ cp .libs/pcre.dll . + + test: runtest + +-runtest: all @ON_WINDOWS@ @WIN_PREFIX@pcre.dll ++runtest: all @ON_WINDOWS@ pcre.dll + @./RunTest + @./RunGrepTest + @HAVE_CPP@ @echo "" diff --git a/bacula/src/win32/patches/postgresql.patch b/bacula/src/win32/patches/postgresql.patch new file mode 100644 index 0000000000..d270d2c1a7 --- /dev/null +++ b/bacula/src/win32/patches/postgresql.patch @@ -0,0 +1,123 @@ +Index: doc/Makefile +--- ../original/postgresql-8.1.4/doc/Makefile 2003-11-29 11:51:36.000000000 -0800 ++++ ./doc/Makefile 2006-06-29 03:44:10.000000000 -0700 +@@ -101,4 +101,4 @@ + + clean distclean maintainer-clean: + rm -rf man1/ man$(sqlmansectnum)/ man$(sqlmansect_dummy)/ +- $(MAKE) -C src $@ ++ -$(MAKE) -C src $@ +Index: src/bin/pgevent/Makefile +--- ../original/postgresql-8.1.4/src/bin/pgevent/Makefile 2004-12-31 14:03:14.000000000 -0800 ++++ ./src/bin/pgevent/Makefile 2006-06-29 01:19:18.000000000 -0700 +@@ -14,16 +14,18 @@ + + OBJS=pgevent.o pgmsgevent.o + NAME=pgevent.dll ++DLLWRAP=dllwrap ++WINDRES=windres + + all: $(NAME) + + install: all install-lib + + pgevent.dll: $(OBJS) pgevent.def +- dllwrap --def pgevent.def -o $(NAME) $(OBJS) ++ $(DLLWRAP) --def pgevent.def -o $(NAME) $(OBJS) + + pgmsgevent.o: pgmsgevent.rc win32ver.rc +- windres pgmsgevent.rc -o pgmsgevent.o --include-dir=$(top_builddir)/src/include ++ $(WINDRES) pgmsgevent.rc -o pgmsgevent.o --include-dir=$(top_builddir)/src/include + + all-lib: $(NAME) + +Index: src/interfaces/libpq/Makefile +--- ../original/postgresql-8.1.4/src/interfaces/libpq/Makefile 2005-08-28 17:47:35.000000000 -0700 ++++ ./src/interfaces/libpq/Makefile 2006-06-29 01:15:35.000000000 -0700 +@@ -13,6 +13,7 @@ + top_builddir = ../../.. + include $(top_builddir)/src/Makefile.global + ++WINDRES=windres + + # shared library parameters + NAME= pq +@@ -42,7 +43,7 @@ + DLL_DEFFILE=libpqdll.def + + libpqrc.o: libpq.rc +- windres -i libpq.rc -o libpqrc.o ++ $(WINDRES) -i libpq.rc -o libpqrc.o + + ifeq ($(enable_thread_safety), yes) + OBJS += pthread-win32.o +Index: src/Makefile +--- ../original/postgresql-8.1.4/src/Makefile 2005-01-13 10:23:21.000000000 -0800 ++++ ./src/Makefile 2006-06-29 04:07:54.000000000 -0700 +@@ -52,10 +52,10 @@ + $(MAKE) -C bin $@ + $(MAKE) -C pl $@ + $(MAKE) -C makefiles $@ +- $(MAKE) -C test $@ +- $(MAKE) -C tutorial NO_PGXS=1 $@ ++ -$(MAKE) -C test $@ ++ -$(MAKE) -C tutorial NO_PGXS=1 $@ + $(MAKE) -C utils $@ +- $(MAKE) -C tools/thread $@ ++ -$(MAKE) -C tools/thread $@ + + distclean maintainer-clean: + -$(MAKE) -C port $@ +Index: src/Makefile.global.in +--- ../original/postgresql-8.1.4/src/Makefile.global.in 2005-09-27 10:39:32.000000000 -0700 ++++ ./src/Makefile.global.in 2006-06-29 01:11:44.000000000 -0700 +@@ -31,6 +31,7 @@ + # PostgreSQL version number + VERSION = @PACKAGE_VERSION@ + ++WINDRES=windres + # Support for VPATH builds + vpath_build = @vpath_build@ + abs_top_srcdir = @abs_top_srcdir@ +@@ -456,7 +457,7 @@ + sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc + win32ver.o: $(top_builddir)/src/port/win32ver.rc + sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $(top_builddir)/src/port/win32ver.rc > win32ver.rc +- windres -i win32ver.rc -o win32ver.o --include-dir=$(top_builddir)/src/include ++ $(WINDRES) -i win32ver.rc -o win32ver.o --include-dir=$(top_builddir)/src/include + rm -f win32ver.rc + endif + +Index: src/timezone/Makefile +--- ../original/postgresql-8.1.4/src/timezone/Makefile 2005-07-06 14:40:09.000000000 -0700 ++++ ./src/timezone/Makefile 2006-06-29 03:22:26.000000000 -0700 +@@ -12,6 +12,8 @@ + top_builddir = ../.. + include $(top_builddir)/src/Makefile.global + ++ZIC=./zic ++ + override CPPFLAGS := $(CPPFLAGS) + + # files to build into backend +@@ -25,16 +27,16 @@ + pacificnew etcetera factory backward systemv solar87 solar88 solar89 + TZDATAFILES := $(TZDATA:%=$(srcdir)/data/%) + +-all: SUBSYS.o submake-libpgport zic ++all: SUBSYS.o submake-libpgport zic$(X) + + SUBSYS.o: $(OBJS) + $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) + +-zic: $(ZICOBJS) +- $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X) ++zic$(X): $(ZICOBJS) ++ $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@ + + install: all installdirs +- ./zic -d $(DESTDIR)$(datadir)/timezone $(TZDATAFILES) ++ $(ZIC) -d $(DESTDIR)$(datadir)/timezone $(TZDATAFILES) + + installdirs: + $(mkinstalldirs) $(DESTDIR)$(datadir) diff --git a/bacula/src/win32/patches/pthreads.patch b/bacula/src/win32/patches/pthreads.patch new file mode 100644 index 0000000000..b5c9327308 --- /dev/null +++ b/bacula/src/win32/patches/pthreads.patch @@ -0,0 +1,69 @@ +Index: GNUmakefile +--- ../tmp/pthreads-snap-2004-06-22/GNUmakefile 2004-05-19 17:56:52.000000000 -0700 ++++ ./GNUmakefile 2006-06-27 05:48:10.000000000 -0700 +@@ -408,16 +408,16 @@ + @ $(MAKE) clean GC + + GC: +- $(MAKE) CC=gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_OBJS)" $(GC_DLL) ++ $(MAKE) CC=mingw32-gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_OBJS)" $(GC_DLL) + + GCE: +- $(MAKE) CC=g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_OBJS)" $(GCE_DLL) ++ $(MAKE) CC=mingw32-g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_OBJS)" $(GCE_DLL) + + GC-inlined: +- $(MAKE) CC=gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GC_INLINED_STAMP) ++ $(MAKE) CC=mingw32-gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GC_INLINED_STAMP) + + GCE-inlined: +- $(MAKE) CC=g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GCE_INLINED_STAMP) ++ $(MAKE) CC=mingw32-g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GCE_INLINED_STAMP) + + tests: + @ cd tests +@@ -436,24 +436,24 @@ + + $(GC_DLL): $(DLL_OBJS) + $(CC) $(OPT) -shared -o $(GC_DLL) $(DLL_OBJS) $(LFLAGS) +- dlltool -z pthread.def $(DLL_OBJS) +- dlltool -k --dllname $@ --output-lib $(GC_LIB) --def $(PTHREAD_DEF) ++ mingw32-dlltool -z pthread.def $(DLL_OBJS) ++ mingw32-dlltool -k --dllname $@ --output-lib $(GC_LIB) --def $(PTHREAD_DEF) + + $(GCE_DLL): $(DLL_OBJS) + $(CC) $(OPT) -mthreads -shared -o $(GCE_DLL) $(DLL_OBJS) $(LFLAGS) +- dlltool -z pthread.def $(DLL_OBJS) +- dlltool -k --dllname $@ --output-lib $(GCE_LIB) --def $(PTHREAD_DEF) ++ mingw32-dlltool -z pthread.def $(DLL_OBJS) ++ mingw32-dlltool -k --dllname $@ --output-lib $(GCE_LIB) --def $(PTHREAD_DEF) + + $(GC_INLINED_STAMP): $(DLL_INLINED_OBJS) + $(CC) $(OPT) -shared -o $(GC_DLL) $(DLL_INLINED_OBJS) $(LFLAGS) +- dlltool -z pthread.def $(DLL_INLINED_OBJS) +- dlltool -k --dllname $(GC_DLL) --output-lib $(GC_LIB) --def $(PTHREAD_DEF) ++ mingw32-dlltool -z pthread.def $(DLL_INLINED_OBJS) ++ mingw32-dlltool -k --dllname $(GC_DLL) --output-lib $(GC_LIB) --def $(PTHREAD_DEF) + echo touched > $(GC_INLINED_STAMP) + + $(GCE_INLINED_STAMP): $(DLL_INLINED_OBJS) + $(CC) $(OPT) -mthreads -shared -o $(GCE_DLL) $(DLL_INLINED_OBJS) $(LFLAGS) +- dlltool -z pthread.def $(DLL_INLINED_OBJS) +- dlltool -k --dllname $(GCE_DLL) --output-lib $(GCE_LIB) --def $(PTHREAD_DEF) ++ mingw32-dlltool -z pthread.def $(DLL_INLINED_OBJS) ++ mingw32-dlltool -k --dllname $(GCE_DLL) --output-lib $(GCE_LIB) --def $(PTHREAD_DEF) + echo touched > $(GCE_INLINED_STAMP) + + clean: +Index: ptw32_semwait.c +--- ../tmp/pthreads-snap-2004-06-22/ptw32_semwait.c 2004-05-17 00:59:47.000000000 -0700 ++++ ./ptw32_semwait.c 2006-06-27 05:52:59.000000000 -0700 +@@ -41,7 +41,7 @@ + #include "implement.h" + + +-INLINE int ++int + ptw32_semwait (sem_t * sem) + /* + * ------------------------------------------------------ diff --git a/bacula/src/win32/patches/sqlite.patch b/bacula/src/win32/patches/sqlite.patch new file mode 100644 index 0000000000..fe91ef12e4 --- /dev/null +++ b/bacula/src/win32/patches/sqlite.patch @@ -0,0 +1,180 @@ +Index: main.mk +--- ../orig/sqlite-3.3.6/main.mk 2006-06-06 03:52:26.000000000 -0700 ++++ ./main.mk 2006-06-30 15:16:28.000000000 -0700 +@@ -60,7 +60,7 @@ + expr.o func.o hash.o insert.o \ + main.o opcodes.o os.o os_os2.o os_unix.o os_win.o \ + pager.o parse.o pragma.o prepare.o printf.o random.o \ +- select.o table.o tclsqlite.o tokenize.o trigger.o \ ++ select.o table.o tokenize.o trigger.o \ + update.o util.o vacuum.o \ + vdbe.o vdbeapi.o vdbeaux.o vdbefifo.o vdbemem.o \ + where.o utf.o legacy.o +@@ -174,7 +174,7 @@ + # of the most recently modified source code file + # + last_change: $(SRC) +- cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \ ++ cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -1 \ + | $(NAWK) '{print $$5,$$6}' >last_change + + libsqlite3.a: $(LIBOBJ) +@@ -264,7 +264,7 @@ + $(TCCX) -c opcodes.c + + opcodes.c: opcodes.h $(TOP)/mkopcodec.awk +- sort -n -b +2 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c ++ sort -n -b -k 3 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c + + opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk + cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h +@@ -360,8 +360,8 @@ + + # Rules for building test programs and for running tests + # +-tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a +- $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \ ++tclsqlite3$(EXE): $(TOP)/src/tclsqlite.c libsqlite3.a ++ $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3$(EXE) \ + $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB) + + testfixture$(EXE): $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC) +@@ -563,8 +563,8 @@ + + # Standard install and cleanup targets + # +-install: sqlite3 libsqlite3.a sqlite3.h +- mv sqlite3 /usr/bin ++install: sqlite3$(EXE) libsqlite3.a sqlite3.h ++ mv sqlite3$(EXE) /usr/bin + mv libsqlite3.a /usr/lib + mv sqlite3.h /usr/include + +Index: Makefile.mingw32 +--- ../orig/sqlite-3.3.6/Makefile.mingw32 1969-12-31 16:00:00.000000000 -0800 ++++ ./Makefile.mingw32 2006-06-30 15:14:29.000000000 -0700 +@@ -0,0 +1,124 @@ ++#!/usr/make ++# ++# Makefile for SQLITE ++# ++# This is a template makefile for SQLite. Most people prefer to ++# use the autoconf generated "configure" script to generate the ++# makefile automatically. But that does not work for everybody ++# and in every situation. If you are having problems with the ++# "configure" script, you might want to try this makefile as an ++# alternative. Create a copy of this file, edit the parameters ++# below and type "make". ++# ++ ++#### The toplevel directory of the source tree. This is the directory ++# that contains this "Makefile.in" and the "configure.in" script. ++# ++TOP = .. ++ ++#### C Compiler and options for use in building executables that ++# will run on the platform that is doing the build. ++# ++BCC = gcc -g -O2 ++#BCC = /opt/ancic/bin/c89 -0 ++ ++#### If the target operating system supports the "usleep()" system ++# call, then define the HAVE_USLEEP macro for all C modules. ++# ++#USLEEP = ++USLEEP = -DHAVE_USLEEP=1 ++ ++#### If you want the SQLite library to be safe for use within a ++# multi-threaded program, then define the following macro ++# appropriately: ++# ++THREADSAFE = -DTHREADSAFE=1 ++#THREADSAFE = -DTHREADSAFE=0 ++ ++#### Specify any extra linker options needed to make the library ++# thread safe ++# ++THREADLIB = -lpthreadGCE ++#THREADLIB = ++ ++#### Specify any extra libraries needed to access required functions. ++# ++#TLIBS = -lrt # fdatasync on Solaris 8 ++TLIBS = ++ ++#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1 ++# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all ++# malloc()s and free()s in order to track down memory leaks. ++# ++# SQLite uses some expensive assert() statements in the inner loop. ++# You can make the library go almost twice as fast if you compile ++# with -DNDEBUG=1 ++# ++#OPTS = -DSQLITE_DEBUG=2 ++#OPTS = -DSQLITE_DEBUG=1 ++#OPTS = ++OPTS = -DNDEBUG=1 ++OPTS += -DHAVE_FDATASYNC=1 ++ ++#### The suffix to add to executable files. ".exe" for windows. ++# Nothing for unix. ++# ++EXE = .exe ++#EXE = ++ ++#### C Compile and options for use in building executables that ++# will run on the target platform. This is usually the same ++# as BCC, unless you are cross-compiling. ++# ++#TCC = gcc -O6 ++#TCC = gcc -g -O0 -Wall ++#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage ++TCC = $(CROSSTOOLS)/mingw32-gcc -O6 ++#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive ++ ++#### Tools used to build a static library. ++# ++#AR = ar cr ++AR = $(CROSSTOOLS)/mingw32-ar cr ++#RANLIB = ranlib ++RANLIB = $(CROSSTOOLS)/mingw32-ranlib ++ ++#### Extra compiler options needed for programs that use the TCL library. ++# ++#TCL_FLAGS = ++#TCL_FLAGS = -DSTATIC_BUILD=1 ++#TCL_FLAGS = -I/home/drh/tcltk/8.4linux ++#TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1 ++#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux ++ ++#### Linker options needed to link against the TCL library. ++# ++#LIBTCL = -ltcl84 ++#LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl ++#LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt ++#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc ++ ++#### Compiler options needed for programs that use the readline() library. ++# ++READLINE_FLAGS = ++#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline ++ ++#### Linker options needed by programs using readline() must link against. ++# ++LIBREADLINE = ++#LIBREADLINE = -static -lreadline -ltermcap ++ ++#### Should the database engine assume text is coded as UTF-8 or iso8859? ++# ++# ENCODING = UTF8 ++ENCODING = ISO8859 ++ ++ ++#### Which "awk" program provides nawk compatibilty ++# ++# NAWK = nawk ++NAWK = awk ++ ++# You should not have to change anything below this line ++############################################################################### ++include $(TOP)/main.mk diff --git a/bacula/src/win32/patches/wx.patch b/bacula/src/win32/patches/wx.patch new file mode 100644 index 0000000000..268497ffe0 --- /dev/null +++ b/bacula/src/win32/patches/wx.patch @@ -0,0 +1,37 @@ +--- build/msw/config.gcc Sun Feb 5 13:37:26 2006 ++++ build/msw/config.mingw32 Mon Jun 26 16:54:42 2006 +@@ -11,10 +11,10 @@ + # ------------------------------------------------------------------------- + + # C compiler +-CC = gcc ++CC = mingw32-gcc + + # C++ compiler +-CXX = g++ ++CXX = mingw32-g++ + + # Standard flags for CC + CFLAGS = +@@ -23,10 +23,10 @@ + CXXFLAGS = + + # Standard preprocessor flags (common for CC and CXX) +-CPPFLAGS = ++CPPFLAGS = -I../../../zlib + + # Standard linker flags +-LDFLAGS = ++LDFLAGS = -L../../../zlib + + # The C preprocessor + CPP = $(CC) -E +@@ -44,7 +44,7 @@ + MSLU = 0 + + # Type of compiled binaries [debug,release] +-BUILD = debug ++BUILD = release + + # Should debugging info be included in the executables? The default value + # "default" means that debug info will be included if BUILD=debug diff --git a/bacula/src/win32/patches/wx.sed b/bacula/src/win32/patches/wx.sed new file mode 100644 index 0000000000..10012a9bdc --- /dev/null +++ b/bacula/src/win32/patches/wx.sed @@ -0,0 +1,9 @@ +s%config.gcc%config.mingw32% +s%\\\(.\)%/\1%g +s%ranlib%mingw32-ranlib% +s%windres%mingw32-windres% +s%ar rc%mingw32-ar rc% +s%makefile\.gcc%makefile\.mingw32% +s%if exist \([^ \t][^ \t]*\) del \1%if [ -e \1 ]; then rm \1; fi% +s%if not exist \([^ \t][^ \t]*\) mkdir \1%if [ ! -e \1 ]; then mkdir \1; fi% +s%if not exist \([^ \t][^ \t]*\) copy \([^ \t][^ \t]*\) \1%if [ ! -e \1 ]; then cp \2 \1; fi% diff --git a/bacula/src/win32/patches/zlib.patch b/bacula/src/win32/patches/zlib.patch new file mode 100644 index 0000000000..6b51f492ef --- /dev/null +++ b/bacula/src/win32/patches/zlib.patch @@ -0,0 +1,150 @@ +--- /dev/null Sun Jun 25 06:11:31 2006 ++++ win32/Makefile.mingw32 Sun Jun 25 06:11:06 2006 +@@ -0,0 +1,147 @@ ++# Makefile for zlib, derived from Makefile.dj2. ++# Modified for mingw32 by C. Spieler, 6/16/98. ++# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003. ++# Last updated: 1-Aug-2003. ++# Tested under Cygwin and MinGW. ++ ++# Copyright (C) 1995-2003 Jean-loup Gailly. ++# For conditions of distribution and use, see copyright notice in zlib.h ++ ++# To compile, or to compile and test, type: ++# ++# make -fmakefile.gcc; make test testdll -fmakefile.gcc ++# ++# To use the asm code, type: ++# cp contrib/asm?86/match.S ./match.S ++# make LOC=-DASMV OBJA=match.o -fmakefile.gcc ++# ++# To install libz.a, zconf.h and zlib.h in the system directories, type: ++# ++# make install -fmakefile.gcc ++ ++# Note: ++# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN), ++# the DLL name should be changed from "zlib1.dll". ++ ++STATICLIB = libz.a ++SHAREDLIB = zlib1.dll ++IMPLIB = libzdll.a ++ ++PREFIX = /usr/local ++EXEC_PREFIX = $(prefix) ++ ++INCLUDE_PATH = $(PREFIX)/include ++LIBRARY_PATH = $(PREFIX)/lib ++BIN_PATH = $(PREFIX)/bin ++ ++#LOC = -DASMV ++#LOC = -DDEBUG -g ++ ++CC = mingw32-gcc ++CFLAGS = $(LOC) -O3 -Wall ++ ++AS = $(CC) ++ASFLAGS = $(LOC) -Wall ++ ++LD = $(CC) ++LDFLAGS = $(LOC) -s ++ ++AR = mingw32-ar ++ARFLAGS = rcs ++ ++RC = mingw32-windres ++RCFLAGS = --define GCC_WINDRES ++ ++CP = cp -fp ++# If GNU install is available, replace $(CP) with install. ++INSTALL = $(CP) ++RM = rm -f ++ ++OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \ ++ inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o ++OBJA = ++ ++all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe ++ ++test: example.exe minigzip.exe ++ ./example.exe ++ echo hello world | ./minigzip.exe | ./minigzip.exe -d ++ ++testdll: example_d.exe minigzip_d.exe ++ ./example_d.exe ++ echo hello world | ./minigzip_d.exe | ./minigzip_d.exe -d ++ ++.c.o: ++ $(CC) $(CFLAGS) -c -o $@ $< ++ ++.S.o: ++ $(AS) $(ASFLAGS) -c -o $@ $< ++ ++$(STATICLIB): $(OBJS) $(OBJA) ++ $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA) ++ ++$(IMPLIB): $(SHAREDLIB) ++ ++$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o ++ mingw32-dllwrap --dlltool-name mingw32-dlltool --driver-name $(CC) --def win32/zlib.def \ ++ --implib $(IMPLIB) -o $@ $(OBJS) $(OBJA) zlibrc.o ++ mingw32-strip $@ ++ ++example.exe: example.o $(STATICLIB) ++ $(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB) ++ ++minigzip.exe: minigzip.o $(STATICLIB) ++ $(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB) ++ ++example_d.exe: example.o $(IMPLIB) ++ $(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB) ++ ++minigzip_d.exe: minigzip.o $(IMPLIB) ++ $(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB) ++ ++zlibrc.o: win32/zlib1.rc ++ $(RC) $(RCFLAGS) -o $@ win32/zlib1.rc ++ ++ ++# INCLUDE_PATH and LIBRARY_PATH must be set. ++ ++.PHONY: install uninstall clean ++ ++install: zlib.h zconf.h $(STATICLIB) $(SHAREDLIB) $(IMPLIB) ++ -@if test ! -e $(INCLUDE_PATH); then mkdir $(INCLUDE_PATH); fi ++ -@if test ! -e $(LIBRARY_PATH); then mkdir $(LIBRARY_PATH); fi ++ -@if test ! -e $(BIN_PATH); then mkdir $(BIN_PATH); fi ++ -$(INSTALL) zlib.h $(INCLUDE_PATH) ++ -$(INSTALL) zconf.h $(INCLUDE_PATH) ++ -$(INSTALL) $(STATICLIB) $(LIBRARY_PATH) ++ -$(INSTALL) $(IMPLIB) $(LIBRARY_PATH) ++ -$(INSTALL) $(SHAREDLIB) $(BIN_PATH) ++ ++uninstall: ++ -$(RM) $(INCLUDE_PATH)/zlib.h ++ -$(RM) $(INCLUDE_PATH)/zconf.h ++ -$(RM) $(LIBRARY_PATH)/$(STATICLIB) ++ -$(RM) $(LIBRARY_PATH)/$(IMPLIB) ++ ++clean: ++ -$(RM) $(STATICLIB) ++ -$(RM) $(SHAREDLIB) ++ -$(RM) $(IMPLIB) ++ -$(RM) *.o ++ -$(RM) *.exe ++ -$(RM) foo.gz ++ ++adler32.o: zlib.h zconf.h ++compress.o: zlib.h zconf.h ++crc32.o: crc32.h zlib.h zconf.h ++deflate.o: deflate.h zutil.h zlib.h zconf.h ++example.o: zlib.h zconf.h ++gzio.o: zutil.h zlib.h zconf.h ++inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h ++inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h ++infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h ++inftrees.o: zutil.h zlib.h zconf.h inftrees.h ++minigzip.o: zlib.h zconf.h ++trees.o: deflate.h zutil.h zlib.h zconf.h trees.h ++uncompr.o: zlib.h zconf.h ++zutil.o: zutil.h zlib.h zconf.h -- 2.39.5