Browse Source

Litecoin: Upgrade gitian win32 to Precise 12.04 and boost-1.54

mingw upgrade allows more hardening, compiler bug fixes and possibily win64 later.
Rename deps .zip files to be more consistent in revision format.

Litecoin: Reuse bitcoin-0.9 win32 deps.
0.8
Warren Togami 11 years ago
parent
commit
0fef3d3fdd
  1. 8
      bitcoin-qt.pro
  2. 72
      contrib/gitian-descriptors/boost-win32.yml
  3. 67
      contrib/gitian-descriptors/deps-win32.yml
  4. 52
      contrib/gitian-descriptors/gitian-win32.yml
  5. 41
      contrib/gitian-descriptors/qt-win32.yml
  6. 18
      src/makefile.linux-mingw

8
bitcoin-qt.pro

@ -49,6 +49,8 @@ QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2
win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat win32:QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
# on Windows: enable GCC large address aware linker flag # on Windows: enable GCC large address aware linker flag
win32:QMAKE_LFLAGS *= -Wl,--large-address-aware win32:QMAKE_LFLAGS *= -Wl,--large-address-aware
# i686-w64-mingw32
win32:QMAKE_LFLAGS *= -static-libgcc -static-libstdc++
# use: qmake "USE_QRCODE=1" # use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support # libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
@ -317,8 +319,12 @@ DEFINES += BITCOIN_QT_TEST
} }
contains(USE_SSE2, 1) { contains(USE_SSE2, 1) {
SOURCES += src/scrypt-sse2.cpp
DEFINES += USE_SSE2 DEFINES += USE_SSE2
gccsse2.input = SOURCES_SSE2
gccsse2.output = $$PWD/build/${QMAKE_FILE_BASE}.o
gccsse2.commands = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -msse2
QMAKE_EXTRA_COMPILERS += gccsse2
SOURCES_SSE2 += src/scrypt-sse2.cpp
} }
# Todo: Remove this line when switching to Qt5, as that option was removed # Todo: Remove this line when switching to Qt5, as that option was removed

72
contrib/gitian-descriptors/boost-win32.yml

@ -1,38 +1,66 @@
--- ---
name: "boost" name: "boost"
suites: suites:
- "lucid" - "precise"
architectures: architectures:
- "i386" - "amd64"
packages: packages:
- "mingw32" - "mingw-w64"
- "g++-mingw-w64"
- "faketime" - "faketime"
- "zip" - "zip"
reference_datetime: "2011-01-30 00:00:00" reference_datetime: "2011-01-30 00:00:00"
remotes: [] remotes: []
files: files:
- "boost_1_50_0.tar.bz2" - "boost_1_54_0.tar.bz2"
- "boost-mingw-gas-cross-compile-2013-03-03.patch"
script: | script: |
TMPDIR="$HOME/tmpdir" # Defines
mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include INSTALLPREFIX="$OUTDIR/staging/boost"
tar xjf boost_1_50_0.tar.bz2 HOST=i686-w64-mingw32
cd boost_1_50_0 # Input Integrity Check
echo "using gcc : 4.4 : i586-mingw32msvc-g++ echo "047e927de336af106a24bceba30069980c191529fd76b8dff8eb9a328b48ae1d boost_1_54_0.tar.bz2" | shasum -c
echo "d2b7f6a1d7051faef3c9cf41a92fa3671d905ef1e1da920d07651a43299f6268 boost-mingw-gas-cross-compile-2013-03-03.patch" | shasum -c
mkdir -p "$INSTALLPREFIX"
tar xjf boost_1_54_0.tar.bz2
cd boost_1_54_0
GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2)
echo "using gcc : $GCCVERSION : $HOST-g++
: :
<rc>i586-mingw32msvc-windres <rc>$HOST-windres
<archiver>i586-mingw32msvc-ar <archiver>$HOST-ar
<cxxflags>-frandom-seed=boost1 <cxxflags>-frandom-seed=boost1
<ranlib>$HOST-ranlib
;" > user-config.jam ;" > user-config.jam
./bootstrap.sh --without-icu ./bootstrap.sh --without-icu
./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage
for lib in chrono date_time exception filesystem graph iostreams math_c99f math_c99l math_c99 math_tr1f math_tr1l math_tr1 prg_exec_monitor program_options random regex serialization signals system test_exec_monitor thread_win32 unit_test_framework wave wserialization; do # Workaround: Upstream boost dev refuses to include patch that would allow Free Software cross-compile toolchain to work
mkdir $lib # This patch was authored by the Fedora package developer and ships in Fedora's mingw32-boost.
(cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a) # Please obtain the exact patch that matches the above sha256sum from one of the following mirrors.
mv $lib $TMPDIR/bin/$GBUILD_BITS #
done # Read History: https://svn.boost.org/trac/boost/ticket/7262
cp -a boost $TMPDIR/include # History Mirror: http://rose.makesad.us/~paulproteus/mirrors/7262%20Boost.Context%20fails%20to%20build%20using%20MinGW.html
cd $TMPDIR #
# Patch: https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch
# Patch Mirror: http://wtogami.fedorapeople.org/boost-mingw-gas-cross-compile-2013-03-03.patch
# Patch Mirror: http://mindstalk.net/host/boost-mingw-gas-cross-compile-2013-03-03.patch
# Patch Mirror: http://rose.makesad.us/~paulproteus/mirrors/boost-mingw-gas-cross-compile-2013-03-03.patch
patch -p0 < ../boost-mingw-gas-cross-compile-2013-03-03.patch
# Bug Workaround: boost-1.54.0 broke the ability to disable zlib
# https://svn.boost.org/trac/boost/ticket/9156
sed -i 's^\[ ac.check-library /zlib//zlib : <library>/zlib//zlib^^' libs/iostreams/build/Jamfile.v2
sed -i 's^<source>zlib.cpp <source>gzip.cpp \]^^' libs/iostreams/build/Jamfile.v2
# http://statmt.org/~s0565741/software/boost_1_52_0/libs/context/doc/html/context/requirements.html
# Note: Might need these options in the future for 64bit builds.
# "Please note that address-model=64 must be given to bjam command line on 64bit Windows for 64bit build; otherwise 32bit code will be generated."
# "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model."
./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install
cd "$INSTALLPREFIX"
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME export FAKETIME=$REFERENCE_DATETIME
zip -r boost-win32-1.50.0-gitian2.zip * zip -r boost-win32-1.54.0-gitian-r6.zip *
cp boost-win32-1.50.0-gitian2.zip $OUTDIR cp boost-win32-1.54.0-gitian-r6.zip $OUTDIR

67
contrib/gitian-descriptors/deps-win32.yml

@ -1,15 +1,15 @@
--- ---
name: "litecoin-deps" name: "bitcoin-deps"
suites: suites:
- "lucid" - "precise"
architectures: architectures:
- "i386" - "amd64"
packages: packages:
- "mingw32" - "mingw-w64"
- "g++-mingw-w64"
- "git-core" - "git-core"
- "zip" - "zip"
- "faketime" - "faketime"
- "wine"
- "psmisc" - "psmisc"
reference_datetime: "2011-01-30 00:00:00" reference_datetime: "2011-01-30 00:00:00"
remotes: [] remotes: []
@ -25,48 +25,69 @@ script: |
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC export TZ=UTC
export INSTALLPREFIX=$OUTDIR/staging/deps
export HOST=i686-w64-mingw32
# #
mkdir -p $INSTALLPREFIX
tar xzf openssl-1.0.1c.tar.gz tar xzf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c cd openssl-1.0.1c
./Configure --cross-compile-prefix=i586-mingw32msvc- mingw ./Configure --cross-compile-prefix=$HOST- mingw --openssldir=$INSTALLPREFIX
make make
make install_sw
cd .. cd ..
# #
tar xzf db-4.8.30.NC.tar.gz tar xzf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix cd db-4.8.30.NC/build_unix
../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include" ../dist/configure --prefix=$INSTALLPREFIX --enable-mingw --enable-cxx --host=$HOST --disable-shared
make $MAKEOPTS make $MAKEOPTS library_build
make install_lib install_include
cd ../.. cd ../..
# #
tar xzf miniupnpc-1.6.tar.gz tar xzf miniupnpc-1.6.tar.gz
cd miniupnpc-1.6 cd miniupnpc-1.6
sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw echo "
sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw --- miniupnpc-1.6/Makefile.mingw.orig 2013-09-29 18:52:51.014087958 -1000
make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar +++ miniupnpc-1.6/Makefile.mingw 2013-09-29 19:09:29.663318691 -1000
@@ -67,8 +67,8 @@
wingenminiupnpcstrings.o: wingenminiupnpcstrings.c
-miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings
- wingenminiupnpcstrings \$< \$@
+miniupnpcstrings.h: miniupnpcstrings.h.in
+ sed -e 's|OS/version|MSWindows/5.1.2600|' -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"VERSIONHERE\"|' \$< > \$@
minixml.o: minixml.c minixml.h miniupnpcstrings.h
" | sed "s/VERSIONHERE/$(cat VERSION)/" | patch -p1
mkdir -p dll
make -f Makefile.mingw CC=$HOST-gcc AR=$HOST-ar libminiupnpc.a
install -d $INSTALLPREFIX/include/miniupnpc
install *.h $INSTALLPREFIX/include/miniupnpc
install libminiupnpc.a $INSTALLPREFIX/lib
cd .. cd ..
mv miniupnpc-1.6 miniupnpc
# #
tar xzf zlib-1.2.6.tar.gz tar xzf zlib-1.2.6.tar.gz
cd zlib-1.2.6 cd zlib-1.2.6
make -f win32/Makefile.gcc PREFIX=i586-mingw32msvc- $MAKEOPTS CROSS_PREFIX=$HOST- ./configure --prefix=$INSTALLPREFIX --static
make
make install
cd .. cd ..
# #
tar xzf libpng-1.5.9.tar.gz tar xzf libpng-1.5.9.tar.gz
cd libpng-1.5.9 cd libpng-1.5.9
./configure -disable-shared CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld LDFLAGS="-L../zlib-1.2.6/" CFLAGS="-I../zlib-1.2.6/" CFLAGS="-I$INSTALLPREFIX/include" LDFLAGS="-L$INSTALLPREFIX/lib" ./configure --disable-shared --prefix=$INSTALLPREFIX --host=$HOST
make $MAKEOPTS make $MAKEOPTS
make install
cd .. cd ..
# #
tar xjf qrencode-3.2.0.tar.bz2 tar xjf qrencode-3.2.0.tar.bz2
cd qrencode-3.2.0 cd qrencode-3.2.0
./configure CC=i586-mingw32msvc-cc AR=i586-mingw32msvc-ar STRIP=i586-mingw32msvc-strip RANLIB=i586-mingw32msvc-ranlib OBJDUMP=i586-mingw32msvc-objdump LD=i586-mingw32msvc-ld png_LIBS="../libpng-1.5.9/.libs/libpng15.a ../zlib-1.2.6/libz.a" png_CFLAGS="-I../libpng-1.5.9" png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST
make $MAKEOPTS make
make install
cd .. cd ..
# #
zip -r $OUTDIR/litecoin-deps-0.0.5.zip \ cd $INSTALLPREFIX
$(ls qrencode-*/{qrencode.h,.libs/libqrencode.{,l}a} | sort) \ zip -r $OUTDIR/bitcoin-deps-win32-gitian-r9.zip include lib
$(ls db-*/build_unix/{libdb_cxx.a,db.h,db_cxx.h,libdb.a,.libs/libdb_cxx-?.?.a} | sort) \
$(find openssl-* -name '*.a' -o -name '*.h' | sort) \
$(find miniupnpc -name '*.h' -o -name 'libminiupnpc.a' | sort)
# Kill wine processes as gitian won't figure out we are done otherwise
killall wineserver services.exe explorer.exe winedevice.exe

52
contrib/gitian-descriptors/gitian-win32.yml

@ -1,11 +1,12 @@
--- ---
name: "litecoin" name: "litecoin"
suites: suites:
- "lucid" - "precise"
architectures: architectures:
- "i386" - "amd64"
packages: packages:
- "mingw32" - "mingw-w64"
- "g++-mingw-w64"
- "git-core" - "git-core"
- "unzip" - "unzip"
- "nsis" - "nsis"
@ -15,35 +16,23 @@ remotes:
- "url": "https://github.com/litecoin-project/litecoin.git" - "url": "https://github.com/litecoin-project/litecoin.git"
"dir": "litecoin" "dir": "litecoin"
files: files:
- "qt-win32-4.8.3-gitian-r1.zip" - "qt-win32-4.8.3-gitian-r4.zip"
- "boost-win32-1.50.0-gitian2.zip" - "boost-win32-1.54.0-gitian-r6.zip"
- "litecoin-deps-0.0.5.zip" - "bitcoin-deps-win32-gitian-r9.zip"
script: | script: |
# #
mkdir $HOME/qt STAGING=$HOME/staging
cd $HOME/qt HOST=i686-w64-mingw32
unzip ../build/qt-win32-4.8.3-gitian-r1.zip
cd $HOME/build/
export PATH=$HOME/qt/bin/:$PATH
#
mkdir boost_1_50_0
cd boost_1_50_0
mkdir -p stage/lib
unzip ../boost-win32-1.50.0-gitian2.zip
cd bin/$GBUILD_BITS
for lib in *; do
i586-mingw32msvc-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o
i586-mingw32msvc-ranlib ../../stage/lib/libboost_${lib}-mt-s.a
done
cd ../..
mv include/boost .
cd ..
# #
unzip litecoin-deps-0.0.5.zip mkdir -p $STAGING
# cd $STAGING
find -type f | xargs touch --date="$REFERENCE_DATETIME" unzip ../build/qt-win32-4.8.3-gitian-r4.zip
unzip ../build/boost-win32-1.54.0-gitian-r6.zip
unzip ../build/bitcoin-deps-win32-gitian-r9.zip
cd $HOME/build/
# #
cd litecoin cd litecoin
export PATH=$STAGING/host/bin:$PATH
mkdir -p $OUTDIR/src mkdir -p $OUTDIR/src
git archive HEAD | tar -x -C $OUTDIR/src git archive HEAD | tar -x -C $OUTDIR/src
cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt
@ -51,17 +40,18 @@ script: |
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC export TZ=UTC
$HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_50_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_50_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1c OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1c/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=litecoin USE_BUILD_INFO=1 USE_SSE2=1 ln -s $STAGING $HOME/qt
$HOME/staging/host/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$STAGING MINIUPNPC_INCLUDE_PATH=$STAGING BDB_LIB_PATH=$STAGING BDB_INCLUDE_PATH=$STAGING BOOST_LIB_PATH=$STAGING BOOST_INCLUDE_PATH=$STAGING BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$STAGING OPENSSL_INCLUDE_PATH=$STAGING QRENCODE_LIB_PATH=$STAGING QRENCODE_INCLUDE_PATH=$STAGING USE_QRCODE=1 INCLUDEPATH=$STAGING DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=litecoin USE_SSE2=1
make $MAKEOPTS make $MAKEOPTS
i586-mingw32msvc-strip release/litecoin-qt.exe $HOST-strip release/litecoin-qt.exe
cp release/litecoin-qt.exe $OUTDIR/ cp release/litecoin-qt.exe $OUTDIR/
# #
cd src cd src
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC export TZ=UTC
make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build litecoind.exe USE_UPNP=0 DEBUGFLAGS="-frandom-seed=litecoin" USE_SSE2=1 make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$STAGING litecoind.exe USE_UPNP=0 DEBUGFLAGS="-frandom-seed=litecoin" USE_SSE2=1
i586-mingw32msvc-strip litecoind.exe $HOST-strip litecoind.exe
mkdir $OUTDIR/daemon mkdir $OUTDIR/daemon
cp litecoind.exe $OUTDIR/daemon cp litecoind.exe $OUTDIR/daemon
cd .. cd ..

41
contrib/gitian-descriptors/qt-win32.yml

@ -1,54 +1,63 @@
--- ---
name: "qt" name: "qt"
suites: suites:
- "lucid" - "precise"
architectures: architectures:
- "i386" - "amd64"
packages: packages:
- "mingw32" - "mingw-w64"
- "g++-mingw-w64"
- "zip" - "zip"
- "unzip"
- "faketime" - "faketime"
- "unzip"
reference_datetime: "2011-01-30 00:00:00" reference_datetime: "2011-01-30 00:00:00"
remotes: [] remotes: []
files: files:
- "qt-everywhere-opensource-src-4.8.3.tar.gz" - "qt-everywhere-opensource-src-4.8.3.tar.gz"
- "bitcoin-deps-win32-gitian-r9.zip"
script: | script: |
#
HOST=i686-w64-mingw32
INSTDIR="$HOME/qt/" INSTDIR="$HOME/qt/"
#
mkdir $INSTDIR mkdir $INSTDIR
SRCDIR="$INSTDIR/src/" mkdir -p $INSTDIR/host/bin
mkdir $SRCDIR #
# Need mingw-compiled openssl from bitcoin-deps:
unzip bitcoin-deps-win32-gitian-r9.zip
DEPSDIR=`pwd`
# #
tar xzf qt-everywhere-opensource-src-4.8.3.tar.gz tar xzf qt-everywhere-opensource-src-4.8.3.tar.gz
cd qt-everywhere-opensource-src-4.8.3 cd qt-everywhere-opensource-src-4.8.3
sed 's/$TODAY/2011-01-30/' -i configure sed 's/$TODAY/2011-01-30/' -i configure
sed 's/i686-pc-mingw32-/i586-mingw32msvc-/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed "s/i686-pc-mingw32-/$HOST-/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf
sed --posix 's|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/i586-mingw32msvc/include/ -frandom-seed=qtbuild|' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed --posix "s|QMAKE_CFLAGS\t\t= -pipe|QMAKE_CFLAGS\t\t= -pipe -isystem /usr/$HOST/include/ -frandom-seed=qtbuild|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf
sed 's/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed 's/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads/QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
sed 's/QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads/QMAKE_LFLAGS_EXCEPTIONS_ON = -lmingwthrd/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed 's/QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads/QMAKE_LFLAGS_EXCEPTIONS_ON = -lmingwthrd/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
sed --posix 's/QMAKE_MOC\t\t= i586-mingw32msvc-moc/QMAKE_MOC\t\t= moc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed --posix "s/QMAKE_MOC\t\t= $HOST-moc/QMAKE_MOC\t\t= moc/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf
sed --posix 's/QMAKE_RCC\t\t= i586-mingw32msvc-rcc/QMAKE_RCC\t\t= rcc/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed --posix "s/QMAKE_RCC\t\t= $HOST-rcc/QMAKE_RCC\t\t= rcc/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf
sed --posix 's/QMAKE_UIC\t\t= i586-mingw32msvc-uic/QMAKE_UIC\t\t= uic/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed --posix "s/QMAKE_UIC\t\t= $HOST-uic/QMAKE_UIC\t\t= uic/" -i mkspecs/unsupported/win32-g++-cross/qmake.conf
# ar adds timestamps to every object file included in the static library # ar adds timestamps to every object file included in the static library
# providing -D as ar argument is supposed to solve it, but doesn't work as qmake strips off the arguments and adds -M to pass a script... # providing -D as ar argument is supposed to solve it, but doesn't work as qmake strips off the arguments and adds -M to pass a script...
# which somehow cannot be combined with other flags. # which somehow cannot be combined with other flags.
# use faketime only for ar, as it confuses make/qmake into hanging sometimes # use faketime only for ar, as it confuses make/qmake into hanging sometimes
sed --posix "s|QMAKE_LIB\t\t= i586-mingw32msvc-ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf sed --posix "s|QMAKE_LIB\t\t= $HOST-ar -ru|QMAKE_LIB\t\t= $HOME/ar -Dr|" -i mkspecs/unsupported/win32-g++-cross/qmake.conf
echo '#!/bin/bash' > $HOME/ar echo '#!/bin/bash' > $HOME/ar
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> $HOME/ar
echo 'i586-mingw32msvc-ar "$@"' >> $HOME/ar echo "$HOST-ar \"\$@\"" >> $HOME/ar
chmod +x $HOME/ar chmod +x $HOME/ar
#export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC export TZ=UTC
./configure -prefix $INSTDIR -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs -no-feature-style-plastique -no-feature-style-cleanlooks -no-feature-style-motif -no-feature-style-cde -no-feature-style-windowsce -no-feature-style-windowsmobile -no-feature-style-s60 # Compile static libraries, and use statically linked openssl (-openssl-linked):
OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTDIR -bindir $INSTDIR/host/bin -I $DEPSDIR/include -confirm-license -release -opensource -static -no-qt3support -xplatform unsupported/win32-g++-cross -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs -no-feature-style-plastique -no-feature-style-cleanlooks -no-feature-style-motif -no-feature-style-cde -no-feature-style-windowsce -no-feature-style-windowsmobile -no-feature-style-s60 -openssl-linked
find . -name *.prl | xargs -l sed 's|/\.||' -i find . -name *.prl | xargs -l sed 's|/\.||' -i
find . -name *.prl | xargs -l sed 's|/$||' -i find . -name *.prl | xargs -l sed 's|/$||' -i
make $MAKEOPTS install make $MAKEOPTS install
cp -a bin $SRCDIR/
cd $INSTDIR cd $INSTDIR
find . -name *.prl | xargs -l sed 's|/$||' -i find . -name *.prl | xargs -l sed 's|/$||' -i
#sed 's|QMAKE_PRL_LIBS.*|QMAKE_PRL_LIBS = -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtNetwork -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32|' -i imports/Qt/labs/particles/qmlparticlesplugin.prl
# as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
zip -r $OUTDIR/qt-win32-4.8.3-gitian-r1.zip * zip -r $OUTDIR/qt-win32-4.8.3-gitian-r4.zip *

18
src/makefile.linux-mingw

@ -2,10 +2,10 @@
# Distributed under the MIT/X11 software license, see the accompanying # Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
DEPSDIR:=/usr/i586-mingw32msvc DEPSDIR:=/usr/i686-w64-mingw32
CC := i586-mingw32msvc-gcc CC := i686-w64-mingw32-gcc
CXX := i586-mingw32msvc-g++ CXX := i686-w64-mingw32-g++
USE_UPNP:=0 USE_UPNP:=0
USE_IPV6:=1 USE_IPV6:=1
@ -13,15 +13,11 @@ USE_IPV6:=1
INCLUDEPATHS= \ INCLUDEPATHS= \
-I"$(CURDIR)" \ -I"$(CURDIR)" \
-I"$(CURDIR)"/obj \ -I"$(CURDIR)"/obj \
-I"$(DEPSDIR)/boost_1_50_0" \ -I"$(DEPSDIR)/include" \
-I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
-I"$(DEPSDIR)/openssl-1.0.1c/include" \
-I"$(DEPSDIR)" -I"$(DEPSDIR)"
LIBPATHS= \ LIBPATHS= \
-L"$(DEPSDIR)/boost_1_50_0/stage/lib" \ -L"$(DEPSDIR)/lib"
-L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
-L"$(DEPSDIR)/openssl-1.0.1c"
LIBS= \ LIBS= \
$(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a \ $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a \
@ -38,7 +34,7 @@ DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE
DEBUGFLAGS=-g DEBUGFLAGS=-g
xCXXFLAGS=-O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) $(CXXFLAGS) xCXXFLAGS=-O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) $(CXXFLAGS)
# enable: ASLR, DEP and large address aware # enable: ASLR, DEP and large address aware
xLDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware $(LDFLAGS) xLDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -static-libgcc -static-libstdc++ $(LDFLAGS)
TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
@ -105,7 +101,7 @@ all: litecoind.exe
DEFS += -I"$(CURDIR)/leveldb/include" DEFS += -I"$(CURDIR)/leveldb/include"
DEFS += -I"$(CURDIR)/leveldb/helpers" DEFS += -I"$(CURDIR)/leveldb/helpers"
leveldb/libleveldb.a: leveldb/libleveldb.a:
@echo "Building LevelDB ..." && cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && i586-mingw32msvc-ranlib libleveldb.a && i586-mingw32msvc-ranlib libmemenv.a && cd .. @echo "Building LevelDB ..." && cd leveldb && TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && i686-w64-mingw32-ranlib libleveldb.a && i686-w64-mingw32-ranlib libmemenv.a && cd ..
obj/build.h: FORCE obj/build.h: FORCE
/bin/sh ../share/genbuild.sh obj/build.h /bin/sh ../share/genbuild.sh obj/build.h

Loading…
Cancel
Save