From b1346822f3048ede254647f3a46186e4c0ec68d6 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sat, 1 Dec 2012 16:04:39 -0500
Subject: [PATCH] Make sure sharedir/extension/ directory is created when
 needed.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The previous coding worked as long as MODULEDIR wasn't set explicitly,
because we create sharedir/$(datamoduledir) and the default value of
that is "extension".  But if some other value is specified for MODULEDIR
then the installation directory needed for the control file wasn't made.

Cédric Villemain
---
 src/makefiles/pgxs.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 318d5ef3070..fd6473fd910 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -146,6 +146,9 @@ endif # MODULE_big
 
 
 installdirs:
+ifneq (,$(EXTENSION))
+	$(MKDIR_P) '$(DESTDIR)$(datadir)/extension'
+endif
 ifneq (,$(DATA)$(DATA_built))
 	$(MKDIR_P) '$(DESTDIR)$(datadir)/$(datamoduledir)'
 endif
-- 
GitLab