Re: Frustrating issue with PGXS

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Eddie Stanley <eddiewould(at)paradise(dot)net(dot)nz>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, mux(at)elvis(dot)mu(dot)org
Subject: Re: Frustrating issue with PGXS
Date: 2007-06-25 17:56:56
Message-ID: Pine.LNX.4.64.0706251947020.8775@briare.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> ifdef USE_PGXS
> PGXS := $(shell pg_config --pgxs)
> include $(PGXS)
>
> but something like
>
> ifdef USE_PGXS
> PG_CONFIG := pg_config
> PGXS := $(shell $(PG_CONFIG) --pgxs)
> include $(PGXS)
>
> to sync these invocations of pg_config with the ones in
> Makefile.global. I'm not sure though how to get this setting to
> override the one in Makefile.global ... or should we just remove
> that one?

That would break existing Makefiles that use the "please take the first
pg_config in the path" feature, which rather make sense (it just means
that you want the extension for your current postgresql).

However you may replace the other appearance with the following:

ifndef PG_CONFIG
PG_CONFIG = pg_config
endif

So as to enable

sh> make PG_CONFIG=/my/manual/path/to/pg_config install

invocations without fear to be overwritten, if some people do not like the
path convention. Otherwise the following does the trick with a temporary
replacement of the PATH environment variable just for one command under
sh-compatible shells:

sh> PATH=/my/manual/path/to:$PATH make install

and is shorter. This could be added to the documentation.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-06-25 18:03:06 Re: Frustrating issue with PGXS
Previous Message Tom Lane 2007-06-25 17:31:52 Re: Bugtraq: Having Fun With PostgreSQL