I'm writing my own unit testing library (using autoconf, automake, and libtool) to better fit my needs (I don't need a super large amount of features, just a test runner and assertions). I have gotten to the point where it seems to be usable.
Of course, it uses a config.h to figure out what headers to include. The problem is that I am not sure where config.h should go since it will tend to clash easily with other project's config.h, as well as the fact that it is architecture dependent.
What should my method be for installing this header? (It is needed by all the other headers)
The ax_prefix_config_h macro sounds like what you want. It provides a way to create another config.h-like file that contains the config.h information prefixed. So, e.g., instead of #define HAVE_SOMETHING in config.h you'll get #define MYLIB_HAVE_SOMETHING in mylib_config.h. Quite handy.
You shouldn't be exporting config.h
in your library's interface anyway.
This link shows a method of getting around that if your installed headers really, truly need to be platform dependent. It is a fragile method using an outdated autoconf macro though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With