Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 = "">

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@xxxxxxx> 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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux