changeset 39080:5d41ea9358ec

module: nested automake conditionals workaround
author Dmitry Selyutin <ghostmansd@gmail.com>
date Mon, 04 Dec 2017 19:58:34 +0300
parents 2d8230b9dbfa
children d2c0653203ad
files pygnulib/module.py
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pygnulib/module.py	Mon Dec 04 19:46:20 2017 +0300
+++ b/pygnulib/module.py	Mon Dec 04 19:58:34 2017 +0300
@@ -567,9 +567,18 @@
                         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