Make the AIX case of Makefile.shlib safe for parallel make.
authorNoah Misch <[email protected]>
Sun, 24 Jul 2016 00:30:03 +0000 (20:30 -0400)
committerNoah Misch <[email protected]>
Sun, 24 Jul 2016 00:30:59 +0000 (20:30 -0400)
Use our typical approach, from src/backend/parser.  Back-patch to 9.1
(all supported versions).

src/Makefile.shlib

index 7b062a93fafadaa388ae4bf0f3b15f676e5d05bb..39935d3d7c94333088555f966dcf41c4a02144a5 100644 (file)
@@ -385,7 +385,16 @@ endif
 else # PORTNAME == aix
 
 # AIX case
-$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
+
+# There is no correct way to write a rule that generates two files.
+# Rules with two targets don't have that meaning, they are merely
+# shorthand for two otherwise separate rules.  To be safe for parallel
+# make, we must chain the dependencies like this.  The semicolon is
+# important, otherwise make will choose some built-in rule.
+
+$(stlib): $(shlib) ;
+
+$(shlib): $(OBJS) | $(SHLIB_PREREQS)
    rm -f $(stlib)
    $(LINK.static) $(stlib) $^
    $(RANLIB) $(stlib)