Upgrade dependancies and tweak build process.
authorMatt Corallo <matt@bluematt.me>
Thu, 11 Aug 2011 22:20:07 +0000 (00:20 +0200)
committerMatt Corallo <matt@bluematt.me>
Tue, 23 Aug 2011 17:00:34 +0000 (13:00 -0400)
* Upgrade to use miniupnpc 1.6
* Upgrade to wxWidgets 2.9.2
* Upgrade to Bost 1.47 for Win32 Builds

contrib/gitian-win32.yml
contrib/gitian.yml
contrib/wx-patches/README [deleted file]
contrib/wx-patches/toplevel.cpp.diff [deleted file]
contrib/wx-patches/toplevel.h.diff [deleted file]
doc/build-msw.txt
doc/build-osx.txt
doc/build-unix.txt
src/makefile.linux-mingw
src/makefile.mingw
src/net.cpp

index 07d31c7..d4b0843 100644 (file)
@@ -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++
         :
         <rc>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 <WSPiApi.h>|#include <WSPiApi.h>|' < 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
index 90be893..c4cdc89 100644 (file)
@@ -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 (file)
index 2afb4a9..0000000
+++ /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 (file)
index 359abf2..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
---- /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67326)\r
-+++ /wxWidgets/trunk/src/gtk/toplevel.cpp (revision 67496)\r
-@@ -72,4 +72,8 @@\r
- // send any activate events at all\r
- static int g_sendActivateEvent = -1;\r
-+\r
-+// Whether _NET_REQUEST_FRAME_EXTENTS support is working\r
-+//   0 == not tested yet, 1 == working, 2 == broken\r
-+static int gs_requestFrameExtentsStatus;\r
\r
- //-----------------------------------------------------------------------------\r
-@@ -432,4 +436,12 @@\r
-     if (event->state == GDK_PROPERTY_NEW_VALUE && event->atom == property)\r
-     {\r
-+        if (win->m_netFrameExtentsTimerId)\r
-+        {\r
-+            // WM support for _NET_REQUEST_FRAME_EXTENTS is working\r
-+            gs_requestFrameExtentsStatus = 1;\r
-+            g_source_remove(win->m_netFrameExtentsTimerId);\r
-+            win->m_netFrameExtentsTimerId = 0;\r
-+        }\r
-+\r
-         wxSize decorSize = win->m_decorSize;\r
-         int left, right, top, bottom;\r
-@@ -439,4 +451,22 @@\r
-         win->GTKUpdateDecorSize(decorSize);\r
-     }\r
-+    return false;\r
-+}\r
-+}\r
-+\r
-+extern "C" {\r
-+static gboolean request_frame_extents_timeout(void* data)\r
-+{\r
-+    // WM support for _NET_REQUEST_FRAME_EXTENTS is broken\r
-+    gs_requestFrameExtentsStatus = 2;\r
-+    gdk_threads_enter();\r
-+    wxTopLevelWindowGTK* win = static_cast<wxTopLevelWindowGTK*>(data);\r
-+    win->m_netFrameExtentsTimerId = 0;\r
-+    wxSize decorSize = win->m_decorSize;\r
-+    int left, right, top, bottom;\r
-+    if (wxGetFrameExtents(gtk_widget_get_window(win->m_widget), &left, &right, &top, &bottom))\r
-+        decorSize.Set(left + right, top + bottom);\r
-+    win->GTKUpdateDecorSize(decorSize);\r
-+    gdk_threads_leave();\r
-     return false;\r
- }\r
-@@ -459,4 +489,5 @@\r
-     m_deferShowAllowed = true;\r
-     m_updateDecorSize = true;\r
-+    m_netFrameExtentsTimerId = 0;\r
\r
-     m_urgency_hint = -2;\r
-@@ -811,5 +842,6 @@\r
-     if (deferShow)\r
-     {\r
--        deferShow = m_deferShowAllowed && !GTK_WIDGET_REALIZED(m_widget);\r
-+        deferShow = gs_requestFrameExtentsStatus != 2 &&\r
-+            m_deferShowAllowed && !gtk_widget_get_realized(m_widget);\r
-         if (deferShow)\r
-         {\r
-@@ -829,11 +861,4 @@\r
-             // GetSize()/SetSize() because it makes window bigger between each\r
-             // restore and save.\r
--            m_updateDecorSize = deferShow;\r
--        }\r
--        if (deferShow)\r
--        {\r
--            // Fluxbox support for _NET_REQUEST_FRAME_EXTENTS is broken\r
--            const char* name = gdk_x11_screen_get_window_manager_name(screen);\r
--            deferShow = strcmp(name, "Fluxbox") != 0;\r
-             m_updateDecorSize = deferShow;\r
-         }\r
-@@ -875,4 +900,12 @@\r
-             (XEvent*)&xevent);\r
\r
-+        if (gs_requestFrameExtentsStatus == 0)\r
-+        {\r
-+            // if WM does not respond to request within 1 second,\r
-+            // we assume support for _NET_REQUEST_FRAME_EXTENTS is not working\r
-+            m_netFrameExtentsTimerId =\r
-+                g_timeout_add(1000, request_frame_extents_timeout, this);\r
-+        }\r
-+\r
-         // defer calling gtk_widget_show()\r
-         m_isShown = true;\r
diff --git a/contrib/wx-patches/toplevel.h.diff b/contrib/wx-patches/toplevel.h.diff
deleted file mode 100644 (file)
index c2718d4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
---- /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 65373)\r
-+++ /wxWidgets/trunk/include/wx/gtk/toplevel.h (revision 67496)\r
-@@ -114,4 +114,6 @@\r
-     // wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.\r
-     int m_urgency_hint;\r
-+    // timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling\r
-+    unsigned m_netFrameExtentsTimerId;\r
\r
-     // return the size of the window without WM decorations\r
index 1911008..d08e3a2 100644 (file)
@@ -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
 -------
index ddf0250..52d876d 100644 (file)
@@ -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
 
 
index 0c4e88e..8f0c568 100644 (file)
@@ -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
 
index e2ef421..ddf9769 100644 (file)
@@ -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
index 96f81b3..a6654f3 100644 (file)
@@ -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
index 3953f02..c498c40 100644 (file)
 
 #ifdef __WXMSW__
 #include <string.h>
-// 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 <WSPiApi.h>
 #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));