A Makefile.am like

        bin_PROGRAMS =
        lib_LTLIBRARIES = library1.la
        pkglib_LTLIBRARIES = library2.la
        library2_LIBADD = library1.la

produces, in Makefile.in,

        install-binPROGRAMS: install-libLTLIBRARIES

but no

        install-pkglibLTLIBRARIES: install-libLTLIBRARIES

therefore potentially breaking `make install -j`. Rectify this by
depending on install-libLTLIBRARIES not just for bin_PROGRAMS, but
all PROGRAMS and LTLIBRARIES.

Signed-off-by: Jan Engelhardt <jeng...@inai.de>
---
 bin/automake.in | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git bin/automake.in bin/automake.in
index f04f5d5f5..273415ca0 100644
--- bin/automake.in
+++ bin/automake.in
@@ -8042,13 +8042,24 @@ sub generate_makefile
   handle_all ($makefile);
 
   # FIXME: Gross!
-  if (var ('lib_LTLIBRARIES') && var ('bin_PROGRAMS'))
+  for my $var (variables("PROGRAMS"), variables("LTLIBRARIES"))
     {
-      $output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n";
-    }
-  if (var ('nobase_lib_LTLIBRARIES') && var ('bin_PROGRAMS'))
-    {
-      $output_rules .= "install-binPROGRAMS: 
install-nobase_libLTLIBRARIES\n\n";
+      if ($var->name eq "lib_LTLIBRARIES"
+          || $var->name eq "nobase_lib_LTLIBRARIES"
+          || substr($var->name, 0, 7) eq "noinst_")
+        {
+          next;
+        }
+      my $shortname = $var->name;
+      $shortname =~ tr{_}{}d;
+      if ($have_lt1)
+        {
+          $output_rules .= "install-$shortname: install-libLTLIBRARIES\n\n";
+        }
+      if ($have_lt2)
+        {
+          $output_rules .= "install-$shortname: 
install-nobase_libLTLIBRARIES\n\n";
+        }
     }
 
   handle_install;
-- 
2.32.0


Reply via email to