The most usual thing you want to do is to include or not include various headers depending on whether they are present or not. One way of doing this is to write .h.in into which config.status can substitute #include directives. The current macro I have for this is shown below - it's not wonderful, but it gets the job done for me. This is the sort of macro you need once you have determined that you need the header file, it is not a feature test macro.
Exactly that's the case why I wrote prefix_config_h - so that I do *not* have to maintain a dozen .h.in files with their shell-code in configure plus making the two interdependent plus being dependent on autotools. The prefixed config header *can* be installed - along with the normal package headers where there are some #ifdefs which carry the logic that is otherwise in a configure - to conditionally include system headers from within package headers. Furthermore, one can place some ac_defines that tell about some config options that one can #ifdef other parts in the headers, e.g. some typedefs. Furthermore, such an #ifdef scheme is independent of autotools - some project just detects MSVC and includes msvc-config.h that carries those prefixed defines that match the compile environment of that compiler. No configure-run is needed beforehand - but if another system can run ./configure then it will more closely be able to autconfigure the package to the environment present at that time. The thing that currently bothers me: the prefix_config_h is not folded with todays config_header functionality. It does not even add its mechanics to config.status which it should - the prefix_header is only remade at the next ./configure. No immediate reconf here. Furthermore, one could think to fully fold it with todays config_header, e.g. let there be an alternative AC_PREFIX_CONFIG_HEADER to be in the place of config_header - all the other modes would still work as with creating a normal config.h but this time it is a prefixed one. I'm sure that'd make a lot of people happy... -- cheers, guido example: http://zziplib.sf.net
