summaryrefslogtreecommitdiffstats
path: root/src/makefiles/Makefile.aix
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:17:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:17:33 +0000
commit5e45211a64149b3c659b90ff2de6fa982a5a93ed (patch)
tree739caf8c461053357daa9f162bef34516c7bf452 /src/makefiles/Makefile.aix
parentInitial commit. (diff)
downloadpostgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.tar.xz
postgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.zip
Adding upstream version 15.5.upstream/15.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/makefiles/Makefile.aix')
-rw-r--r--src/makefiles/Makefile.aix45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/makefiles/Makefile.aix b/src/makefiles/Makefile.aix
new file mode 100644
index 0000000..84f26b4
--- /dev/null
+++ b/src/makefiles/Makefile.aix
@@ -0,0 +1,45 @@
+# 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
+
+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
+
+# env var name to use in place of LD_LIBRARY_PATH
+ld_library_path_var = LIBPATH
+
+
+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) $*.o $(LDFLAGS) $(LDFLAGS_SL) -o $@ -Wl,-bE:$*.exp $(BE_DLLLIBS)