Re: Templates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Templates
Date: 2000-07-10 15:42:48
Message-ID: 826.963243768@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

eisentrp(at)csis(dot)gvsu(dot)edu writes:
> In fact, it's questionable why there is a --with-template option at
> all. The template names are based on the operating system and the
> processor, and in some cases the compiler, all of which we know exactly.

I believe it would be a bad idea to remove the option entirely, because
that would mean that if config.guess and/or configure didn't recognize
your platform, you'd have no simple way of forcing a template choice.
But I agree that --with-template is not the customary way of telling
configure which compiler you want to use.

> That way we could fix problem 1: we read the templates *after* AC_PROG_CC
> has been called. The templates don't contain any information that could
> possibly be useful before AC_PROG_CC anyway.

OK, so you envision:
1. Pick compiler using standard GNU/configure rules.
2. If --with-template not specified, assemble template name
from config.guess output and compiler name. (Use .similar
substitutions to arrive at actual template from this info.)
3. Read selected template.
Seems pretty reasonable to me.

> To fix problem 2 I can imagine this procedure: Define a list of variables
> that is legal to set in a template. (This can be kept in one place and
> extended as needed.) Before doing much of anything, configure checks which
> ones of these variables are defined in the environment and remembers
> that. After AC_PROG_CC has been called, we read the template and process
> all the variables that were not set in the environment.

Actually, one point of having the templates is specifically that they
*aren't* very tightly constrained as to what they can set. Nor do I
believe it's necessarily a good idea to let the user override the
template settings. If they know enough to do that then let them edit
the template. CFLAGS is perhaps a special case here --- I could see
appending the environment CFLAGS to what the template has, which we
could do in the templates themselves by making the customary style be
CFLAGS= whatever $(CFLAGS)
What you sketch above strikes me as a whole lot of mechanism that's
basically fighting the template idea rather than working with it.

regards, tom lane

In response to

  • Templates at 2000-07-10 13:13:08 from eisentrp

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-10 15:44:45 Re: postgres fe/be protocol
Previous Message Thomas Lockhart 2000-07-10 15:39:54 Re: Re: [GENERAL] PostgreSQL vs. MySQL