Browse Source

Fredrik Roubert: simplified makefile.unix with wx-config, misc

miguelfreitas
--author=Satoshi Nakamoto 15 years ago committed by Gavin Andresen
parent
commit
ec82517c89
  1. 12
      main.cpp
  2. 2
      makefile.mingw
  3. 21
      makefile.unix
  4. 3
      ui.cpp

12
main.cpp

@ -806,9 +806,9 @@ int64 CBlock::GetBlockValue(int64 nFees) const
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast) unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
{ {
const unsigned int nTargetTimespan = 14 * 24 * 60 * 60; // two weeks const int64 nTargetTimespan = 14 * 24 * 60 * 60; // two weeks
const unsigned int nTargetSpacing = 10 * 60; const int64 nTargetSpacing = 10 * 60;
const unsigned int nInterval = nTargetTimespan / nTargetSpacing; const int64 nInterval = nTargetTimespan / nTargetSpacing;
// Genesis block // Genesis block
if (pindexLast == NULL) if (pindexLast == NULL)
@ -825,8 +825,8 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
assert(pindexFirst); assert(pindexFirst);
// Limit adjustment step // Limit adjustment step
unsigned int nActualTimespan = pindexLast->nTime - pindexFirst->nTime; int64 nActualTimespan = (int64)pindexLast->nTime - (int64)pindexFirst->nTime;
printf(" nActualTimespan = %d before bounds\n", nActualTimespan); printf(" nActualTimespan = %"PRI64d" before bounds\n", nActualTimespan);
if (nActualTimespan < nTargetTimespan/4) if (nActualTimespan < nTargetTimespan/4)
nActualTimespan = nTargetTimespan/4; nActualTimespan = nTargetTimespan/4;
if (nActualTimespan > nTargetTimespan*4) if (nActualTimespan > nTargetTimespan*4)
@ -843,7 +843,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast)
/// debug print /// debug print
printf("GetNextWorkRequired RETARGET\n"); 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("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()); printf("After: %08x %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());

2
makefile.mingw

@ -54,7 +54,7 @@ obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $< g++ -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp 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 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 $< windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<

21
makefile.unix

@ -3,21 +3,12 @@
# file license.txt or http://www.opensource.org/licenses/mit-license.php. # file license.txt or http://www.opensource.org/licenses/mit-license.php.
INCLUDEPATHS= \ WXLIBS=$(shell wx-config --debug=yes --libs --static)
-I"/usr/include" \ WXFLAGS=$(shell wx-config --debug=yes --cppflags)
-I"/usr/local/include/wx-2.9" \
-I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
LIBPATHS= \ LIBPATHS= \
-L"/usr/lib" \
-L"/usr/local/lib" -L"/usr/local/lib"
WXLIBS= \
-Wl,-Bstatic \
-l wx_gtk2ud-2.9 \
-Wl,-Bdynamic \
-l gtk-x11-2.0 -l SM
LIBS= \ LIBS= \
-Wl,-Bstatic \ -Wl,-Bstatic \
-l boost_system \ -l boost_system \
@ -31,7 +22,7 @@ LIBS= \
DEFS=-D__WXGTK__ -DNOPCH DEFS=-D__WXGTK__ -DNOPCH
DEBUGFLAGS=-g -D__WXDEBUG__ 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 \ 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 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) headers.h.gch: headers.h $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $< g++ -c $(CFLAGS) $(WXFLAGS) -DGUI -o $@ $<
obj/%.o: %.cpp $(HEADERS) headers.h.gch obj/%.o: %.cpp $(HEADERS) headers.h.gch
g++ -c $(CFLAGS) -DGUI -o $@ $< g++ -c $(CFLAGS) $(WXFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp 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 bitcoin: $(OBJS) obj/ui.o obj/uibase.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS) g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)

3
ui.cpp

@ -1763,8 +1763,7 @@ void COptionsDialog::OnButtonApply(wxCommandEvent& event)
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent) 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 // Change (c) into UTF-8 or ANSI copyright symbol
wxString str = m_staticTextMain->GetLabel(); wxString str = m_staticTextMain->GetLabel();

Loading…
Cancel
Save