Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autoconf - Where does config.h go?

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)

like image 894
alternative Avatar asked Nov 27 '09 18:11

alternative


2 Answers

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.

like image 165
Rhys Ulerich Avatar answered Sep 28 '22 19:09

Rhys Ulerich


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.

like image 30
ptomato Avatar answered Sep 28 '22 18:09

ptomato