summaryrefslogtreecommitdiff
path: root/src/Makefile.shlib
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2015-03-01 13:05:23 -0500
committerNoah Misch <noah@leadboat.com>2015-03-01 13:05:23 -0500
commit424793fa5dc631254f69d5ee8d7d7d6de2976f60 (patch)
tree9b4da48cfdc77a631b50b09a0ff4835938947796 /src/Makefile.shlib
parent097fe194aa7c590b4fa43d5e40c083940859c286 (diff)
downloadpostgresql-424793fa5dc631254f69d5ee8d7d7d6de2976f60.tar.gz
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).
Diffstat (limited to 'src/Makefile.shlib')
-rw-r--r--src/Makefile.shlib3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 739033f78e..f96c7092d8 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -296,6 +296,7 @@ all-shared-lib: $(shlib)
ifndef haslibarule
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $@
$(LINK.static) $@ $^
$(RANLIB) $@
endif #haslibarule
@@ -337,6 +338,7 @@ else # PORTNAME == aix
# AIX case
$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+ rm -f $(stlib)
$(LINK.static) $(stlib) $^
$(RANLIB) $(stlib)
$(MKLDEXPORT) $(stlib) >$(exports_file)
@@ -356,6 +358,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) $@