From b4ada906c03111404c29b115ab37afbad92f4cf1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 12 Aug 2011 00:20:07 +0200 Subject: [PATCH 1/5] Upgrade dependancies and tweak build process. * Upgrade to use miniupnpc 1.6 * Upgrade to wxWidgets 2.9.2 * Upgrade to Bost 1.47 for Win32 Builds --- contrib/gitian-win32.yml | 42 ++++++-------- contrib/gitian.yml | 23 +++----- contrib/wx-patches/README | 4 -- contrib/wx-patches/toplevel.cpp.diff | 86 ---------------------------- contrib/wx-patches/toplevel.h.diff | 9 --- doc/build-msw.txt | 36 ++++++------ doc/build-osx.txt | 18 +++--- doc/build-unix.txt | 21 ++++--- src/makefile.linux-mingw | 21 ++++--- src/makefile.mingw | 28 ++++----- src/net.cpp | 15 +---- 11 files changed, 88 insertions(+), 215 deletions(-) delete mode 100644 contrib/wx-patches/README delete mode 100644 contrib/wx-patches/toplevel.cpp.diff delete mode 100644 contrib/wx-patches/toplevel.h.diff diff --git a/contrib/gitian-win32.yml b/contrib/gitian-win32.yml index 07d31c71..d4b0843e 100644 --- a/contrib/gitian-win32.yml +++ b/contrib/gitian-win32.yml @@ -14,17 +14,15 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "wxWidgets-2.9.1.tar.bz2" -- "boost_1_43_0.tar.bz2" +- "wxWidgets-2.9.2.tar.bz2" +- "boost_1_47_0.tar.bz2" - "openssl-1.0.0d.tar.gz" -- "db-4.7.25.NC.tar.gz" -- "upnpc-exe-win32-20110215.zip" -- "miniupnpc-1.5.20110215.tar.gz" -- "WSPiApi.h" +- "db-4.8.30.NC.tar.gz" +- "miniupnpc-1.6.tar.gz" script: | # - tar xjf wxWidgets-2.9.1.tar.bz2 - cd wxWidgets-2.9.1 + tar xjf wxWidgets-2.9.2.tar.bz2 + cd wxWidgets-2.9.2 ./configure --host=i586-mingw32msvc --build=i686-linux --disable-shared --enable-monolithic --without-libpng --disable-svg perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h make $MAKEOPTS @@ -36,14 +34,14 @@ script: | make cd .. # - tar xzf db-4.7.25.NC.tar.gz - cd db-4.7.25.NC/build_unix + tar xzf db-4.8.30.NC.tar.gz + cd db-4.8.30.NC/build_unix ../dist/configure --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include" make $MAKEOPTS cd ../.. # - tar xjf boost_1_43_0.tar.bz2 - cd boost_1_43_0 + tar xjf boost_1_47_0.tar.bz2 + cd boost_1_47_0 echo "using gcc : 4.4 : i586-mingw32msvc-g++ : i586-mingw32msvc-windres @@ -53,16 +51,13 @@ script: | ./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage cd .. # - mkdir upnpc-exe-win32-20110215 - cd upnpc-exe-win32-20110215 - unzip ../upnpc-exe-win32-20110215.zip - mkdir miniupnpc - cd miniupnpc - tar xzf ../../miniupnpc-1.5.20110215.tar.gz - mv ./miniupnpc-1.5.20110215/* ./ - cd ../.. - # - cp WSPiApi.h $HOME/build + tar xzf miniupnpc-1.6.tar.gz + cd miniupnpc-1.6 + sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw + sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw + make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar + cd .. + mv miniupnpc-1.6 miniupnpc # cd bitcoin mkdir -p $OUTDIR/src @@ -72,8 +67,7 @@ script: | cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt cp $OUTDIR/src/COPYING $OUTDIR/license.txt cd src - sed 's/$(DEBUGFLAGS)//' < makefile.linux-mingw > makefile.linux-mingw.2 && mv makefile.linux-mingw.2 makefile.linux-mingw - sed 's|//#include |#include |' < net.cpp > net.cpp.2 && mv net.cpp.2 net.cpp + sed 's/$(DEBUGFLAGS)//' -i makefile.linux-mingw make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoin.exe USE_UPNP=1 make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoind.exe USE_UPNP=0 i586-mingw32msvc-strip bitcoin.exe diff --git a/contrib/gitian.yml b/contrib/gitian.yml index 90be8934..c4cdc899 100644 --- a/contrib/gitian.yml +++ b/contrib/gitian.yml @@ -6,7 +6,7 @@ architectures: - "i386" - "amd64" packages: -- "libdb4.7++-dev" +- "libdb4.8++-dev" - "libxxf86vm-dev" - "libgtk2.0-dev" - "libboost-all-dev" @@ -17,26 +17,19 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "wxWidgets-2.9.1.tar.bz2" -- "miniupnpc-1.5.tar.gz" -- "toplevel.h.diff" -- "toplevel.cpp.diff" +- "wxWidgets-2.9.2.tar.bz2" +- "miniupnpc-1.6.tar.gz" script: | INSTDIR="$HOME/install" export LIBRARY_PATH="$INSTDIR/lib" # - tar xzf miniupnpc-1.5.tar.gz - cd miniupnpc-1.5 + tar xzf miniupnpc-1.6.tar.gz + cd miniupnpc-1.6 INSTALLPREFIX=$INSTDIR make $MAKEOPTS install cd .. # - tar xjf wxWidgets-2.9.1.tar.bz2 - cd wxWidgets-2.9.1 - cd include/wx/gtk - patch < ../../../../toplevel.h.diff - cd ../../../src/gtk - patch < ../../../toplevel.cpp.diff - cd ../.. + tar xjf wxWidgets-2.9.2.tar.bz2 + cd wxWidgets-2.9.2 ./configure --prefix=$INSTDIR --enable-monolithic --disable-shared perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h make $MAKEOPTS install @@ -50,7 +43,7 @@ script: | cp $OUTDIR/src/doc/README $OUTDIR cp $OUTDIR/src/COPYING $OUTDIR cd src - sed 's/$(DEBUGFLAGS)//' < makefile.unix > makefile.unix.2 && mv makefile.unix.2 makefile.unix + sed 's/$(DEBUGFLAGS)//' -i makefile.unix PATH=$INSTDIR/bin:$PATH make -f makefile.unix CXX="g++ -I$INSTDIR/include -L$INSTDIR/lib" $MAKEOPTS bitcoin USE_UPNP=1 PATH=$INSTDIR/bin:$PATH make -f makefile.unix CXX="g++ -I$INSTDIR/include -L$INSTDIR/lib" $MAKEOPTS bitcoind USE_UPNP=0 mkdir -p $OUTDIR/bin/$GBUILD_BITS diff --git a/contrib/wx-patches/README b/contrib/wx-patches/README deleted file mode 100644 index 2afb4a9e..00000000 --- a/contrib/wx-patches/README +++ /dev/null @@ -1,4 +0,0 @@ -This folder contains two patches which are applied to wxWidgets -2.9.1 before building the wxWidgets which is used for release -versions of bitcoin. They make the GUI show up on newer OSs -with new libgtks, such as Ubuntu 11.04. diff --git a/contrib/wx-patches/toplevel.cpp.diff b/contrib/wx-patches/toplevel.cpp.diff deleted file mode 100644 index 359abf28..00000000 --- a/contrib/wx-patches/toplevel.cpp.diff +++ /dev/null @@ -1,86 +0,0 @@ ---- /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67326) -+++ /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67496) -@@ -72,4 +72,8 @@ - // send any activate events at all - static int g_sendActivateEvent = -1; -+ -+// Whether _NET_REQUEST_FRAME_EXTENTS support is working -+// 0 == not tested yet, 1 == working, 2 == broken -+static int gs_requestFrameExtentsStatus; - - //----------------------------------------------------------------------------- -@@ -432,4 +436,12 @@ - if (event->state == GDK_PROPERTY_NEW_VALUE && event->atom == property) - { -+ if (win->m_netFrameExtentsTimerId) -+ { -+ // WM support for _NET_REQUEST_FRAME_EXTENTS is working -+ gs_requestFrameExtentsStatus = 1; -+ g_source_remove(win->m_netFrameExtentsTimerId); -+ win->m_netFrameExtentsTimerId = 0; -+ } -+ - wxSize decorSize = win->m_decorSize; - int left, right, top, bottom; -@@ -439,4 +451,22 @@ - win->GTKUpdateDecorSize(decorSize); - } -+ return false; -+} -+} -+ -+extern "C" { -+static gboolean request_frame_extents_timeout(void* data) -+{ -+ // WM support for _NET_REQUEST_FRAME_EXTENTS is broken -+ gs_requestFrameExtentsStatus = 2; -+ gdk_threads_enter(); -+ wxTopLevelWindowGTK* win = static_cast(data); -+ win->m_netFrameExtentsTimerId = 0; -+ wxSize decorSize = win->m_decorSize; -+ int left, right, top, bottom; -+ if (wxGetFrameExtents(gtk_widget_get_window(win->m_widget), &left, &right, &top, &bottom)) -+ decorSize.Set(left + right, top + bottom); -+ win->GTKUpdateDecorSize(decorSize); -+ gdk_threads_leave(); - return false; - } -@@ -459,4 +489,5 @@ - m_deferShowAllowed = true; - m_updateDecorSize = true; -+ m_netFrameExtentsTimerId = 0; - - m_urgency_hint = -2; -@@ -811,5 +842,6 @@ - if (deferShow) - { -- deferShow = m_deferShowAllowed && !GTK_WIDGET_REALIZED(m_widget); -+ deferShow = gs_requestFrameExtentsStatus != 2 && -+ m_deferShowAllowed && !gtk_widget_get_realized(m_widget); - if (deferShow) - { -@@ -829,11 +861,4 @@ - // GetSize()/SetSize() because it makes window bigger between each - // restore and save. -- m_updateDecorSize = deferShow; -- } -- if (deferShow) -- { -- // Fluxbox support for _NET_REQUEST_FRAME_EXTENTS is broken -- const char* name = gdk_x11_screen_get_window_manager_name(screen); -- deferShow = strcmp(name, "Fluxbox") != 0; - m_updateDecorSize = deferShow; - } -@@ -875,4 +900,12 @@ - (XEvent*)&xevent); - -+ if (gs_requestFrameExtentsStatus == 0) -+ { -+ // if WM does not respond to request within 1 second, -+ // we assume support for _NET_REQUEST_FRAME_EXTENTS is not working -+ m_netFrameExtentsTimerId = -+ g_timeout_add(1000, request_frame_extents_timeout, this); -+ } -+ - // defer calling gtk_widget_show() - m_isShown = true; diff --git a/contrib/wx-patches/toplevel.h.diff b/contrib/wx-patches/toplevel.h.diff deleted file mode 100644 index c2718d46..00000000 --- a/contrib/wx-patches/toplevel.h.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 65373) -+++ /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 67496) -@@ -114,4 +114,6 @@ - // wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle. - int m_urgency_hint; -+ // timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling -+ unsigned m_netFrameExtentsTimerId; - - // return the size of the window without WM decorations diff --git a/doc/build-msw.txt b/doc/build-msw.txt index 1911008d..d08e3a23 100644 --- a/doc/build-msw.txt +++ b/doc/build-msw.txt @@ -27,11 +27,11 @@ Dependencies Libraries you need to download separately and build: default path download -wxWidgets \wxwidgets-2.9.1-mgw http://www.wxwidgets.org/downloads/ +wxWidgets \wxwidgets-2.9.2-mgw http://www.wxwidgets.org/downloads/ OpenSSL \openssl-1.0.0d-mgw http://www.openssl.org/source/ -Berkeley DB \db-4.7.25.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html -Boost \boost-1.43.0-mgw http://www.boost.org/users/download/ -miniupnpc \upnpc-exe-win32-20110215 http://miniupnp.tuxfamily.org/files/ +Berkeley DB \db-4.8.30.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html +Boost \boost-1.47.0-mgw http://www.boost.org/users/download/ +miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/ Their licenses: wxWidgets LGPL 2.1 with very liberal exceptions @@ -41,11 +41,11 @@ Boost MIT-like license miniupnpc New (3-clause) BSD license Versions used in this release: -wxWidgets 2.9.1 +wxWidgets 2.9.2 OpenSSL 1.0.0d -Berkeley DB 4.7.25.NC -Boost 1.43.0 -miniupnpc 1.5-20110215 +Berkeley DB 4.8.30.NC +Boost 1.47.0 +miniupnpc 1.6 Notes @@ -57,7 +57,7 @@ classes that do the rote work of constructing all the UI elements. wxWidgets --------- DOS shell: -cd \wxWidgets-2.9.1-mgw\build\msw +cd \wxWidgets-2.9.2-mgw\build\msw mingw32-make -f makefile.gcc OpenSSL @@ -73,30 +73,26 @@ make Berkeley DB ----------- MSYS shell: -cd /c/db-4.7.25.NC-mgw/build_unix +cd /c/db-4.8.30.NC-mgw/build_unix sh ../dist/configure --enable-mingw --enable-cxx make - Boost ----- DOS prompt: downloaded boost jam 3.1.18 -cd \boost-1.43.0-mgw +cd \boost-1.47.0-mgw bjam toolset=gcc --build-type=complete stage -Note: -building with boost 1.45.0 failed because of boost ticket 4614, 4258 -builds fine with boost 1.43.0 - MiniUPnPc --------- -Building miniupnpc failed on Windows Server 2003, thus it is expected that a binary copy will be used. -See http://miniupnp.tuxfamily.org/forum/viewtopic.php?t=642 UPnP support is optional, make with USE_UPNP= to disable it. -Get upnpc-exe-win32-20110215.zip and unzip it to \upnpc-exe-win32-20110215 -Get miniupnpc-1.5.20110215.tar.gz and copy *.h to \upnpc-exe-win32-20110215\miniupnpc +MSYS shell: +cd /c/miniupnpc-1.6-mgw +make -f Makefile.mingw +mkdir miniupnpc +cp *.h miniupnpc/ Bitcoin ------- diff --git a/doc/build-osx.txt b/doc/build-osx.txt index ddf02500..52d876d8 100644 --- a/doc/build-osx.txt +++ b/doc/build-osx.txt @@ -135,18 +135,18 @@ The process for miniupnpc (optional) is similar to that of OpenSSL. Download from http://miniupnp.tuxfamily.org/files/. cd ~/bitcoin/deps -tar xvf ~/Downloads/miniupnpc-1.5.tar -mv miniupnpc-1.5 miniupnpc-1.5-x86_64 -tar xvf ~/Downloads/miniupnpc-1.5.tar -mv miniupnpc-1.5 miniupnpc-1.5-i386 +tar xvf ~/Downloads/miniupnpc-1.6.tar +mv miniupnpc-1.6 miniupnpc-1.6-x86_64 +tar xvf ~/Downloads/miniupnpc-1.6.tar +mv miniupnpc-1.6 miniupnpc-1.6-i386 # build x86_64 (64 bit intel) binary -cd miniupnpc-1.5-x86_64 +cd miniupnpc-1.6-x86_64 export CFLAGS="-arch x86_64" export LDFLAGS="-arch x86_64" export PREFIX="/Users/macuser/bitcoin/deps" make && make install # build i386 (32 bit intel) binary -cd miniupnpc-1.5-i386 +cd miniupnpc-1.6-i386 export CFLAGS="-arch i386" export LDFLAGS="-arch i386" export PREFIX="/Users/macuser/bitcoin/deps" @@ -154,7 +154,7 @@ make # combine the libs cd ~/bitcoin/deps -lipo -arch i386 miniupnpc-1.5-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.5-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create +lipo -arch i386 miniupnpc-1.6-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.6-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create Verify your binaries @@ -175,8 +175,8 @@ Berkeley DB Download from http://freshmeat.net/projects/berkeleydb/ cd ~/bitcoin/deps -tar xvf ~/Downloads/db-4.8.26.tar -cd db-4.8.26/build_unix +tar xvf ~/Downloads/db-4.8.30.tar +cd db-4.8.30/build_unix ../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install diff --git a/doc/build-unix.txt b/doc/build-unix.txt index 0c4e88e5..8f0c568e 100644 --- a/doc/build-unix.txt +++ b/doc/build-unix.txt @@ -25,8 +25,8 @@ Dependencies sudo apt-get install build-essential sudo apt-get install libgtk2.0-dev sudo apt-get install libssl-dev -sudo apt-get install libdb4.7-dev -sudo apt-get install libdb4.7++-dev +sudo apt-get install libdb4.8-dev +sudo apt-get install libdb4.8++-dev Boost 1.40+: sudo apt-get install libboost-all-dev or Boost 1.37: sudo apt-get install libboost1.37-dev @@ -55,10 +55,10 @@ miniupnpc New (3-clause) BSD license Versions used in this release: GCC 4.3.3 OpenSSL 0.9.8g -wxWidgets 2.9.0 -Berkeley DB 4.7.25.NC +wxWidgets 2.9.2 +Berkeley DB 4.8.30.NC Boost 1.37 -miniupnpc 1.5 +miniupnpc 1.6 Notes @@ -74,8 +74,8 @@ symbols, which reduces the executable size by about 90%. wxWidgets --------- cd /usr/local -tar -xzvf wxWidgets-2.9.0.tar.gz -cd wxWidgets-2.9.0 +tar -xzvf wxWidgets-2.9.2.tar.gz +cd wxWidgets-2.9.2 mkdir buildgtk cd buildgtk ../configure --with-gtk --enable-debug --disable-shared --enable-monolithic --without-libpng --disable-svg @@ -87,8 +87,8 @@ ldconfig miniupnpc --------- -tar -xzvf miniupnpc-1.5.tar.gz -cd miniupnpc-1.5 +tar -xzvf miniupnpc-1.6.tar.gz +cd miniupnpc-1.6 make sudo su make install @@ -96,8 +96,7 @@ make install Berkeley DB ----------- -You need Berkeley DB 4.7. Don't use 4.8, the database/log0000* files -are incompatible. If you have to build Berkeley DB yourself: +You need Berkeley DB 4.8. If you have to build Berkeley DB yourself: ../dist/configure --enable-cxx make diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index e2ef4213..ddf97690 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -7,19 +7,19 @@ DEPSDIR:=/usr/i586-mingw32msvc USE_UPNP:=0 INCLUDEPATHS= \ - -I"$(DEPSDIR)/boost_1_43_0" \ - -I"$(DEPSDIR)/db-4.7.25.NC/build_unix" \ + -I"$(DEPSDIR)/boost_1_47_0" \ + -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ -I"$(DEPSDIR)/openssl-1.0.0d/include" \ - -I"$(DEPSDIR)/wxWidgets-2.9.1/lib/gcc_lib/mswud" \ - -I"$(DEPSDIR)/wxWidgets-2.9.1/include" \ - -I"$(DEPSDIR)/wxWidgets-2.9.1/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \ + -I"$(DEPSDIR)/wxWidgets-2.9.2/lib/gcc_lib/mswud" \ + -I"$(DEPSDIR)/wxWidgets-2.9.2/include" \ + -I"$(DEPSDIR)/wxWidgets-2.9.2/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \ -I"$(DEPSDIR)" LIBPATHS= \ - -L"$(DEPSDIR)/boost_1_43_0/stage/lib" \ - -L"$(DEPSDIR)/db-4.7.25.NC/build_unix" \ + -L"$(DEPSDIR)/boost_1_47_0/stage/lib" \ + -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ -L"$(DEPSDIR)/openssl-1.0.0d" \ - -L"$(DEPSDIR)/wxWidgets-2.9.1/lib" + -L"$(DEPSDIR)/wxWidgets-2.9.2/lib" WXLIBS= -l wx_mswu-2.9-i586-mingw32msvc @@ -32,7 +32,7 @@ LIBS= \ -l ssl \ -l crypto -DEFS=-D_MT -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL +DEFS=-D_MT -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB DEBUGFLAGS=-g -D__WXDEBUG__ CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \ @@ -40,8 +40,7 @@ HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h crypter.h init.h ifdef USE_UPNP - INCLUDEPATHS += -I"$(DEPSDIR)/upnpc-exe-win32-20110215" - LIBPATHS += -L"$(DEPSDIR)/upnpc-exe-win32-20110215" + LIBPATHS += -L"$(DEPSDIR)/miniupnpc" LIBS += -l miniupnpc -l iphlpapi DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) endif diff --git a/src/makefile.mingw b/src/makefile.mingw index 96f81b30..a6654f30 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -5,31 +5,31 @@ USE_UPNP:=0 INCLUDEPATHS= \ - -I"C:\boost-1.43.0-mgw" \ - -I"C:\db-4.7.25.NC-mgw\build_unix" \ + -I"C:\boost-1.47.0-mgw" \ + -I"C:\db-4.8.30.NC-mgw\build_unix" \ -I"C:\openssl-1.0.0d-mgw\include" \ - -I"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib\mswud" \ - -I"C:\wxWidgets-2.9.1-mgw\include" + -I"C:\wxWidgets-2.9.2-mgw\lib\gcc_lib\mswud" \ + -I"C:\wxWidgets-2.9.2-mgw\include" LIBPATHS= \ - -L"C:\boost-1.43.0-mgw\stage\lib" \ - -L"C:\db-4.7.25.NC-mgw\build_unix" \ + -L"C:\boost-1.47.0-mgw\stage\lib" \ + -L"C:\db-4.8.30.NC-mgw\build_unix" \ -L"C:\openssl-1.0.0d-mgw" \ - -L"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib" + -L"C:\wxWidgets-2.9.2-mgw\lib\gcc_lib" WXLIBS= \ -l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd LIBS= \ - -l boost_system-mgw45-mt-s-1_43 \ - -l boost_filesystem-mgw45-mt-s-1_43 \ - -l boost_program_options-mgw45-mt-s-1_43 \ - -l boost_thread-mgw45-mt-s-1_43 \ + -l boost_system-mgw45-mt-s-1_47 \ + -l boost_filesystem-mgw45-mt-s-1_47 \ + -l boost_program_options-mgw45-mt-s-1_47 \ + -l boost_thread-mgw45-mt-s-1_47 \ -l db_cxx \ -l ssl \ -l crypto -DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL +DEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH -DUSE_SSL -DBOOST_THREAD_USE_LIB DEBUGFLAGS=-g -D__WXDEBUG__ CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \ @@ -37,8 +37,8 @@ HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h init.h crypter.h ifdef USE_UPNP - INCLUDEPATHS += -I"C:\upnpc-exe-win32-20110215" - LIBPATHS += -L"C:\upnpc-exe-win32-20110215" + INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw" + LIBPATHS += -L"C:\miniupnpc-1.6-mgw" LIBS += -l miniupnpc -l iphlpapi DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) endif diff --git a/src/net.cpp b/src/net.cpp index 3953f021..c498c401 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -12,11 +12,6 @@ #ifdef __WXMSW__ #include -// This file can be downloaded as a part of the Windows Platform SDK -// and is required for Bitcoin binaries to work properly on versions -// of Windows before XP. If you are doing builds of Bitcoin for -// public release, you should uncomment this line. -//#include #endif #ifdef USE_UPNP @@ -1079,10 +1074,11 @@ void ThreadMapPort2(void* parg) const char * rootdescurl = 0; const char * multicastif = 0; const char * minissdpdpath = 0; + int error = 0; struct UPNPDev * devlist = 0; char lanaddr[64]; - devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0); + devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); struct UPNPUrls urls; struct IGDdatas data; @@ -1094,14 +1090,9 @@ void ThreadMapPort2(void* parg) char intClient[16]; char intPort[6]; string strDesc = "Bitcoin " + FormatFullVersion(); - -#ifndef __WXMSW__ - r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, - port, port, lanaddr, strDesc.c_str(), "TCP", 0); -#else r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0"); -#endif + if(r!=UPNPCOMMAND_SUCCESS) printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", port, port, lanaddr, r, strupnperror(r)); From d2cbb14d7c7258e08cd5e67d64bf163a68e1a8d8 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Tue, 23 Aug 2011 08:33:53 -0400 Subject: [PATCH 2/5] Linux gitian config with separate wxWidgets build --- contrib/gitian.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/contrib/gitian.yml b/contrib/gitian.yml index c4cdc899..9f03ba1b 100644 --- a/contrib/gitian.yml +++ b/contrib/gitian.yml @@ -12,12 +12,13 @@ packages: - "libboost-all-dev" - "libssl-dev" - "git-core" +- "unzip" reference_datetime: "2011-01-30 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "wxWidgets-2.9.2.tar.bz2" +- "wxWidgets-2.9.2-gitian.zip" - "miniupnpc-1.6.tar.gz" script: | INSTDIR="$HOME/install" @@ -28,11 +29,17 @@ script: | INSTALLPREFIX=$INSTDIR make $MAKEOPTS install cd .. # - tar xjf wxWidgets-2.9.2.tar.bz2 + mkdir -p $INSTDIR/bin $INSTDIR/lib/wx $INSTDIR/include + mkdir wxWidgets-2.9.2 cd wxWidgets-2.9.2 - ./configure --prefix=$INSTDIR --enable-monolithic --disable-shared - perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h - make $MAKEOPTS install + unzip ../wxWidgets-2.9.2-gitian.zip + cp -a bin/$GBUILD_BITS/wx/config/gtk2-unicode-static-2.9 $INSTDIR/bin/wx-config + for lib in wx_gtk2u wxregexu wxtiff; do + ar rc $INSTDIR/lib/lib${lib}-2.9.a bin/$GBUILD_BITS/$lib/*.o + ranlib $INSTDIR/lib/lib${lib}-2.9.a + done + cp -a include/wx-2.9/* $INSTDIR/include + cp -a bin/$GBUILD_BITS/wx/include $INSTDIR/lib/wx cd .. # cd bitcoin From bef41ada0d708053a80c4a141221c8f6efbd1626 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Tue, 23 Aug 2011 08:42:11 -0400 Subject: [PATCH 3/5] Mingw gitian with separate wxWidgets and boost --- contrib/gitian-win32.yml | 43 ++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/contrib/gitian-win32.yml b/contrib/gitian-win32.yml index d4b0843e..9dce28fb 100644 --- a/contrib/gitian-win32.yml +++ b/contrib/gitian-win32.yml @@ -14,18 +14,38 @@ remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" files: -- "wxWidgets-2.9.2.tar.bz2" -- "boost_1_47_0.tar.bz2" +- "wxwidgets-win32-2.9.2-gitian.zip" +- "boost-win32-1.47.0-gitian.zip" - "openssl-1.0.0d.tar.gz" - "db-4.8.30.NC.tar.gz" - "miniupnpc-1.6.tar.gz" script: | # - tar xjf wxWidgets-2.9.2.tar.bz2 + mkdir wxWidgets-2.9.2 cd wxWidgets-2.9.2 - ./configure --host=i586-mingw32msvc --build=i686-linux --disable-shared --enable-monolithic --without-libpng --disable-svg - perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h - make $MAKEOPTS + mkdir lib + unzip ../wxwidgets-win32-2.9.2-gitian.zip + cd bin/$GBUILD_BITS + for lib in wx_mswu; do + i586-mingw32msvc-ar rc ../../lib/lib${lib}-2.9-i586-mingw32msvc.a $lib/*.o + i586-mingw32msvc-ranlib ../../lib/lib${lib}-2.9-i586-mingw32msvc.a + done + cp -a wx ../../lib + cd ../.. + mv include/wx-2.9/wx include + cd .. + # + mkdir boost_1_47_0 + cd boost_1_47_0 + mkdir -p stage/lib + unzip ../boost-win32-1.47.0-gitian.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 .. # tar xzf openssl-1.0.0d.tar.gz @@ -40,17 +60,6 @@ script: | make $MAKEOPTS cd ../.. # - tar xjf boost_1_47_0.tar.bz2 - cd boost_1_47_0 - echo "using gcc : 4.4 : i586-mingw32msvc-g++ - : - i586-mingw32msvc-windres - i586-mingw32msvc-ar - ;" > user-config.jam - ./bootstrap.sh --without-icu - ./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage - cd .. - # tar xzf miniupnpc-1.6.tar.gz cd miniupnpc-1.6 sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw From 3bb23e5c8b0d760f587a6a97089b50e9d45b9a95 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Tue, 23 Aug 2011 08:43:24 -0400 Subject: [PATCH 4/5] Mingw gitian build with deterministic bitcoin.exe by use of faketime --- contrib/gitian-win32.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/gitian-win32.yml b/contrib/gitian-win32.yml index 9dce28fb..963c3813 100644 --- a/contrib/gitian-win32.yml +++ b/contrib/gitian-win32.yml @@ -9,6 +9,7 @@ packages: - "git-core" - "unzip" - "nsis" +- "faketime" reference_datetime: "2011-01-30 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" @@ -76,7 +77,10 @@ script: | cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt cp $OUTDIR/src/COPYING $OUTDIR/license.txt cd src - sed 's/$(DEBUGFLAGS)//' -i makefile.linux-mingw + sed 's/$(DEBUGFLAGS)/-frandom-seed=bitcoin/' -i makefile.linux-mingw + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + export TZ=UTC make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoin.exe USE_UPNP=1 make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoind.exe USE_UPNP=0 i586-mingw32msvc-strip bitcoin.exe From e40bef3c0a1a208f795c1e265d6e8a7244afe5f6 Mon Sep 17 00:00:00 2001 From: Dev Random Date: Tue, 23 Aug 2011 12:46:45 -0400 Subject: [PATCH 5/5] Add Gitian Build descriptors for Boost and wxWidgets. --- contrib/boost-win32.yml | 38 +++++++++++++++++++++++++++++++++ contrib/wxwidgets-win32.yml | 40 +++++++++++++++++++++++++++++++++++ contrib/wxwidgets.yml | 42 +++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 contrib/boost-win32.yml create mode 100644 contrib/wxwidgets-win32.yml create mode 100644 contrib/wxwidgets.yml diff --git a/contrib/boost-win32.yml b/contrib/boost-win32.yml new file mode 100644 index 00000000..61ea50e4 --- /dev/null +++ b/contrib/boost-win32.yml @@ -0,0 +1,38 @@ +--- +name: "boost" +suites: +- "lucid" +architectures: +- "i386" +packages: +- "mingw32" +- "faketime" +- "zip" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "boost_1_47_0.tar.bz2" +script: | + TMPDIR="$HOME/tmpdir" + mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include + tar xjf boost_1_47_0.tar.bz2 + cd boost_1_47_0 + echo "using gcc : 4.4 : i586-mingw32msvc-g++ + : + i586-mingw32msvc-windres + i586-mingw32msvc-ar + -frandom-seed=boost1 + ;" > user-config.jam + ./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 + mkdir $lib + (cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a) + mv $lib $TMPDIR/bin/$GBUILD_BITS + done + cp -a boost $TMPDIR/include + cd $TMPDIR + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + zip -r boost-win32-1.47.0-gitian.zip * + cp boost-win32-1.47.0-gitian.zip $OUTDIR diff --git a/contrib/wxwidgets-win32.yml b/contrib/wxwidgets-win32.yml new file mode 100644 index 00000000..3d49d7b3 --- /dev/null +++ b/contrib/wxwidgets-win32.yml @@ -0,0 +1,40 @@ +--- +name: "wxwidgets" +suites: +- "lucid" +architectures: +- "i386" +packages: +- "mingw32" +- "faketime" +- "zip" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "wxWidgets-2.9.2.tar.bz2" +script: | + INSTDIR="$HOME/install" + TMPDIR="$HOME/tmpdir" + export LIBRARY_PATH="$INSTDIR/lib" + # + tar xjf wxWidgets-2.9.2.tar.bz2 + cd wxWidgets-2.9.2 + CXXFLAGS=-frandom-seed=wx1 ./configure --host=i586-mingw32msvc --build=i686-linux --prefix=$INSTDIR --disable-shared --enable-monolithic --without-libpng --disable-svg + perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h + make $MAKEOPTS install + mkdir $TMPDIR + cd $TMPDIR + cp -af $INSTDIR/include . + mkdir -p $TMPDIR/bin/$GBUILD_BITS + cd $TMPDIR/bin/$GBUILD_BITS + cp -af $INSTDIR/lib/wx . + for lib in wx_mswu; do + mkdir $lib + (cd $lib ; ar xf $INSTDIR/lib/lib${lib}-2.9-i586-mingw32msvc.a) + done + chmod -R +w $TMPDIR + cd $TMPDIR + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + zip -r wxwidgets-win32-2.9.2-gitian.zip * + cp wxwidgets-win32-2.9.2-gitian.zip $OUTDIR diff --git a/contrib/wxwidgets.yml b/contrib/wxwidgets.yml new file mode 100644 index 00000000..a2406936 --- /dev/null +++ b/contrib/wxwidgets.yml @@ -0,0 +1,42 @@ +--- +name: "wxwidgets" +suites: +- "lucid" +architectures: +- "i386" +- "amd64" +packages: +- "libxxf86vm-dev" +- "libgtk2.0-dev" +- "faketime" +- "zip" +reference_datetime: "2011-01-30 00:00:00" +remotes: [] +files: +- "wxWidgets-2.9.2.tar.bz2" +script: | + INSTDIR="$HOME/install" + TMPDIR="$HOME/tmpdir" + export LIBRARY_PATH="$INSTDIR/lib" + # + tar xjf wxWidgets-2.9.2.tar.bz2 + cd wxWidgets-2.9.2 + ./configure --prefix=$INSTDIR --enable-monolithic --disable-shared + perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h + make $MAKEOPTS install + mkdir $TMPDIR + cd $TMPDIR + cp -af $INSTDIR/include . + mkdir -p $TMPDIR/bin/$GBUILD_BITS + cd $TMPDIR/bin/$GBUILD_BITS + cp -af $INSTDIR/lib/wx . + for lib in wxtiff wxregexu wx_gtk2u; do + mkdir $lib + (cd $lib ; ar xf $INSTDIR/lib/lib${lib}-2.9.a) + done + chmod -R +w $TMPDIR + cd $TMPDIR + export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 + export FAKETIME=$REFERENCE_DATETIME + zip -r wxWidgets-2.9.2-gitian.zip * + cp wxWidgets-2.9.2-gitian.zip $OUTDIR