gincoin-dev / gincoin-core

Repository moved
https://github.com/GIN-coin/gincoin-core
14 stars 21 forks source link

CPPFLAGS_FOR_BUILD must be set with '=' before using '+=' Makefile.am:79 #2

Closed cryptocoinguru closed 6 years ago

cryptocoinguru commented 6 years ago

When is this bug fixed? Also mentioned on BitcoinTalk (https://bitcointalk.org/index.php?topic=2998031.100).

Solution grabbed from Dash-Coin works originally posted by "Big-Brother"! https://github.com/dashpay/dash/issues/1855#issuecomment-365329425

You can patch this error by editing /src/secp256k1/Makefile.am and adding:

CPPFLAGS_FOR_BUILD = CFLAGS_FOR_BUILD =

like so (line 78) CPPFLAGS_FOR_BUILD = CPPFLAGS_FOR_BUILD +=-I$(top_srcdir) CFLAGS_FOR_BUILD = CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function

cryptocoinguru commented 6 years ago

Optionally it should be a good idea to replace src/secp256k1 with a submodule automatically updating in the project with latest release of it.

Airead commented 6 years ago

tag: 1.1.0.0 I added three variables, but it still have errors.

diff --git a/src/secp256k1/Makefile.am b/src/secp256k1/Makefile.am
index 7772a4e..8793877 100644
--- a/src/secp256k1/Makefile.am
+++ b/src/secp256k1/Makefile.am
@@ -75,6 +75,9 @@ TESTS = tests
 endif

 if USE_ECMULT_STATIC_PRECOMPUTATION
+CC_FOR_BUILD = $(CC)
+CPPFLAGS_FOR_BUILD =
+CFLAGS_FOR_BUILD =
 CPPFLAGS_FOR_BUILD +=-I$(top_srcdir)
 CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function

errors:

make[2]: Entering directory '/src/gincoin-core/src'
  CXXLD    gincoind
libbitcoin_common.a(libbitcoin_common_a-key.o): In function `CKey::SignCompact(uint256 const&, std::vector<unsigned char, std::allocator<unsigned char> >&) const':
/src/gincoin-core/src/key.cpp:204: undefined reference to `secp256k1_ecdsa_sign_recoverable'
/src/gincoin-core/src/key.cpp:206: undefined reference to `secp256k1_ecdsa_recoverable_signature_serialize_compact'
libbitcoin_common.a(libbitcoin_common_a-pubkey.o): In function `CPubKey::RecoverCompact(uint256 const&, std::vector<unsigned char, std::allocator<unsigned char> > const&)':
/src/gincoin-core/src/pubkey.cpp:194: undefined reference to `secp256k1_ecdsa_recoverable_signature_parse_compact'
/src/gincoin-core/src/pubkey.cpp:197: undefined reference to `secp256k1_ecdsa_recover'
collect2: error: ld returned 1 exit status
Makefile:3729: recipe for target 'gincoind' failed
make[2]: *** [gincoind] Error 1
make[2]: Leaving directory '/src/gincoin-core/src'
Makefile:9545: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/src/gincoin-core/src'
Makefile:657: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
jess8bit commented 6 years ago

same here, any progress on that issue ?

cipig commented 6 years ago

now it gets past ./autogen.sh, but fails at make

make[3]: Entering directory '/home/barterdex/wallets/gincoin-core/src/secp256k1'
I. -Wall -Wextra -Wno-unused-function -c src/gen_context.c -o gen_context.o
/bin/bash: I.: command not found
bedeabza commented 6 years ago

The secp256k1 has been updated to the latest version and it builds correctly.

bedeabza commented 6 years ago

You can also use the new docker build method:

docker run --rm -v /tmp/build:/build gincoin/gincoin-core-build --disable-tests --without-gui

as documented here: https://github.com/gincoin-dev/gincoin-core/blob/master/doc/build-unix.md

cipig commented 6 years ago

Thanks. It worked now, i could compile the wallet. And integrated GIN in BarterDEX: https://github.com/jl777/coins/pull/188