bitcoin-config.h should be included from config/ to prevent compiler using the old file from the previous location. See #5340 for detailed description.
Use complete path to include bitcoin-config.h. #5374
pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:netbaseconfiginclude changing 1 files +1 −1-
paveljanik commented at 9:54 AM on November 26, 2014: contributor
-
Use complete path to include bitcoin-config.h. a53d16ac0c
-
paveljanik commented at 11:41 AM on November 26, 2014: contributor
@theuni compiling crypto includes -I. also!!!
src $ make g++ -DHAVE_CONFIG_H -I. -I../src/config -I./config ...other options... -g -O2 -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -MT crypto/crypto_libbitcoin_crypto_a-sha1.o -MD -MP -MF crypto/.deps/crypto_libbitcoin_crypto_a-sha1.Tpo -c -o crypto/crypto_libbitcoin_crypto_a-sha1.o `test -f 'crypto/sha1.cpp' || echo './'`crypto/sha1.cpp In file included from ./crypto/common.h:9, from crypto/sha1.cpp:7: ./bitcoin-config.h:4:2: error: #error PJ: here make[1]: *** [crypto/crypto_libbitcoin_crypto_a-sha1.o] Error 1 make: *** [all-recursive] Error 1 src $Before make, I cp src/config/bitcoin-config.h src/bitcoin-config.h to simulate @laanwj and jtimon issue on IRC and added #error to the first line of the new/wrong file.
So we should do one of this:
- fix -I.
- fix the second instance of such include: crypto/common.h:#include "bitcoin-config.h"
-
paveljanik commented at 12:48 PM on November 26, 2014: contributor
FWIW: verified that the second solution works here.
-
jgarzik commented at 1:44 PM on November 26, 2014: contributor
You don't want to hard-code the directory into each source file. That just implies the build needs a fix.
-
paveljanik commented at 2:00 PM on November 26, 2014: contributor
@jgarzik well, the current approach is to include config/bitcoin-config.h in every file except netbase.cpp and crypto/common.h which includes bitcoin-config.h. These two files were probably skipped in the past when the bitcoin-config.h was moved from src to src/config.
-
paveljanik commented at 2:27 PM on November 26, 2014: contributor
Looks like this is a followup to #4395. netbase is fixed to match every other file in the tree. crypto needs its own fix.
-
paveljanik commented at 2:37 PM on November 26, 2014: contributor
My Makefile.in contains:
... DEFAULT_INCLUDES = -I. -I$(top_builddir)/src/config@am__isrc@ ... crypto/crypto_libbitcoin_crypto_a-sha1.o: crypto/sha1.cpp [@am](/bitcoin-bitcoin/contributor/am/)__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) ...So -I. is used in crypto. But as @theuni wrote in #5340, it should not be the case. I'll leave this for @theuni once he is back.
-
laanwj commented at 8:25 AM on November 28, 2014: member
ACK anyhow - this change is consistent.
- laanwj merged this on Nov 28, 2014
- laanwj closed this on Nov 28, 2014
- laanwj referenced this in commit 631e698bb7 on Nov 28, 2014
- paveljanik deleted the branch on Nov 28, 2014
- DrahtBot locked this on Sep 8, 2021