From 057ef2265f0d93d6e4166fd61805d1d35312e175 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Tue, 8 Aug 2006 07:49:09 +0000 Subject: [PATCH] Fix Windows cross-compile compatibilty problems with FreeBSD. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3268 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/build-dependencies | 20 ++++++++++++++------ bacula/src/win32/build-win32-cross-tools | 22 +++++++++++----------- bacula/src/win32/installer/Makefile | 2 +- bacula/src/win32/patches/mt.patch | 2 +- bacula/src/win32/patches/nsis.patch | 5 +++-- bacula/src/win32/patches/openssl.patch | 4 ++-- bacula/src/win32/patches/wx.sed | 6 +++--- 7 files changed, 35 insertions(+), 26 deletions(-) diff --git a/bacula/src/win32/build-dependencies b/bacula/src/win32/build-dependencies index 9ebd2beb7f..4dbca5e0db 100755 --- a/bacula/src/win32/build-dependencies +++ b/bacula/src/win32/build-dependencies @@ -106,7 +106,7 @@ get_source() then rm -rf ${SRC_DIR} echo Extracting ${ARCHIVE} - ${ARCHIVER} ${ARCHIVE} &> ${ARCHIVE}.log + ${ARCHIVER} ${ARCHIVE} 2>&1 > ${ARCHIVE}.log cd ${SRC_DIR} return 0 fi @@ -182,7 +182,7 @@ process_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 + ./configure CC_FOR_BUILD=gcc CXX_FOR_BUILD=g++ --host=mingw32 --prefix=${DEPPKG_DIR} --enable-utf8 --enable-unicode-properties 2>&1 >make.log echo Building PCRE do_make Makefile PREFIX=${DEPPKG_DIR} all echo Installing PCRE @@ -217,7 +217,7 @@ process_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 + ./Configure --prefix=${DEPPKG_DIR} shared zlib-dynamic threads --with-zlib-include=${DEPPKG_DIR}/include mingw32 2>&1 > 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 @@ -253,7 +253,7 @@ process_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 + ./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 2>&1 > make.log echo Building postgreSQL if [ -e /usr/sbin/zic ]; then ZIC=/usr/sbin/zic elif [ -e /sbin/zic ]; then ZIC=/sbin/zic @@ -325,7 +325,7 @@ process_scons() { get_source "${URL_SCONS}" "${DIR_SCONS}" echo Installing scons - if python setup.py install --prefix=${DEPPKG_DIR}/scons &> make.log + if python setup.py install --prefix=${DEPPKG_DIR}/scons 2>&1 > make.log then : else @@ -346,11 +346,19 @@ process_nsis() >patch.log do_patch nsis.patch fi + if [ "`uname -s`" = "FreeBSD" ] + then + ICONV_VARS="CPPPATH=/usr/local/include LIBPATH=/usr/local/lib" + else + ICONV_VARS= + 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 + PREFIX_DOC=${DEPPKG_DIR}/nsis/Docs \ + ${ICONV_VARS} \ + 2>&1 | tee make.log | parse_output then : else diff --git a/bacula/src/win32/build-win32-cross-tools b/bacula/src/win32/build-win32-cross-tools index 3f72bbddc2..293872434b 100755 --- a/bacula/src/win32/build-win32-cross-tools +++ b/bacula/src/win32/build-win32-cross-tools @@ -273,7 +273,7 @@ function configure_binutils cd "binutils-$TARGET" echo "Configuring binutils" "$SRCDIR/$BINUTILS/configure" --prefix="$PREFIX" --target=$TARGET --disable-nls \ - --with-gcc --with-gnu-as --with-gnu-ld --disable-shared &> configure.log + --with-gcc --with-gnu-as --with-gnu-ld --disable-shared 2>&1 > configure.log cd "$BUILDDIR" } @@ -282,7 +282,7 @@ function build_binutils { cd "$BUILDDIR/binutils-$TARGET" echo "Building binutils" - make CFLAGS="-O2 -fno-exceptions" LDFLAGS="-s" &> make.log + make CFLAGS="-O2 -fno-exceptions" LDFLAGS="-s" 2>&1 > make.log if test $? -ne 0; then echo "make of binutils failed - log available: binutils-$TARGET/make.log" exit 1 @@ -295,7 +295,7 @@ function install_binutils { cd "$BUILDDIR/binutils-$TARGET" echo "Installing binutils" - make install &> make-install.log + make install 2>&1 > make-install.log if test $? -ne 0; then echo "install of binutils failed - log available: binutils-$TARGET/make-install.log" exit 1 @@ -362,7 +362,7 @@ function configure_gcc --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj \ --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug \ --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug \ - &> configure.log + 2>&1 > configure.log cd "$BUILDDIR" } @@ -371,14 +371,14 @@ function build_gcc { cd "$BUILDDIR/gcc-$TARGET" echo "Building gcc" - make CFLAGS="-O2" CXXFLAGS="-O2" GCJFLAGS="-O2" LDFLAGS="-s" DEBUG_FLAGS="-g0" &> make.log + make CFLAGS="-O2" CXXFLAGS="-O2" GCJFLAGS="-O2" LDFLAGS="-s" DEBUG_FLAGS="-g0" 2>&1 > make.log if test $? -ne 0; then echo "make of gcc failed - log available: gcc-$TARGET/make.log" exit 1 fi if [ "x$GCC_ADA" != "x" ]; then cd gcc - make "CFLAGS=-O2" "LDFLAGS=-s" gnatlib_and_tools &> make-gnatlib.log + make "CFLAGS=-O2" "LDFLAGS=-s" gnatlib_and_tools 2>&1 > make-gnatlib.log if test $? -ne 0; then echo "make of gnatlib and tools failed - log available: gcc-$TARGET/make-gnatlib.log" exit 1 @@ -392,7 +392,7 @@ function install_gcc { cd "$BUILDDIR/gcc-$TARGET" echo "Installing gcc" - make install &> make-install.log + make install 2>&1 > make-install.log if test $? -ne 0; then echo "install of gcc failed - log available: gcc-$TARGET/make-install.log" exit 1 @@ -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}/patches/mingw-utils.patch &> patch.log + patch -p0 < ${SCRIPTDIR}/patches/mingw-utils.patch 2>&1 > patch.log cd "$BUILDDIR" } @@ -431,7 +431,7 @@ function configure_mingw_utils mkdir "mingw-utils" cd "mingw-utils" echo "Configuring mingw-utils" - "$SRCDIR/$MINGW_UTILS/configure" --disable-nonportable --prefix="${PREFIX}/${TARGET}" &> configure.log + "$SRCDIR/$MINGW_UTILS/configure" --disable-nonportable --prefix="${PREFIX}/${TARGET}" 2>&1 > configure.log cd "$BUILDDIR" } @@ -440,7 +440,7 @@ function build_mingw_utils { cd "$BUILDDIR/mingw-utils" echo "Building mingw-utils" - make CFLAGS="-O2 -fno-exceptions" LDFLAGS="-s" &> make.log + make CFLAGS="-O2 -fno-exceptions" LDFLAGS="-s" 2>&1 > make.log if test $? -ne 0; then echo "make of mingw-utils failed - log available: mingw-utils/make.log" exit 1 @@ -453,7 +453,7 @@ function install_mingw_utils { cd "$BUILDDIR/mingw-utils" echo "Installing mingw-utils" - make install &> make-install.log + make install 2>&1 > make-install.log if test $? -ne 0; then echo "install of mingw-utils failed - log available: mingw-utils/make-install.log" exit 1 diff --git a/bacula/src/win32/installer/Makefile b/bacula/src/win32/installer/Makefile index 541f2aa936..8f1c7f45cc 100644 --- a/bacula/src/win32/installer/Makefile +++ b/bacula/src/win32/installer/Makefile @@ -7,7 +7,7 @@ include ../Makefile.inc -VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t]\+"\(.*\)"/\1/p' < ../../version.h) +VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h) DEFINES := \ -DVERSION=$(VERSION) \ diff --git a/bacula/src/win32/patches/mt.patch b/bacula/src/win32/patches/mt.patch index 63a6a51ec9..70b916b109 100644 --- a/bacula/src/win32/patches/mt.patch +++ b/bacula/src/win32/patches/mt.patch @@ -28,7 +28,7 @@ diff -ru ../../ibiblio/mt-st-0.9b/Makefile ./Makefile -install: mt stinit - install -s mt $(BINDIR) +install: mt.exe -+ install -s mt.exe $(BINDIR) ++ install mt.exe $(BINDIR) install -c -m 444 mt.1 $(MANDIR)/man1 (if [ -f $(MANDIR)/man1/mt.1.gz ] ; then \ rm -f $(MANDIR)/man1/mt.1.gz; gzip $(MANDIR)/man1/mt.1; fi) diff --git a/bacula/src/win32/patches/nsis.patch b/bacula/src/win32/patches/nsis.patch index 39dde911b3..0a37cd7c22 100644 --- a/bacula/src/win32/patches/nsis.patch +++ b/bacula/src/win32/patches/nsis.patch @@ -1,6 +1,6 @@ Index: SCons/Config/gnu --- ../release/nsis-2.17-src/SCons/Config/gnu 2006-04-28 08:54:41.000000000 -0700 -+++ ./SCons/Config/gnu 2006-07-31 05:48:44.000000000 -0700 ++++ SCons/Config/gnu 2006-08-07 18:49:47.000000000 -0700 @@ -65,7 +65,7 @@ cross_env(stub_env) @@ -10,7 +10,7 @@ Index: SCons/Config/gnu stub_env.Append(CCFLAGS = '-Wall') # all warnings stub_env.Append(CCFLAGS = '-x c') # force compile as c -@@ -82,7 +82,7 @@ +@@ -82,8 +82,8 @@ makensis_env = defenv.Copy() if not defenv['DEBUG']: @@ -19,6 +19,7 @@ Index: SCons/Config/gnu makensis_env.Append(CCFLAGS = '-Wall') # all warnings conf = FlagsConfigure(makensis_env) + conf.CheckLinkFlag('$MAP_FLAG') # generate map file @@ -97,7 +97,7 @@ cross_env(plugin_env) diff --git a/bacula/src/win32/patches/openssl.patch b/bacula/src/win32/patches/openssl.patch index 7667e262b0..626f37929b 100644 --- a/bacula/src/win32/patches/openssl.patch +++ b/bacula/src/win32/patches/openssl.patch @@ -205,7 +205,7 @@ Index: Makefile.org if [ -f "$$i" -o -f "$$i.a" ]; then \ ( echo installing $$i; \ - if [ "$(PLATFORM)" != "Cygwin" ]; then \ -+ if [ "$(PLATFORM)" == "Cygwin" ]; then \ ++ if [ "$(PLATFORM)" = "Cygwin" ]; then \ + c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ + cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ + chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ @@ -216,7 +216,7 @@ Index: Makefile.org mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ - else \ - c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ -+ elif [ "$(PLATFORM)" == "mingw32" ]; then \ ++ elif [ "$(PLATFORM)" = "mingw32" ]; then \ + c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/\1eay32.dll/'`; \ + [ "$$i" = "libcrypto.dll.a" ] && c=libeay32.dll; \ cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ diff --git a/bacula/src/win32/patches/wx.sed b/bacula/src/win32/patches/wx.sed index 10012a9bdc..3d33c132e2 100644 --- a/bacula/src/win32/patches/wx.sed +++ b/bacula/src/win32/patches/wx.sed @@ -4,6 +4,6 @@ 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% +s%if exist \([^ ][^ ]*\) del \1%if [ -e \1 ]; then rm \1; fi% +s%if not exist \([^ ][^ ]*\) mkdir \1%if [ ! -e \1 ]; then mkdir \1; fi% +s%if not exist \([^ ][^ ]*\) copy \([^ ][^ ]*\) \1%if [ ! -e \1 ]; then cp \2 \1; fi% -- 2.39.5