Re: Why are these modules built without respecting my LDFLAGS?

From: Mark Cave-Ayland <mark(dot)cave-ayland(at)siriusit(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Aaron W(dot) Swenson" <aaron(dot)w(dot)swenson(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why are these modules built without respecting my LDFLAGS?
Date: 2010-06-28 09:11:22
Message-ID: 4C28673A.10803@siriusit.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> Should we try to make that a bit more consistent, and if so how?
> The shenanigans in Makefile.shlib would get a lot simpler if we said
> that shlib links always include LDFLAGS *plus* LDFLAGS_SL, but I would
> think that that would carry substantial risk of breakage. Surely there
> are cases where linker switches are appropriate for making executables
> but not shlibs. Perhaps we should set up three variables instead of
> two, viz
> LDFLAGS = switches for linking both executables and shlibs
> LDFLAGS_EX = extra switches for linking executables only
> LDFLAGS_SL = extra switches for linking shlibs only
> Then we could get rid of that untrustworthy hack for extracting -L
> switches ...

While we're on the subject... this reminds me of another issue that's
come up a few times on the PostGIS mailing lists.

AFAICT pg_config doesn't have a method for generating LDFLAGS for libpq
client applications, only backend libraries with pg_config --libs.
Normally we just go for "-lpq" but that doesn't always seem to work on
platforms where you need to explicitly give all libpq dependencies
during link time, e.g.
http://postgis.refractions.net/pipermail/postgis-users/2010-April/026349.html.

Would LDFLAGS_EX in this case be what we need? If so, could it be
exposed via a pg_config --libpq option or similar?

ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2010-06-28 09:21:28 Re: get_whatever_oid, part 1: object types with unqualifed names
Previous Message Thom Brown 2010-06-28 08:40:12 Re: beta3 & the open items list