Templates

From: eisentrp(at)csis(dot)gvsu(dot)edu
To: pgsql-hackers(at)postgresql(dot)org
Subject: Templates
Date: 2000-07-10 13:13:08
Message-ID: Pine.LNX.4.21.0007100853010.19559-100000@eos05.csis.gvsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ISTM that the template mechanism used in configure is, well, flawed. Among
the problems:

1) The templates preempt the choice of compiler. A recent report from AIX
said that it automatically picked up the "aix_41" template, only to find
out later on that there is no "cc" compiler on the system. The user had to
specify --with-template=aix_gcc. That is not appropriate for automatic
configuration.

2) Template settings clobber user settings. I expect to be able to write
CFLAGS='-g -pipe' ./configure, but configure will ingore my CFLAGS
setting. The only way to change the CFLAGS is to edit Makefile.global,
which is not an nice thing to invite users to.

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.

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.

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.

Any comments?

--
Peter Eisentraut Sernanders vaeg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message eisentrp 2000-07-10 13:14:21 Re: Re: postgres TODO
Previous Message Bruce Momjian 2000-07-10 13:11:48 Re: more corruption