Fix PGXS support for building loadable modules on AIX.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Oct 2012 01:04:20 +0000 (21:04 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Oct 2012 01:04:20 +0000 (21:04 -0400)
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.

src/backend/Makefile
src/makefiles/Makefile.aix

index a11b2b503cfe93cd4a9c50c67c5eaf846e82d828..b31eb8cfe1f81d137bb98fd6fc955b0f0f04c15f 100644 (file)
@@ -219,6 +219,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
@@ -237,6 +238,7 @@ endif
 endif
 ifeq ($(MAKE_EXPORTS), true)
    $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'
+   $(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(MKLDEXPORT_DIR)'
 endif
 
 
@@ -246,6 +248,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)
index 7bf62ae2e8a806fc28b6c31eb06754dce2033527..ef23a0008e0635073bdd6bbb268597ce0996fe50 100644 (file)
@@ -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) $^ >$@