aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author--author=Satoshi Nakamoto <satoshin@gmx.com>2010-07-30 17:35:17 +0000
committerGavin Andresen <gavinandresen@gmail.com>2010-07-30 17:35:17 +0000
commitec82517c8919f9cb7194511dc322a2575745e39e (patch)
tree102c6ae76c23e2e222848e3ba8ae14e524358d39
parent31ffe954b6f415b724c3214de5bffd7bba5872c0 (diff)
downloadbitcoin-ec82517c8919f9cb7194511dc322a2575745e39e.tar.xz
Fredrik Roubert: simplified makefile.unix with wx-config, misc
-rw-r--r--main.cpp12
-rw-r--r--makefile.mingw2
-rw-r--r--makefile.unix21
-rw-r--r--ui.cpp3
4 files changed, 14 insertions, 24 deletions
diff --git a/main.cpp b/main.cpp
index 296765300b..da2a6ac903 100644
--- a/main.cpp
+++ b/main.cpp
@@ -806,9 +806,9 @@ int64 CBlock::GetBlockValue(int64 nFees) const
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
{
- const unsigned int nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
- const unsigned int nTargetSpacing = 10 * 60;
- const unsigned int nInterval = nTargetTimespan / nTargetSpacing;
+ const int64 nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
+ const int64 nTargetSpacing = 10 * 60;
+ const int64 nInterval = nTargetTimespan / nTargetSpacing;
// Genesis block
if (pindexLast == NULL)
@@ -825,8 +825,8 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
assert(pindexFirst);
// Limit adjustment step
- unsigned int nActualTimespan = pindexLast->nTime - pindexFirst->nTime;
- printf(" nActualTimespan = %d before bounds\n", nActualTimespan);
+ int64 nActualTimespan = (int64)pindexLast->nTime - (int64)pindexFirst->nTime;
+ printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
if (nActualTimespan < nTargetTimespan/4)
nActualTimespan = nTargetTimespan/4;
if (nActualTimespan > nTargetTimespan*4)
@@ -843,7 +843,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
/// debug print
printf("GetNextWorkRequired RETARGET\n");
- printf("nTargetTimespan = %d nActualTimespan = %d\n", nTargetTimespan, nActualTimespan);
+ printf("nTargetTimespan = %"PRI64d" nActualTimespan = %"PRI64d"\n", nTargetTimespan, nActualTimespan);
printf("Before: %08x %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());
printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());
diff --git a/makefile.mingw b/makefile.mingw
index 9140c23ec5..deb8df8112 100644
--- a/makefile.mingw
+++ b/makefile.mingw
@@ -54,7 +54,7 @@ obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
- g++ -c $(CFLAGS) -O3 -DCRYPTOPP_X86_ASM_AVAILABLE -o $@ $<
+ g++ -c $(CFLAGS) -O3 -DCRYPTOPP_X86_ASM_AVAILABLE -DCRYPTOPP_DISABLE_SSE2 -o $@ $<
obj/ui_res.o: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<
diff --git a/makefile.unix b/makefile.unix
index 4c8ded5c81..e2009dc5d1 100644
--- a/makefile.unix
+++ b/makefile.unix
@@ -3,21 +3,12 @@
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
-INCLUDEPATHS= \
- -I"/usr/include" \
- -I"/usr/local/include/wx-2.9" \
- -I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
+WXLIBS=$(shell wx-config --debug=yes --libs --static)
+WXFLAGS=$(shell wx-config --debug=yes --cppflags)
LIBPATHS= \
- -L"/usr/lib" \
-L"/usr/local/lib"
-WXLIBS= \
- -Wl,-Bstatic \
- -l wx_gtk2ud-2.9 \
- -Wl,-Bdynamic \
- -l gtk-x11-2.0 -l SM
-
LIBS= \
-Wl,-Bstatic \
-l boost_system \
@@ -31,7 +22,7 @@ LIBS= \
DEFS=-D__WXGTK__ -DNOPCH
DEBUGFLAGS=-g -D__WXDEBUG__
-CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
+CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
@@ -52,13 +43,13 @@ all: bitcoin
headers.h.gch: headers.h $(HEADERS)
- g++ -c $(CFLAGS) -DGUI -o $@ $<
+ g++ -c $(CFLAGS) $(WXFLAGS) -DGUI -o $@ $<
obj/%.o: %.cpp $(HEADERS) headers.h.gch
- g++ -c $(CFLAGS) -DGUI -o $@ $<
+ g++ -c $(CFLAGS) $(WXFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
- g++ -c $(CFLAGS) -O3 -o $@ $<
+ g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_SSE2 -o $@ $<
bitcoin: $(OBJS) obj/ui.o obj/uibase.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
diff --git a/ui.cpp b/ui.cpp
index 3b63a936e3..a5a6dd7c61 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -1763,8 +1763,7 @@ void COptionsDialog::OnButtonApply(wxCommandEvent& event)
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
{
- m_staticTextVersion->SetLabel(strprintf(_("version %d.%d.%d beta"), VERSION/10000, (VERSION/100)%100, VERSION%100));
- //m_staticTextVersion->SetLabel(strprintf(_("version %d.%d.%d%s beta"), VERSION/10000, (VERSION/100)%100, VERSION%100, pszSubVer));
+ m_staticTextVersion->SetLabel(strprintf(_("version %d.%d.%d%s beta"), VERSION/10000, (VERSION/100)%100, VERSION%100, pszSubVer));
// Change (c) into UTF-8 or ANSI copyright symbol
wxString str = m_staticTextMain->GetLabel();