Autoconf - Where does config.h go?

I am writing my own module testing library (using autoconf, automake and libtool) to better suit my needs (I do not need a super large number of functions, just a test runner and statements). I got to the point that it, apparently, can be used.

Of course, he uses config.h to figure out which headers to include. The problem is that I'm not sure where config.h should go, as it will easily run into another config.h project, and also because it is architecture dependent.

What should be my method to set this header? (This is necessary for all other headers)

+6
autotools autoconf libtool automake
source share
3 answers

The ax_prefix_config_h macro sounds the way you want. It provides a way to create another config.h file that contains information about the config.h file with a prefix. So, for example, instead of #define HAVE_SOMETHING in config.h you will get #define MYLIB_HAVE_SOMETHING in mylib_config.h. Very comfortably.

+5
source share

You should not export config.h to your library interface.

This link shows a way around this if your installed headers really really need a platform. This is a fragile method using the deprecated autoconf macro.

+2
source share

You can select a different configuration file by changing the AC_OUTPUT macro, although I'm not sure how you plan to integrate with other projects. If this is a sub-project, then it will still be in a subdirectory.

0
source share

All Articles