mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-14 10:27:04 +08:00
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.
44 lines
1.1 KiB
Makefile
44 lines
1.1 KiB
Makefile
# MAKE_EXPORTS is required for svr4 loaders that want a file of
|
|
# symbol names to tell them what to export/import.
|
|
MAKE_EXPORTS= true
|
|
|
|
RANLIB= touch
|
|
AROPT = crs
|
|
|
|
# -blibpath must contain ALL directories where we should look for libraries
|
|
libpath := $(shell echo $(subst -L,:,$(filter -L/%,$(LDFLAGS))) | sed -e's/ //g'):/usr/lib:/lib
|
|
|
|
ifeq ($(host_os), aix3.2.5)
|
|
rpath = -L'$(rpathdir)'
|
|
else
|
|
rpath = -Wl,-blibpath:'$(rpathdir)$(libpath)'
|
|
endif
|
|
|
|
DLSUFFIX = .so
|
|
ifeq ($(host_os), aix3.2.5)
|
|
ifneq ($(GCC), yes)
|
|
LDFLAGS_SL += -e _nostart -H512 -bM:SRE
|
|
endif
|
|
else
|
|
LDFLAGS_SL += -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE
|
|
endif
|
|
|
|
|
|
POSTGRES_IMP= postgres.imp
|
|
|
|
ifdef PGXS
|
|
BE_DLLLIBS= -Wl,-bI:$(pkglibdir)/$(POSTGRES_IMP)
|
|
else
|
|
BE_DLLLIBS= -Wl,-bI:$(top_builddir)/src/backend/$(POSTGRES_IMP)
|
|
endif
|
|
|
|
MKLDEXPORT_DIR=src/backend/port/aix
|
|
MKLDEXPORT=$(top_srcdir)/$(MKLDEXPORT_DIR)/mkldexport.sh
|
|
|
|
%.exp: %.o
|
|
$(MKLDEXPORT) $^ >$@
|
|
|
|
# Rule for building a shared library from a single .o file
|
|
%$(DLSUFFIX): %.o %.exp
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $*.o -Wl,-bE:$*.exp $(BE_DLLLIBS)
|