Skip to content

Commit

Permalink
Make does not compile altcoin stuff unless needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Znort987 committed Nov 29, 2015
1 parent 3fd1bfe commit 4f19ae2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 31 deletions.
65 changes: 37 additions & 28 deletions make
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,35 @@ my(@modeNames) = qw(dbg rel prf cov clg);
#my(@modeNames) = qw(rel dbg);
my($comboModes, $shortComboModes, $justifiedComboModes) = genModes(\@modeNames, \@shortModeNames);

# Base flags
# ===========
my($cc) = "gcc";
my($cplus) = "g++";
my($nvcc) = "nvcc";
my($linker) = "g++ -fno-stack-protector";
my($fortran) = "gfortran++";
my(@inc) = qw(
-I.
-DNDEBUG
-DBITCOIN
-DWANT_DENSE
-D__STDC_FORMAT_MACROS=1
);

#-DCLAM
#-DPAYCON
#-DBITCOIN
#-DDARKCOIN
#-DJUMBUCKS
#-DLITECOIN
#-DPEERCOIN
#-DTESTNET3
#-DFEDORACOIN
#-DMYRIADCOIN
#-DUNOBTANIUM
#-DPROTOSHARES


# Libraries
# =========
my(@lib) = qw(
Expand Down Expand Up @@ -163,6 +192,14 @@ my(@lib) = qw(
-ldl
);

# Clean stuff we don't need for bitcoin
# ======================================
if(join(' ', @inc) =~ /-DBITCOIN/) {
my(@pass0) = grep ! /h9\//, @lib;
my(@pass1) = grep ! /scrypt\//, @pass0;
@lib = @pass1;
}

# Normal target and their sources
# ================================
my(%targets) = (
Expand All @@ -183,34 +220,6 @@ opendir(D, "t");
}
closedir(D);

# Base flags
# ===========
my($cc) = "gcc";
my($cplus) = "g++";
my($nvcc) = "nvcc";
my($linker) = "g++ -fno-stack-protector";
my($fortran) = "gfortran++";
my(@inc) = qw(
-I.
-DNDEBUG
-DBITCOIN
-DWANT_DENSE
-D__STDC_FORMAT_MACROS=1
);

#-DCLAM
#-DPAYCON
#-DBITCOIN
#-DDARKCOIN
#-DJUMBUCKS
#-DLITECOIN
#-DPEERCOIN
#-DTESTNET3
#-DFEDORACOIN
#-DMYRIADCOIN
#-DUNOBTANIUM
#-DPROTOSHARES

my(@copt) = qw(
-O6
-g0
Expand Down
10 changes: 7 additions & 3 deletions t/base58_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ static bool testHash2Addr(
}

static int h2addr() {
bool ok = true;
#define X(addr, hash) ok = ok && testHash2Addr(addr, hash);
auto count = 0;
auto ok = true;
#define X(addr, hash) { ok = ok && testHash2Addr(addr, hash); ++count; }
EQUIV_LIST
#undef X
Test::pushMsg("checked %d vectors", count);
return ok ? 0 : 1;
}

Expand Down Expand Up @@ -167,10 +169,12 @@ static bool testAddr2Hash(
}

static int addr2hash() {
auto count = 0;
auto ok = true;
#define X(addr, hash) ok = ok && testAddr2Hash((const uint8_t*)addr, (const uint8_t*)hash);
#define X(addr, hash) { ok = ok && testAddr2Hash((const uint8_t*)addr, (const uint8_t*)hash); ++count; }
EQUIV_LIST
#undef X
Test::pushMsg("checked %d vectors", count);
return ok ? 0 : 1;
}

Expand Down

0 comments on commit 4f19ae2

Please sign in to comment.