]> Savannah Git Hosting - gnulib.git/commitdiff
module: nested automake conditionals workaround
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 4 Dec 2017 16:58:34 +0000 (19:58 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Mon, 4 Dec 2017 16:58:34 +0000 (19:58 +0300)
pygnulib/module.py

index c0a322e4f51da3a02565356b2844c2438ee3cdc0..7bc1b184698ecb0b6b66cd0c3035c59965762e27 100644 (file)
@@ -567,9 +567,18 @@ def transitive_closure(lookup, modules, **options):
                         pass # ignore non-existent tests
                 for (dependency, condition) in demander.dependencies:
                     module = lookup(dependency)
-                    if not _exclude_(module):
+                    if gnumake and condition.startswith("if "):
+                        # A module whose Makefile.am snippet contains a reference to an
+                        # automake conditional. If we were to use it conditionally, we
+                        # would get an error
+                        #   configure: error: conditional "..." was never defined.
+                        # because automake 1.11.1 does not handle nested conditionals
+                        # correctly. As a workaround, make the module unconditional.
+                        current.add((module, None, None))
+                    else:
                         condition = condition if condition.strip() else None
-                        current.add((module, demander, condition))
+                        if not _exclude_(module):
+                            current.add((module, demander, condition))
                 queue.add(demander)
         return current