Re: PGXS ignores SHLIB_LINK when linking modules

Lists: pgsql-hackers
From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: PGXS ignores SHLIB_LINK when linking modules
Date: 2012-03-07 19:39:33
Message-ID: CABRT9RAnPw+O5RPUnT=fJs5yvMYN6w0XQNXsjDD=KNzfgL=jQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I'm trying to write my first PostgreSQL C extension. I used the
pgxn-utils skeleton as a base and specified some external libraries in
SHLIB_LINK. However, this variable was ignored when linking the
library (using pgxs from current git master).

After spending quite a bit of time trying to understand the Makefile
spaghetti, I noticed that the contrib extensions are using MODULE_big
instead of MODULES. When I converted my makefile, it indeed started
working as expected.

Is there any reason that pgxs ignores SHLIB_LINK when building
MODULES? Seems like a pretty unlikely use case that someone would want
to use MODULE_big and MODULES in the same makefile, so there should to
be no ambiguity -- if SHLIB_LINK is set then it should be used.

This does NOT work:
MODULES = src/pg_journal
SHLIB_LINK = -lsystemd-journal -lsystemd-id128

And this does:
OBJS = src/pg_journal.o
MODULE_big = pg_journal
SHLIB_LINK = -lsystemd-journal -lsystemd-id128

Here's the github repository for this extension:
https://github.com/intgr/pg_journal (the makefile there currently uses
a workaround)

Regards,
Marti


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PGXS ignores SHLIB_LINK when linking modules
Date: 2012-03-08 22:04:05
Message-ID: 1331244245.1197.27.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On ons, 2012-03-07 at 21:39 +0200, Marti Raudsepp wrote:
> Is there any reason that pgxs ignores SHLIB_LINK when building
> MODULES?

No, it's just never been needed.