postgres.git / summary / log / commit / refs
commit c3b0baf910f3428df8b30144c1e4034c04ebe495
Author: Noah Misch <noah@leadboat.com>
Date: Sun Mar 01 18:05:23 2015 +0000
First released in: 9.5.0, 9.0.20, 9.1.16, 9.2.11, 9.3.7, 9.4.2
Unlink static libraries before rebuilding them.
When the library already exists in the build directory, "ar" preserves
members not named on its command line. This mattered when, for example,
a "configure" rerun dropped a file from $(LIBOBJS). libpgport carried
the obsolete member until "make clean". Back-patch to 9.0 (all
supported versions).
src/Makefile.shlib | 3 +++
src/port/Makefile | 2 ++
2 files changed, 5 insertions(+)
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 21ae9b37a11..e728801f5fc 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -318,6 +318,7 @@ all-shared-lib: $(shlib)
ifndef haslibarule
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $@
$(LINK.static) $@ $^
$(RANLIB) $@
endif #haslibarule
@@ -360,6 +361,7 @@ else # PORTNAME == aix
# AIX case
$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $(stlib)
$(LINK.static) $(stlib) $^
$(RANLIB) $(stlib)
$(MKLDEXPORT) $(stlib) >$(exports_file)
@@ -380,6 +382,7 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS)
$(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $@
$(LINK.static) $@ $^
$(RANLIB) $@
diff --git a/src/port/Makefile b/src/port/Makefile
index bace576d803..67677ae8937 100644
--- a/src/port/Makefile
+++ b/src/port/Makefile
@@ -50,6 +50,7 @@ uninstall:
rm -f '$(DESTDIR)$(libdir)/libpgport.a'
libpgport.a: $(OBJS)
+ rm -f $@
$(AR) $(AROPT) $@ $^
# thread.o needs PTHREAD_CFLAGS (but thread_srv.o does not)
@@ -60,6 +61,7 @@ thread.o: CFLAGS+=$(PTHREAD_CFLAGS)
#
libpgport_srv.a: $(OBJS_SRV)
+ rm -f $@
$(AR) $(AROPT) $@ $^
# Because this uses its own compilation rule, it doesn't use the
[parent: 6f419958a611]