Re: Templates

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Templates
Date: 2000-07-10 22:25:26
Message-ID: Pine.LNX.4.21.0007102030400.28566-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane writes:

> The problem is to select an appropriate template if none of the
> patterns in template/.similar match your platform name. We have had
> many cases before where the platform vendor comes out with some random
> new variant on their uname output that causes the .similar match to
> fail (Alpha's "evNN" being the latest example).

That's why this is wrong. We currently rely on the OS name, maybe the
complete triple, maybe the uname output. Of course we have no idea whether
it will work.

That is the very reason why config.guess and config.sub were invented, and
that's why we should use them exclusively, IMHO. All the possible outputs
of config.guess are known to us now, so there should be no surprises when
somebody changes their uname.

We ought to make use of the information given to us if possible and not
try to construct our own, much poorer, information instead.

Another problem with --with-template is this:

* user specifies --with-template=foonix_gcc
* template sets CC=gcc
* AC_PROG_CC assumes "gcc" as compiler

Maybe the user's compiler isn't called "gcc", maybe it's called "egcs"
(like mine), or "gcc2", or "/opt/experimental/gcc-3.19/bin/gcc".

Okay, maybe the other way around:

* user runs "CC=egcs ./configure"
* AC_PROG_CC verifies "egcs" as compiler
* template "foonix_gcc" gets chosen
* template sets CC=gcc -- boom!

So the compiler information must disappear from the template files.

If you accept that then we could make --with-template specify the
"template prefix" and the compiler information gets added on if it turns
out there are two templates "name_cc" and "name_gcc". Then we'd have the
procedure

AC_PROG_CC
if --with-template was given, use that
else find one yourself

Btw: Just today someone wrote about this very problem ("[GENERAL] [Help]
INSTALLing 7.02").

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-10 22:26:38 Re: Distribution making
Previous Message Peter Eisentraut 2000-07-10 22:24:36 Re: pg_backup symlink?