比特币src001

bitcoin-core 入口:bitcoind.cpp

开头 #ifdefined(HAVA_CONFIG_H).....include<config/bitcoin-config.h>...

查找config/bitcoin-config.h,发现:空的

解释:

Meaning of -DHAVE_CONFIG_H in makefiles

I am starting to learn about makefiles. Looking at the output I see a lot of occurrences of:

g++ -DHAVE_CONFIG_H -I ...

what is -DHAVE_CONFIG_H exactly? What is the function of this compilation option?

 

1 Answer

 

All that -DHAVE_CONFIG_H does is to define the pre-processor token HAVE_CONFIG_H exactly as if you had #define HAVE_CONFIG_H right at the start of each of your source files.

As to what it's used for, that depends entirely upon the rest of your source file (and everything that it includes as well). That's where you should be looking for to work out its effect.

It looks like it may mean that a header file config.h is available and should be included, in which case you'll probably find the following sequence somewhere in you source files:

#ifdef HAVE_CONFIG_H
    #include "config.h"
#endif

which will include the header file when you say it's available. However that's supposition on my part and by no means the exact effect, just what I would use such a preprocessor symbol for.

猜你喜欢

转载自blog.csdn.net/creator123123/article/details/81984342
今日推荐