From: Tom Lane Date: Wed, 10 Oct 2012 01:04:26 +0000 (-0400) Subject: Fix PGXS support for building loadable modules on AIX. X-Git-Tag: REL8_4_15~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=facc2047feda0c6fc4d2028f36f5a73d6c5cfc76;p=postgresql Fix PGXS support for building loadable modules on AIX. Building a shlib on AIX requires use of the mkldexport.sh script, but we failed to install that, preventing its use from non-source-tree contexts. Also, Makefile.aix had the wrong idea about where to find the installed copy of the postgres.imp symbol file used by AIX. Per report from John Pierce. Patch all the way back, since this has been broken since the beginning of PGXS. --- diff --git a/src/backend/Makefile b/src/backend/Makefile index 1fb3468d0d..87f6d46296 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -193,6 +193,7 @@ else endif ifeq ($(MAKE_EXPORTS), true) $(INSTALL_DATA) $(POSTGRES_IMP) '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)' + $(INSTALL_PROGRAM) $(MKLDEXPORT) '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)/mkldexport.sh' endif .PHONY: install-bin @@ -211,6 +212,7 @@ endif endif ifeq ($(MAKE_EXPORTS), true) $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)' + $(mkinstalldirs) '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)' endif @@ -220,6 +222,7 @@ uninstall: rm -f '$(DESTDIR)$(bindir)/postgres$(X)' '$(DESTDIR)$(bindir)/postmaster' ifeq ($(MAKE_EXPORTS), true) rm -f '$(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)' + rm -f '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)/mkldexport.sh' endif ifeq ($(PORTNAME), cygwin) ifeq ($(MAKE_DLL), true) diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix index 696e5f4268..6ce3fda766 100644 --- a/src/makefiles/Makefile.aix +++ b/src/makefiles/Makefile.aix @@ -27,12 +27,13 @@ endif POSTGRES_IMP= postgres.imp ifdef PGXS -BE_DLLLIBS= -Wl,-bI:$(bindir)/postgres/$(POSTGRES_IMP) +BE_DLLLIBS= -Wl,-bI:$(pkglibdir)/$(POSTGRES_IMP) else BE_DLLLIBS= -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP) endif -MKLDEXPORT=$(top_srcdir)/src/backend/port/aix/mkldexport.sh +MKLDEXPORT_DIR=src/backend/port/aix +MKLDEXPORT=$(top_srcdir)/$(MKLDEXPORT_DIR)/mkldexport.sh %.exp: %.o $(MKLDEXPORT) $^ >$@