Thread: Get extensions directory programmatically in another Makefile

Get extensions directory programmatically in another Makefile

From
Igor Stassiy
Date:
Hello,

This might seem like an XY problem, but I need to solve it. 

I am using pgxs to install an extension but I need to refer to the location of the installation directory in another Makefile. 

How safe is it to assume that MODULE_PATHNAME that I use for CREATE FUNCTION ... AS 'MODULE_PATHNAME'

can be used as 

PG_CONFIG = pg_config
PGXS_PKGLIBDIR = $(shell $(PG_CONFIG) --pkglibdir)
PGXS_MODULESDIR = $(shell $(PG_CONFIG) --sharedir)/extension

in another Makefile?

Thanks,
Igor