Skip to content

Commit 1e9e4b6

Browse files
committed
Merge #20469: build: Avoid secp256k1.h include from system
e95aaef build: Avoid secp256k1.h include from system (Niklas Gögge) Pull request description: While building i ran into an error because i had a version of `secp256k1.h` under `/usr/local/include` that was incompatible with the secp256k1 code in the repository. This caused a problem because `$(BOOST_CPPFLAGS)` contained `-I/usr/local/include` and the include paths are searched by the compiler in order from left to right, so in the end `$(BITCOIN_INCLUDES)` contained `-I/usr/local/include` before `-I$(srcdir)/secp256k1/include` which caused the compiler to find `secp256k1.h` under `/usr/local/include`. Looking at git blame i am wondering how this has not happened to anyone else in several years: https://github.com/bitcoin/bitcoin/blame/cb89e18845852c005ba8ab94acc6544d7c876a42/src/Makefile.am#L25 I am on macOS 10.15. ACKs for top commit: laanwj: Code review ACK e95aaef hebasto: ACK e95aaef, tested on macOS 11 Big Sur by adding `#error` into `/usr/local/include/secp256k1.h`. Tree-SHA512: 1f0b395725936c179ab60dee3582ec7b21e2f9c0f1895e160d84a487cf0db16d0c7aa47d05800e0aded31685b4362056cac9b9ecca1bb8c308a4c5a810e8dc1d
2 parents efd4cdb + e95aaef commit 1e9e4b6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ else
2020
LIBUNIVALUE = $(UNIVALUE_LIBS)
2121
endif
2222

23-
BITCOIN_INCLUDES=-I$(builddir) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
23+
BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/secp256k1/include $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
2424

25-
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
2625
BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
2726

2827
LIBBITCOIN_SERVER=libbitcoin_server.a

0 commit comments

Comments
 (0)