Skip to content

Commit

Permalink
unix build merged in, bitmap resources from xpm instead of rc, better…
Browse files Browse the repository at this point in the history
… addr relay, better selection of addrs by time last seen for faster connect

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@32 1a98c847-1fd6-4fd8-948a-caf3550aa51b
  • Loading branch information
non-github-bitcoin committed Nov 5, 2009
1 parent b7362c0 commit e4c05d3
Show file tree
Hide file tree
Showing 23 changed files with 2,184 additions and 301 deletions.
73 changes: 73 additions & 0 deletions build-unix.txt
@@ -0,0 +1,73 @@
Bitcoin v0.2.0 BETA

Copyright (c) 2009 Satoshi Nakamoto
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).


UNIX BUILD NOTES


Dependencies
------------
apt-get install build-essential
apt-get install libgtk2.0-dev
apt-get install libssl-dev

Libraries you need to obtain separately and build:
default path download
wxWidgets \wxwidgets http://www.wxwidgets.org/downloads/
Berkeley DB \db http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost http://www.boost.org/users/download/

Their licenses:
wxWidgets LGPL 2.1 with very liberal exceptions
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license

Versions used in this release:
GCC 4.3.3
OpenSSL 0.9.8k
wxWidgets 2.8.9
Berkeley DB 4.7.25.NC
Boost 1.40.0


Notes
-----
The UI layout is edited with wxFormBuilder. Open the project file
uiproject.fbp. It generates uibase.cpp and uibase.h, which define base
classes that do the rote work of constructing all the UI elements.

The release is built with GCC and then "strip bitcoin" to strip the debug
symbols, which reduces the executable size by about 90%.


wxWidgets
---------
cd /usr/local/wxWidgets-2.8.9
mkdir buildgtk
cd buildgtk
../configure --with-gtk --enable-debug --disable-shared --enable-monolithic
make
su
make install
ldconfig


Berkeley DB
-----------
cd /usr/local/db-4.7.25.NC/build_unix
../dist/configure --enable-cxx
make


Boost
-----
cd /usr/local/boost_1_40_0
su
./bootstrap.sh
./bjam install
88 changes: 0 additions & 88 deletions build.txt

This file was deleted.

10 changes: 3 additions & 7 deletions db.cpp
Expand Up @@ -62,9 +62,9 @@ CDB::CDB(const char* pszFile, const char* pszMode, bool fTxn) : pdb(NULL)
if (fShutdown)
return;
string strDataDir = GetDataDir();
string strLogDir = strDataDir + "\\database";
string strLogDir = strDataDir + "/database";
_mkdir(strLogDir.c_str());
string strErrorFile = strDataDir + "\\db.log";
string strErrorFile = strDataDir + "/db.log";
printf("dbenv.open strLogDir=%s strErrorFile=%s\n", strLogDir.c_str(), strErrorFile.c_str());

dbenv.set_lg_dir(strLogDir.c_str());
Expand Down Expand Up @@ -411,7 +411,6 @@ bool CAddrDB::WriteAddress(const CAddress& addr)

bool CAddrDB::LoadAddresses()
{
CRITICAL_BLOCK(cs_mapIRCAddresses)
CRITICAL_BLOCK(cs_mapAddresses)
{
// Load user provided addresses
Expand All @@ -425,10 +424,7 @@ bool CAddrDB::LoadAddresses()
{
CAddress addr(psz, NODE_NETWORK);
if (addr.IsValid())
{
AddAddress(*this, addr);
mapIRCAddresses.insert(make_pair(addr.GetKey(), addr));
}
}
}
catch (...) { }
Expand Down Expand Up @@ -678,7 +674,7 @@ void ThreadFlushWalletDB(void* parg)
if (nRefCount == 0 && !fShutdown)
{
// Flush wallet.dat so it's self contained
nLastFlushed == nWalletDBUpdated;
nLastFlushed = nWalletDBUpdated;
int64 nStart = GetTimeMillis();
dbenv.txn_checkpoint(0, 0, 0);
dbenv.lsn_reset(strFile.c_str(), 0);
Expand Down
38 changes: 27 additions & 11 deletions headers.h
Expand Up @@ -17,16 +17,18 @@
#endif
#define _WIN32_IE 0x0400
#define WIN32_LEAN_AND_MEAN 1
#define __STDC_LIMIT_MACROS // to enable UINT64_MAX from stdint.h
#include <wx/wx.h>
#include <wx/clipbrd.h>
#include <wx/snglinst.h>
#include <wx/taskbar.h>
#include <wx/stdpaths.h>
#include <wx/utils.h>
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/ripemd.h>
#include <openssl/ripemd.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Expand All @@ -50,22 +52,28 @@
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
#include <boost/array.hpp>

#include <boost/array.hpp>

#ifdef __WXMSW__
#include <windows.h>
#include <winsock2.h>
#include <mswsock.h>
#include <mswsock.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <io.h>
#include <process.h>
#else
#include <shlwapi.h>
#include <io.h>
#include <process.h>
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <boost/filesystem.hpp>
#include <boost/thread/thread.hpp>
#include <boost/algorithm/string.hpp>
#endif

#pragma hdrstop
using namespace std;
Expand All @@ -88,3 +96,11 @@ using namespace boost;
#include "market.h"
#include "uibase.h"
#include "ui.h"

#include "xpm/addressbook16.xpm"
#include "xpm/addressbook20.xpm"
#include "xpm/bitcoin.xpm"
#include "xpm/check.xpm"
#include "xpm/send16.xpm"
#include "xpm/send16noshadow.xpm"
#include "xpm/send20.xpm"
16 changes: 2 additions & 14 deletions irc.cpp
Expand Up @@ -4,10 +4,7 @@

#include "headers.h"


map<vector<unsigned char>, CAddress> mapIRCAddresses;
CCriticalSection cs_mapIRCAddresses;

int nGotIRCAddresses = 0;



Expand Down Expand Up @@ -259,16 +256,7 @@ void ThreadIRCSeed(void* parg)
CAddrDB addrdb;
if (AddAddress(addrdb, addr))
printf("IRC got new address\n");
else
{
// make it try connecting again
CRITICAL_BLOCK(cs_mapAddresses)
if (mapAddresses.count(addr.GetKey()))
mapAddresses[addr.GetKey()].nLastFailed = 0;
}

CRITICAL_BLOCK(cs_mapIRCAddresses)
mapIRCAddresses.insert(make_pair(addr.GetKey(), addr));
nGotIRCAddresses++;
}
else
{
Expand Down
4 changes: 1 addition & 3 deletions irc.h
Expand Up @@ -4,7 +4,5 @@

extern bool RecvLine(SOCKET hSocket, string& strLine);
extern void ThreadIRCSeed(void* parg);
extern bool fRestartIRCSeed;

extern map<vector<unsigned char>, CAddress> mapIRCAddresses;
extern CCriticalSection cs_mapIRCAddresses;
extern int nGotIRCAddresses;

0 comments on commit e4c05d3

Please sign in to comment.