From: Rafael L. <lab...@ps...> - 2003-01-29 11:45:43
|
Thanks, Maurice, for the very clear message stating exactly what the problem is. * Maurice LeBrun <mj...@ga...> [2003-01-29 04:34]: > In summary: > > - There should be a clear distinction drawn between these two different > styles of defines. One is useful to the user, the other essentially only > useful internally. > > - The assumption present in some GNU packages that the existence of the > HAVE_CONFIG_H define implies the existence of a config.h header is at > odds with our current configuration. We should fix this. I think that the right approach to this is to create a top-level config.h file (eventually using autoheader) that will contain all the defines that shouldn't appear in the user namespace and remove them from plConfig.h. In plConfig.h, we add: #if HAVE_CONFIG_H # include <config.h> #endif Remeber that -DHAVE_CONFIG_H is automatically added by automake to the CFLAGS when the package is built, so the scheme above should work. Now, when users will compile their applications linked against the PLplot library, the config.h file will not be included, unless they (foolishly and unnecessarily) #define HAVE_CONFIG_H. In configure.ac, we should use: AC_CONFIG_HEADERS([config.h include/plConfig.h include/plDevs.h]) Notice that there is a beneficial side-effect to this: many of the autoheader problems that we were experiencing may be fixed, since autoheader only acts on the first argument of the macro AC_CONFIG_HEADERS. What do you think? > I guess this way of handling it among "gnu programs" represents some sort > of overall plan but I don't like it much. I do not think that this is an overall plan, but a convinience to only include build-related definitions at build time. -- Rafael |