Here is a patch so that the backend is linked in one piece instead of using
the SUBSYS.o files.
The question is how we want to activate that. I currently used make
BIGLINK=1, which is obviously just for testing. Should we just turn it on by
default and see if anyone complains?
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
diff -ur ../cvs-pgsql/src/backend/common.mk ./src/backend/common.mk
--- ../cvs-pgsql/src/backend/common.mk 2008-02-19 11:30:06.000000000 +0100
+++ ./src/backend/common.mk 2008-02-22 08:14:10.000000000 +0100
@@ -4,22 +4,31 @@
# $PostgreSQL: pgsql/src/backend/common.mk,v 1.1 2008/02/19 10:30:06 petere Exp $
#
-SUBDIROBJS = $(SUBDIRS:%=%/SUBSYS.o)
+ifdef BIGLINK
+subsysfilename = objfiles.txt
+else
+subsysfilename = SUBSYS.o
+endif
+
+SUBDIROBJS = $(SUBDIRS:%=%/$(subsysfilename))
-all: SUBSYS.o
+all: $(subsysfilename)
SUBSYS.o: $(SUBDIROBJS) $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^
+objfiles.txt: $(SUBDIROBJS) $(OBJS)
+ ( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS)) ) >$@
+
$(SUBDIROBJS): $(SUBDIRS:%=%-recursive) ;
.PHONY: $(SUBDIRS:%=%-recursive)
$(SUBDIRS:%=%-recursive):
- $(MAKE) -C $(subst -recursive,,$@) SUBSYS.o
+ $(MAKE) -C $(subst -recursive,,$@) all
clean: clean-local
clean-local:
ifdef SUBDIRS
for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean || exit; done
endif
- rm -f SUBSYS.o $(OBJS)
+ rm -f $(subsysfilename) $(OBJS)
diff -ur ../cvs-pgsql/src/backend/Makefile ./src/backend/Makefile
--- ../cvs-pgsql/src/backend/Makefile 2008-01-05 11:58:43.000000000 +0100
+++ ./src/backend/Makefile 2008-02-22 08:15:29.000000000 +0100
@@ -18,7 +18,13 @@
main nodes optimizer port postmaster regex rewrite \
storage tcop tsearch utils $(top_builddir)/src/timezone
-SUBSYSOBJS = $(DIRS:%=%/SUBSYS.o)
+ifdef BIGLINK
+subsysfilename = objfiles.txt
+else
+subsysfilename = SUBSYS.o
+endif
+
+SUBSYSOBJS = $(DIRS:%=%/$(subsysfilename))
ifeq ($(enable_dtrace), yes)
LOCALOBJS += utils/probes.o
@@ -41,7 +47,7 @@
ifneq ($(PORTNAME), aix)
postgres: $(OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $(foreach file,$(filter %/objfiles.txt,$^),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file))))) $(filter-out %/objfiles.txt,$^) $(LIBS) -o $@
endif
endif
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq