Templates - Mailing list pgsql-hackers

From eisentrp@csis.gvsu.edu
Subject Templates
Date
Msg-id Pine.LNX.4.21.0007100853010.19559-100000@eos05.csis.gvsu.edu
Whole thread Raw
Responses Re: Templates  ("Oliver Elphick" <olly@lfix.co.uk>)
Re: Templates  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: more corruption
Next
From: eisentrp@csis.gvsu.edu
Date:
Subject: Re: Re: postgres TODO