[Monetdb-developers] configure & *_config.h include files

Fabian Groffen Fabian.Groffen at cwi.nl
Fri Dec 1 19:21:33 CET 2006


This is now also a problem for M5, and it is more or less blocking my
development right now.

On 24-09-2006 10:48:51 +0200, Jens Teubner wrote:
[snip]
> This would mean that MonetDB was compiled with some option.  Then, e.g.,
> Pathfinder is linked against MonetDB under the assumption that MonetDB
> uses some some different options.
> 
> So the problem is definitely not a trivial one.  Let me throw in some
> thoughts:
> 
> The only thing we need to access from some MonetDB add-on (e.g.,
> Pathfinder) are its *interfaces* to specific functionality.  So the
> first question is: Must these interfaces be dependent on the outcome of
> ./configure (that is, are there any type declarations, function
> declarations, etc. in the *interfaces* from an add-on to MonetDB that
> depend on ./configure?).  If they aren't, we should factor out stable
> interfaces (that are independent of the ./configure run and, hence,
> don't include monetdb_config.h) and only reference those from outside.
> 
> If they *are* dependent, we may still take the same road and *generate*
> interfaces (i.e., include files) when compiling MonetDB that only depend
> on the ./configure outcome once (during generation).  I'm thinking of a
> file that only contains
> 
>   typeA_t foo (...)
> 
> and not
> 
>   #if HAVE_FOO
>   typeA_t foo (...)
>   #else
>   typeB_t foo (...)
>   #endif
> 
> These ideas pretty much go into the direction of this proposal of
> Stefan:
> 
> > To solve (1) (and (2)) "properly", we could avoid the implicit
> > inclusion of monetdb_config.h in monet_utils.h (and hence gdk.h &
> > monet.h) by removing the respective include from monet_utils.h.
> > But then, we'd have to explicitly include monetdb_config.h in each .c
> > file that now includes one of monet_utils.h, gdk.h, monet.h (directly
> > or via some other include) --- a lot of work, with a high risk to
> > overlook some locations...
> 
> So these are my comments, ideas, complaints, objections. :-)

I think this is "The" only way to do it right.  But M4 is not worth it
to spend the time on.  Since M5 depends on M4 at the moment and has the
same problem, it might be a better solution to solve this in M5 now.

I cannot define VERSION in M5 for instance, because I get the contents
of the M4 configure and defines.




More information about the developers-list mailing list