aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-07-29 15:34:48 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-07-29 15:34:48 +0000
commit17b2740289268c037c5adb5956989f134982bf80 (patch)
treea78b4cf9baef3ed88f7aca398831260bebcdd5d0
parentf6f8237a748e3627bd4a201ed2e376d8c42c3bac (diff)
Fredrik Roubert: simplified makefile.unix with wx-config,
misc git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@118 1a98c847-1fd6-4fd8-948a-caf3550aa51b
-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 9c9e8662d0..ddc359af80 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 eee465ca28..9596ece97b 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 939418657d..e393ff920d 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 e457d10eea..71455e672a 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();