]> granicus.if.org Git - postgresql/commitdiff
Unlink static libraries before rebuilding them.
authorNoah Misch <noah@leadboat.com>
Sun, 1 Mar 2015 18:05:23 +0000 (13:05 -0500)
committerNoah Misch <noah@leadboat.com>
Sun, 1 Mar 2015 18:07:17 +0000 (13:07 -0500)
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
src/port/Makefile

index 4af852e1e46698a6648da475a03fca002c5038a7..7b062a93fafadaa388ae4bf0f3b15f676e5d05bb 100644 (file)
@@ -343,6 +343,7 @@ all-shared-lib: $(shlib)
 
 ifndef haslibarule
 $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+       rm -f $@
        $(LINK.static) $@ $^
        $(RANLIB) $@
 endif #haslibarule
@@ -385,6 +386,7 @@ else # PORTNAME == aix
 
 # AIX case
 $(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+       rm -f $(stlib)
        $(LINK.static) $(stlib) $^
        $(RANLIB) $(stlib)
        $(MKLDEXPORT) $(stlib) >$(exports_file)
@@ -405,6 +407,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) $@
 
index 60295dcdefde103dc5aa52e6062940acef56b894..63cd5c97b8891cf4112ae8da5323494e708597ef 100644 (file)
@@ -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)
@@ -61,6 +62,7 @@ thread.o: thread.c
 #
 
 libpgport_srv.a: $(OBJS_SRV)
+       rm -f $@
        $(AR) $(AROPT) $@ $^
 
 %_srv.o: %.c