From 5c410fa0b9aeb08631341e06c09bbb6cb3037844 Mon Sep 17 00:00:00 2001 From: Bryan Henderson Date: Sat, 23 Nov 1996 09:51:57 +0000 Subject: [PATCH] First pass at getting shared libraries on AIX properly built. --- src/Makefile.global | 13 +++++++++---- src/backend/Makefile | 39 +++++++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/Makefile.global b/src/Makefile.global index 2aa1c811c4..35883f6348 100644 --- a/src/Makefile.global +++ b/src/Makefile.global @@ -7,7 +7,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.73 1996/11/18 16:32:53 momjian Exp $ +# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.74 1996/11/23 09:50:34 bryanh Exp $ # # NOTES # Essentially all Postgres make files include this file and use the @@ -342,15 +342,20 @@ CFLAGS_BE= -qchars=signed -qmaxmem=4000 EXPSUFF= .exp +POSTGRES_EXP= $(SRCDIR)/backend/postgres$(EXPSUFF) + MKLDEXPORT=$(SRCDIR)/backend/port/aix/mkldexport.sh %$(EXPSUFF): %.o $(MKLDEXPORT) $< `pwd` > $@ -%.so: %.o %$(EXPSUFF) - @echo The link stage here: +$(POSTGRES_EXP): + $(MAKE) -C $(SRCDIR)/backend postgres.exp + +%.so: %.o %$(EXPSUFF) $(POSTGRES_EXP) + @echo Making share library $@ from $*.o, $*$(EXPSUFF), and postgres.exp $(LD) -H512 -T512 -o $@ -e _nostart \ - -bI:$(LIBDIR)/postgres$(EXPSUFF) -bE:$*$(EXPSUFF) \ + -bI:$(POSTGRES_EXP) -bE:$*$(EXPSUFF) \ $*.o -lm -lc 2>/dev/null endif diff --git a/src/backend/Makefile b/src/backend/Makefile index 5578e2be9e..40b6b264ec 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -34,7 +34,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.16 1996/11/18 02:23:41 bryanh Exp $ +# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.17 1996/11/23 09:51:57 bryanh Exp $ # #------------------------------------------------------------------------- @@ -53,7 +53,13 @@ ifdef TIOGA OBJS += tioga/SUBSYS.o endif -all: postgres global1.bki.source local1_template1.bki.source +ifeq ($(MAKE_EXPORTS), true) +EXP = postgres$(EXPSUFF) +else +EXP = +endif + +all: postgres $(EXP) global1.bki.source local1_template1.bki.source postgres: postgres_group1 postgres_group2 postgres_group3 postgres_group4 $(CC) $(LDFLAGS) -o postgres $(OBJS) $(LDADD) @@ -89,6 +95,11 @@ global1.bki.source local1_template1.bki.source: $(MAKE) -C catalog $@ cp catalog/$@ . +# The postgres.o target is needed by the rule in Makefile.global that +# creates the exports file when MAKE_EXPORTS = true. +postgres.o: $(OBJS) + $(CC) $(LDFLAGS) -r -o postgres.o $(OBJS) $(LDADD) + ############################################################################ # The following targets are specified in make commands that appear in the @@ -168,25 +179,25 @@ endif # and (2) the parameters of a database system should be set at initdb time, # not at postgres build time. -D_LIBDIR = $(DESTDIR)$(LIBDIR) -D_BINDIR = $(DESTDIR)$(BINDIR) - -install: $(D_LIBDIR) $(D_BINDIR) $(HEADERDIR) postgres fmgr.h\ +install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(EXP) fmgr.h\ global1.bki.source local1_template1.bki.source \ - libpq/pg_hba.conf.sample + libpq/pg_hba.conf.sample - $(INSTALL) $(INSTL_EXE_OPTS) postgres $(D_BINDIR)/postgres - @rm -f $(D_BINDIR)/postmaster - cd $(D_BINDIR); ln -s postgres postmaster + $(INSTALL) $(INSTL_EXE_OPTS) postgres $(BINDIR)/postgres +ifeq ($(MAKE_EXPORTS), true) + $(INSTALL) $(INSTLOPTS) postgres$(EXPSUFF) $(LIBDIR)/postgres$(EXPSUFF) +endif + @rm -f $(BINDIR)/postmaster + cd $(BINDIR); ln -s postgres postmaster $(INSTALL) $(INSTLOPTS) fmgr.h $(HEADERDIR)/fmgr.h $(INSTALL) $(INSTLOPTS) global1.bki.source \ - $(D_LIBDIR)/global1.bki.source + $(LIBDIR)/global1.bki.source $(INSTALL) $(INSTLOPTS) local1_template1.bki.source \ - $(D_LIBDIR)/local1_template1.bki.source + $(LIBDIR)/local1_template1.bki.source $(INSTALL) $(INSTLOPTS) libpq/pg_hba.conf.sample \ - $(D_LIBDIR)/pg_hba.conf.sample + $(LIBDIR)/pg_hba.conf.sample -$(D_BINDIR) $(D_LIBDIR) $(HEADERDIR): +$(BINDIR) $(LIBDIR) $(HEADERDIR): mkdir $@ ############################################################################# -- 2.40.0