]> granicus.if.org Git - postgresql/blobdiff - src/Makefile.shlib
Update copyright for 2019
[postgresql] / src / Makefile.shlib
index 63d5d9e8ee47d8066b30c3a76a2e8886c2f1c445..373d73caefca34305ddc3ec363ea04c946e10cd3 100644 (file)
@@ -287,11 +287,17 @@ all-static-lib: $(stlib)
 
 all-shared-lib: $(shlib)
 
+# In this rule, "touch $@" works around a problem on some platforms wherein
+# ranlib updates the library file's mod time with a value calculated to
+# seconds precision.  If the filesystem has sub-second timestamps, this can
+# cause the library file to appear older than its input files, triggering
+# parallel-make problems.
 ifndef haslibarule
 $(stlib): $(OBJS) | $(SHLIB_PREREQS)
        rm -f $@
        $(LINK.static) $@ $^
        $(RANLIB) $@
+       touch $@
 endif #haslibarule
 
 
@@ -353,12 +359,11 @@ ifeq ($(PORTNAME), cygwin)
 # Cygwin case
 
 $(shlib): $(OBJS) | $(SHLIB_PREREQS)
-       $(CC) $(CFLAGS)  -shared -o $@  $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
+       $(CC) $(CFLAGS)  -shared -o $@ -Wl,--out-implib=$(stlib) $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
 
-$(stlib): $(OBJS) | $(SHLIB_PREREQS)
-       rm -f $@
-       $(LINK.static) $@ $^
-       $(RANLIB) $@
+# see notes in src/backend/parser/Makefile  about use of this type of rule
+$(stlib): $(shlib)
+       touch $@
 
 else
 
@@ -451,7 +456,7 @@ install-lib-static: $(stlib) installdirs-lib
        $(INSTALL_STLIB) $< '$(DESTDIR)$(libdir)/$(stlib)'
 ifeq ($(PORTNAME), darwin)
        cd '$(DESTDIR)$(libdir)' && \
-       ranlib $(stlib)
+       $(RANLIB) $(stlib)
 endif
 
 install-lib-shared: $(shlib) installdirs-lib