Merge pull request #464 from TheBlueMatt/upnp1.6

Upgrade dependancies and tweak build process.
This commit is contained in:
Jeff Garzik 2011-08-31 09:16:56 -07:00
commit 8af99d1893
14 changed files with 242 additions and 229 deletions

38
contrib/boost-win32.yml Normal file
View File

@ -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++
:
<rc>i586-mingw32msvc-windres
<archiver>i586-mingw32msvc-ar
<cxxflags>-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

View File

@ -9,25 +9,44 @@ packages:
- "git-core" - "git-core"
- "unzip" - "unzip"
- "nsis" - "nsis"
- "faketime"
reference_datetime: "2011-01-30 00:00:00" reference_datetime: "2011-01-30 00:00:00"
remotes: remotes:
- "url": "https://github.com/bitcoin/bitcoin.git" - "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin" "dir": "bitcoin"
files: files:
- "wxWidgets-2.9.1.tar.bz2" - "wxwidgets-win32-2.9.2-gitian.zip"
- "boost_1_43_0.tar.bz2" - "boost-win32-1.47.0-gitian.zip"
- "openssl-1.0.0d.tar.gz" - "openssl-1.0.0d.tar.gz"
- "db-4.7.25.NC.tar.gz" - "db-4.8.30.NC.tar.gz"
- "upnpc-exe-win32-20110215.zip" - "miniupnpc-1.6.tar.gz"
- "miniupnpc-1.5.20110215.tar.gz"
- "WSPiApi.h"
script: | script: |
# #
tar xjf wxWidgets-2.9.1.tar.bz2 mkdir wxWidgets-2.9.2
cd wxWidgets-2.9.1 cd wxWidgets-2.9.2
./configure --host=i586-mingw32msvc --build=i686-linux --disable-shared --enable-monolithic --without-libpng --disable-svg mkdir lib
perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h unzip ../wxwidgets-win32-2.9.2-gitian.zip
make $MAKEOPTS 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 .. cd ..
# #
tar xzf openssl-1.0.0d.tar.gz tar xzf openssl-1.0.0d.tar.gz
@ -36,33 +55,19 @@ script: |
make make
cd .. cd ..
# #
tar xzf db-4.7.25.NC.tar.gz tar xzf db-4.8.30.NC.tar.gz
cd db-4.7.25.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 --enable-mingw --enable-cxx --host=i586-mingw32msvc CFLAGS="-I/usr/i586-mingw32msvc/include"
make $MAKEOPTS make $MAKEOPTS
cd ../.. cd ../..
# #
tar xjf boost_1_43_0.tar.bz2 tar xzf miniupnpc-1.6.tar.gz
cd boost_1_43_0 cd miniupnpc-1.6
echo "using gcc : 4.4 : i586-mingw32msvc-g++ sed 's/dllwrap -k --driver-name gcc/$(DLLWRAP) -k --driver-name $(CC)/' -i Makefile.mingw
: sed 's|wingenminiupnpcstrings $< $@|./wingenminiupnpcstrings $< $@|' -i Makefile.mingw
<rc>i586-mingw32msvc-windres make -f Makefile.mingw DLLWRAP=i586-mingw32msvc-dllwrap CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar
<archiver>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 .. cd ..
# mv miniupnpc-1.6 miniupnpc
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
# #
cd bitcoin cd bitcoin
mkdir -p $OUTDIR/src mkdir -p $OUTDIR/src
@ -72,8 +77,10 @@ script: |
cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt
cp $OUTDIR/src/COPYING $OUTDIR/license.txt cp $OUTDIR/src/COPYING $OUTDIR/license.txt
cd src cd src
sed 's/$(DEBUGFLAGS)//' < makefile.linux-mingw > makefile.linux-mingw.2 && mv makefile.linux-mingw.2 makefile.linux-mingw sed 's/$(DEBUGFLAGS)/-frandom-seed=bitcoin/' -i makefile.linux-mingw
sed 's|//#include <WSPiApi.h>|#include <WSPiApi.h>|' < net.cpp > net.cpp.2 && mv net.cpp.2 net.cpp 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 bitcoin.exe USE_UPNP=1
make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoind.exe USE_UPNP=0 make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build bitcoind.exe USE_UPNP=0
i586-mingw32msvc-strip bitcoin.exe i586-mingw32msvc-strip bitcoin.exe

View File

@ -6,40 +6,40 @@ architectures:
- "i386" - "i386"
- "amd64" - "amd64"
packages: packages:
- "libdb4.7++-dev" - "libdb4.8++-dev"
- "libxxf86vm-dev" - "libxxf86vm-dev"
- "libgtk2.0-dev" - "libgtk2.0-dev"
- "libboost-all-dev" - "libboost-all-dev"
- "libssl-dev" - "libssl-dev"
- "git-core" - "git-core"
- "unzip"
reference_datetime: "2011-01-30 00:00:00" reference_datetime: "2011-01-30 00:00:00"
remotes: remotes:
- "url": "https://github.com/bitcoin/bitcoin.git" - "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin" "dir": "bitcoin"
files: files:
- "wxWidgets-2.9.1.tar.bz2" - "wxWidgets-2.9.2-gitian.zip"
- "miniupnpc-1.5.tar.gz" - "miniupnpc-1.6.tar.gz"
- "toplevel.h.diff"
- "toplevel.cpp.diff"
script: | script: |
INSTDIR="$HOME/install" INSTDIR="$HOME/install"
export LIBRARY_PATH="$INSTDIR/lib" export LIBRARY_PATH="$INSTDIR/lib"
# #
tar xzf miniupnpc-1.5.tar.gz tar xzf miniupnpc-1.6.tar.gz
cd miniupnpc-1.5 cd miniupnpc-1.6
INSTALLPREFIX=$INSTDIR make $MAKEOPTS install INSTALLPREFIX=$INSTDIR make $MAKEOPTS install
cd .. cd ..
# #
tar xjf wxWidgets-2.9.1.tar.bz2 mkdir -p $INSTDIR/bin $INSTDIR/lib/wx $INSTDIR/include
cd wxWidgets-2.9.1 mkdir wxWidgets-2.9.2
cd include/wx/gtk cd wxWidgets-2.9.2
patch < ../../../../toplevel.h.diff unzip ../wxWidgets-2.9.2-gitian.zip
cd ../../../src/gtk cp -a bin/$GBUILD_BITS/wx/config/gtk2-unicode-static-2.9 $INSTDIR/bin/wx-config
patch < ../../../toplevel.cpp.diff for lib in wx_gtk2u wxregexu wxtiff; do
cd ../.. ar rc $INSTDIR/lib/lib${lib}-2.9.a bin/$GBUILD_BITS/$lib/*.o
./configure --prefix=$INSTDIR --enable-monolithic --disable-shared ranlib $INSTDIR/lib/lib${lib}-2.9.a
perl -i -p -e "s/__TIME__/\"$REFERENCE_TIME\"/;s/__DATE__/\"$REFERENCE_DATE\"/" include/wx/chartype.h done
make $MAKEOPTS install cp -a include/wx-2.9/* $INSTDIR/include
cp -a bin/$GBUILD_BITS/wx/include $INSTDIR/lib/wx
cd .. cd ..
# #
cd bitcoin cd bitcoin
@ -50,7 +50,7 @@ script: |
cp $OUTDIR/src/doc/README $OUTDIR cp $OUTDIR/src/doc/README $OUTDIR
cp $OUTDIR/src/COPYING $OUTDIR cp $OUTDIR/src/COPYING $OUTDIR
cd src 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 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 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 mkdir -p $OUTDIR/bin/$GBUILD_BITS

View File

@ -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.

View File

@ -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<wxTopLevelWindowGTK*>(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;

View File

@ -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

View File

@ -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

42
contrib/wxwidgets.yml Normal file
View File

@ -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

View File

@ -27,11 +27,11 @@ Dependencies
Libraries you need to download separately and build: Libraries you need to download separately and build:
default path download 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/ 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 Berkeley DB \db-4.8.30.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/ Boost \boost-1.47.0-mgw http://www.boost.org/users/download/
miniupnpc \upnpc-exe-win32-20110215 http://miniupnp.tuxfamily.org/files/ miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/
Their licenses: Their licenses:
wxWidgets LGPL 2.1 with very liberal exceptions wxWidgets LGPL 2.1 with very liberal exceptions
@ -41,11 +41,11 @@ Boost MIT-like license
miniupnpc New (3-clause) BSD license miniupnpc New (3-clause) BSD license
Versions used in this release: Versions used in this release:
wxWidgets 2.9.1 wxWidgets 2.9.2
OpenSSL 1.0.0d OpenSSL 1.0.0d
Berkeley DB 4.7.25.NC Berkeley DB 4.8.30.NC
Boost 1.43.0 Boost 1.47.0
miniupnpc 1.5-20110215 miniupnpc 1.6
Notes Notes
@ -57,7 +57,7 @@ classes that do the rote work of constructing all the UI elements.
wxWidgets wxWidgets
--------- ---------
DOS shell: DOS shell:
cd \wxWidgets-2.9.1-mgw\build\msw cd \wxWidgets-2.9.2-mgw\build\msw
mingw32-make -f makefile.gcc mingw32-make -f makefile.gcc
OpenSSL OpenSSL
@ -73,30 +73,26 @@ make
Berkeley DB Berkeley DB
----------- -----------
MSYS shell: 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 sh ../dist/configure --enable-mingw --enable-cxx
make make
Boost Boost
----- -----
DOS prompt: DOS prompt:
downloaded boost jam 3.1.18 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 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 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. 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 MSYS shell:
Get miniupnpc-1.5.20110215.tar.gz and copy *.h to \upnpc-exe-win32-20110215\miniupnpc cd /c/miniupnpc-1.6-mgw
make -f Makefile.mingw
mkdir miniupnpc
cp *.h miniupnpc/
Bitcoin Bitcoin
------- -------

View File

@ -135,18 +135,18 @@ The process for miniupnpc (optional) is similar to that of OpenSSL.
Download from http://miniupnp.tuxfamily.org/files/. Download from http://miniupnp.tuxfamily.org/files/.
cd ~/bitcoin/deps cd ~/bitcoin/deps
tar xvf ~/Downloads/miniupnpc-1.5.tar tar xvf ~/Downloads/miniupnpc-1.6.tar
mv miniupnpc-1.5 miniupnpc-1.5-x86_64 mv miniupnpc-1.6 miniupnpc-1.6-x86_64
tar xvf ~/Downloads/miniupnpc-1.5.tar tar xvf ~/Downloads/miniupnpc-1.6.tar
mv miniupnpc-1.5 miniupnpc-1.5-i386 mv miniupnpc-1.6 miniupnpc-1.6-i386
# build x86_64 (64 bit intel) binary # 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 CFLAGS="-arch x86_64"
export LDFLAGS="-arch x86_64" export LDFLAGS="-arch x86_64"
export PREFIX="/Users/macuser/bitcoin/deps" export PREFIX="/Users/macuser/bitcoin/deps"
make && make install make && make install
# build i386 (32 bit intel) binary # build i386 (32 bit intel) binary
cd miniupnpc-1.5-i386 cd miniupnpc-1.6-i386
export CFLAGS="-arch i386" export CFLAGS="-arch i386"
export LDFLAGS="-arch i386" export LDFLAGS="-arch i386"
export PREFIX="/Users/macuser/bitcoin/deps" export PREFIX="/Users/macuser/bitcoin/deps"
@ -154,7 +154,7 @@ make
# combine the libs # combine the libs
cd ~/bitcoin/deps 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 Verify your binaries
@ -175,8 +175,8 @@ Berkeley DB
Download from http://freshmeat.net/projects/berkeleydb/ Download from http://freshmeat.net/projects/berkeleydb/
cd ~/bitcoin/deps cd ~/bitcoin/deps
tar xvf ~/Downloads/db-4.8.26.tar tar xvf ~/Downloads/db-4.8.30.tar
cd db-4.8.26/build_unix cd db-4.8.30/build_unix
../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install ../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install

View File

@ -25,8 +25,8 @@ Dependencies
sudo apt-get install build-essential sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev sudo apt-get install libgtk2.0-dev
sudo apt-get install libssl-dev sudo apt-get install libssl-dev
sudo apt-get install libdb4.7-dev sudo apt-get install libdb4.8-dev
sudo apt-get install libdb4.7++-dev sudo apt-get install libdb4.8++-dev
Boost 1.40+: sudo apt-get install libboost-all-dev Boost 1.40+: sudo apt-get install libboost-all-dev
or Boost 1.37: sudo apt-get install libboost1.37-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: Versions used in this release:
GCC 4.3.3 GCC 4.3.3
OpenSSL 0.9.8g OpenSSL 0.9.8g
wxWidgets 2.9.0 wxWidgets 2.9.2
Berkeley DB 4.7.25.NC Berkeley DB 4.8.30.NC
Boost 1.37 Boost 1.37
miniupnpc 1.5 miniupnpc 1.6
Notes Notes
@ -74,8 +74,8 @@ symbols, which reduces the executable size by about 90%.
wxWidgets wxWidgets
--------- ---------
cd /usr/local cd /usr/local
tar -xzvf wxWidgets-2.9.0.tar.gz tar -xzvf wxWidgets-2.9.2.tar.gz
cd wxWidgets-2.9.0 cd wxWidgets-2.9.2
mkdir buildgtk mkdir buildgtk
cd buildgtk cd buildgtk
../configure --with-gtk --enable-debug --disable-shared --enable-monolithic --without-libpng --disable-svg ../configure --with-gtk --enable-debug --disable-shared --enable-monolithic --without-libpng --disable-svg
@ -87,8 +87,8 @@ ldconfig
miniupnpc miniupnpc
--------- ---------
tar -xzvf miniupnpc-1.5.tar.gz tar -xzvf miniupnpc-1.6.tar.gz
cd miniupnpc-1.5 cd miniupnpc-1.6
make make
sudo su sudo su
make install make install
@ -96,8 +96,7 @@ make install
Berkeley DB Berkeley DB
----------- -----------
You need Berkeley DB 4.7. Don't use 4.8, the database/log0000* files You need Berkeley DB 4.8. If you have to build Berkeley DB yourself:
are incompatible. If you have to build Berkeley DB yourself:
../dist/configure --enable-cxx ../dist/configure --enable-cxx
make make

View File

@ -7,19 +7,19 @@ DEPSDIR:=/usr/i586-mingw32msvc
USE_UPNP:=0 USE_UPNP:=0
INCLUDEPATHS= \ INCLUDEPATHS= \
-I"$(DEPSDIR)/boost_1_43_0" \ -I"$(DEPSDIR)/boost_1_47_0" \
-I"$(DEPSDIR)/db-4.7.25.NC/build_unix" \ -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
-I"$(DEPSDIR)/openssl-1.0.0d/include" \ -I"$(DEPSDIR)/openssl-1.0.0d/include" \
-I"$(DEPSDIR)/wxWidgets-2.9.1/lib/gcc_lib/mswud" \ -I"$(DEPSDIR)/wxWidgets-2.9.2/lib/gcc_lib/mswud" \
-I"$(DEPSDIR)/wxWidgets-2.9.1/include" \ -I"$(DEPSDIR)/wxWidgets-2.9.2/include" \
-I"$(DEPSDIR)/wxWidgets-2.9.1/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \ -I"$(DEPSDIR)/wxWidgets-2.9.2/lib/wx/include/i586-mingw32msvc-msw-unicode-static-2.9/" \
-I"$(DEPSDIR)" -I"$(DEPSDIR)"
LIBPATHS= \ LIBPATHS= \
-L"$(DEPSDIR)/boost_1_43_0/stage/lib" \ -L"$(DEPSDIR)/boost_1_47_0/stage/lib" \
-L"$(DEPSDIR)/db-4.7.25.NC/build_unix" \ -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
-L"$(DEPSDIR)/openssl-1.0.0d" \ -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 WXLIBS= -l wx_mswu-2.9-i586-mingw32msvc
@ -32,7 +32,7 @@ LIBS= \
-l ssl \ -l ssl \
-l crypto -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__ DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) 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 \ 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 crypter.h init.h
ifdef USE_UPNP ifdef USE_UPNP
INCLUDEPATHS += -I"$(DEPSDIR)/upnpc-exe-win32-20110215" LIBPATHS += -L"$(DEPSDIR)/miniupnpc"
LIBPATHS += -L"$(DEPSDIR)/upnpc-exe-win32-20110215"
LIBS += -l miniupnpc -l iphlpapi LIBS += -l miniupnpc -l iphlpapi
DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
endif endif

View File

@ -5,31 +5,31 @@
USE_UPNP:=0 USE_UPNP:=0
INCLUDEPATHS= \ INCLUDEPATHS= \
-I"C:\boost-1.43.0-mgw" \ -I"C:\boost-1.47.0-mgw" \
-I"C:\db-4.7.25.NC-mgw\build_unix" \ -I"C:\db-4.8.30.NC-mgw\build_unix" \
-I"C:\openssl-1.0.0d-mgw\include" \ -I"C:\openssl-1.0.0d-mgw\include" \
-I"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib\mswud" \ -I"C:\wxWidgets-2.9.2-mgw\lib\gcc_lib\mswud" \
-I"C:\wxWidgets-2.9.1-mgw\include" -I"C:\wxWidgets-2.9.2-mgw\include"
LIBPATHS= \ LIBPATHS= \
-L"C:\boost-1.43.0-mgw\stage\lib" \ -L"C:\boost-1.47.0-mgw\stage\lib" \
-L"C:\db-4.7.25.NC-mgw\build_unix" \ -L"C:\db-4.8.30.NC-mgw\build_unix" \
-L"C:\openssl-1.0.0d-mgw" \ -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= \ WXLIBS= \
-l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd -l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd
LIBS= \ LIBS= \
-l boost_system-mgw45-mt-s-1_43 \ -l boost_system-mgw45-mt-s-1_47 \
-l boost_filesystem-mgw45-mt-s-1_43 \ -l boost_filesystem-mgw45-mt-s-1_47 \
-l boost_program_options-mgw45-mt-s-1_43 \ -l boost_program_options-mgw45-mt-s-1_47 \
-l boost_thread-mgw45-mt-s-1_43 \ -l boost_thread-mgw45-mt-s-1_47 \
-l db_cxx \ -l db_cxx \
-l ssl \ -l ssl \
-l crypto -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__ DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) 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 \ 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 init.h crypter.h
ifdef USE_UPNP ifdef USE_UPNP
INCLUDEPATHS += -I"C:\upnpc-exe-win32-20110215" INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw"
LIBPATHS += -L"C:\upnpc-exe-win32-20110215" LIBPATHS += -L"C:\miniupnpc-1.6-mgw"
LIBS += -l miniupnpc -l iphlpapi LIBS += -l miniupnpc -l iphlpapi
DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP)
endif endif

View File

@ -12,11 +12,6 @@
#ifdef __WXMSW__ #ifdef __WXMSW__
#include <string.h> #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 #endif
#ifdef USE_UPNP #ifdef USE_UPNP
@ -1079,10 +1074,11 @@ void ThreadMapPort2(void* parg)
const char * rootdescurl = 0; const char * rootdescurl = 0;
const char * multicastif = 0; const char * multicastif = 0;
const char * minissdpdpath = 0; const char * minissdpdpath = 0;
int error = 0;
struct UPNPDev * devlist = 0; struct UPNPDev * devlist = 0;
char lanaddr[64]; char lanaddr[64];
devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0); devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);
struct UPNPUrls urls; struct UPNPUrls urls;
struct IGDdatas data; struct IGDdatas data;
@ -1094,14 +1090,9 @@ void ThreadMapPort2(void* parg)
char intClient[16]; char intClient[16];
char intPort[6]; char intPort[6];
string strDesc = "Bitcoin " + FormatFullVersion(); 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, r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0"); port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
#endif
if(r!=UPNPCOMMAND_SUCCESS) if(r!=UPNPCOMMAND_SUCCESS)
printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
port, port, lanaddr, r, strupnperror(r)); port, port, lanaddr, r, strupnperror(r));