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 <pete...@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