Re: pgxs question - linking c-functions to external libraries

Поиск
Список
Период
Сортировка
От Alan Nilsson
Тема Re: pgxs question - linking c-functions to external libraries
Дата
Msg-id 3513A941-1027-4825-8E91-F0AEC4C3843D@apple.com
обсуждение исходный текст
Ответ на Re: pgxs question - linking c-functions to external libraries  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: pgxs question - linking c-functions to external libraries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I recently had need to do the same thing and I am having no luck.  Admittedly, I am not too keen on the postgres build setup and have not debugged this extensively, but rather hoped there was an easy answer up front.  That said….

I am trying to link libuuid into a custom extension, here is my make file (building PG 9.3.5 on CentOS 6.5 (GCC 4.4.7) fwiw):

MODULES = aitpowerpg
EXTENSION = aitpowerpg
DATA = aitpowerpg--1.0.sql

SHLIB_LINK += -luuid

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/aitpowerpg
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

The line SHLIB_LINK += -luuid has no effect.  All of postgres builds & runs ok, this custom module builds fine but won’t load due to missing symbols which makes sense since ldd shows that libuuid is not linked in.

If I make clean, make, then just execute the last gcc invocation to link the extension then manually tack -luuid at the end, all is good.

Is there something simple I’m missing?

thanks
alan

On Jun 19, 2013, at 6:57 AM, Peter Eisentraut <peter_e@gmx.net> wrote:

On 6/6/13 11:49 PM, Rad Cirskis wrote:
Hi John,
have you managed to get it to link with external shared libs?

Sure, many extensions to that.  Do something like

SHLIB_LINK += -lfoo

in your Makefile.



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

В списке pgsql-general по дате отправления:

Предыдущее
От: Marc Mamin
Дата:
Сообщение: Re: Removing duplicate records from a bulk upload (rationale behind selecting a method)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgxs question - linking c-functions to external libraries