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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alan Nilsson <anilsson(at)apple(dot)com>
Cc: PostgreSQL General Discussion Forum <pgsql-general(at)postgresql(dot)org>, Rad Cirskis <rad(dot)cirskis(at)endace(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: pgxs question - linking c-functions to external libraries
Date: 2014-12-12 21:06:49
Message-ID: 7632.1418418409@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alan Nilsson <anilsson(at)apple(dot)com> writes:
> 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.

I'm not sure how well documented this is, but pgxs.mk quoth

# SHLIB_LINK -- will be added to MODULE_big link line

Since you're using the MODULES target not the MODULE_big target, it gets
left out. Try following the pattern in the contrib/uuid-ossp Makefile.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alan Nilsson 2014-12-12 21:11:51 Re: pgxs question - linking c-functions to external libraries
Previous Message Alan Nilsson 2014-12-12 20:59:20 Re: pgxs question - linking c-functions to external libraries