Re: Configure problem, redux (was Re: TCL installation troubles) - Mailing list pgsql-hackers

From Brook Milligan
Subject Re: Configure problem, redux (was Re: TCL installation troubles)
Date
Msg-id 199810271842.LAA06261@trillium.nmsu.edu
Whole thread Raw
In response to Configure problem, redux (was Re: TCL installation troubles)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Re: Configure problem, redux (was Re: TCL installation troubles)  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
I'm not certain how best to handle the SQL scripts that need to know  where libdir is, but I can think of several
possibilities,one being  that "create function" could have a library search path built into it,  thus pushing the
knowledgeof where libdir is into some C code (which  would probably be getting it from the PGLIB environment variable).
Or we could put the value of libdir into a system table somewhere that  the scripts can read at runtime.
 

The way to handle this is to have rules in the Makefile that do the
substitution.  For example, something like the following Makefile
fragment will do the trick, even if the definitition of $libdir in
Makefile.global is modified after configure is run.
    SRCDIR=../../..    include ${SRCDIR}/Makefile.global    mklang.sql: mklang.sql.in ${SRCDIR}/Makefile.global     sed
<$< > $@ -e 's:@libdir@:${libdir}:'
 

If I remember correctly, this is used in contrib/spi and should be
common practice throughout.

Your suggestion of a single central Makefile.global/config.h to
contain all the configure decisions is a good one.  Together with
rules such as above in the various appropriate places, the problems of
variable expansion and post-configure modifications disappear.
Perhaps not for 6.4, though.

Cheers,
Brook


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Configure problem, redux (was Re: TCL installation troubles)
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] make install fails in perl5 ...