]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Follow gnulib-tool changes, part 60.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 17 Mar 2024 01:49:35 +0000 (18:49 -0700)
committerBruno Haible <bruno@clisp.org>
Sun, 17 Mar 2024 11:04:04 +0000 (12:04 +0100)
Follow gnulib-tool change
2019-11-18  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Fix build error on macOS with --conditional-dependencies.

* pygnulib/GLModuleSystem.py (GLModuleTable.add_dummy): Ignore modules
that are conditionally enabled.

ChangeLog
gnulib-tool.py.TODO
pygnulib/GLModuleSystem.py

index 1f86609ac9f1dee109568c22f20dfa4552a56bd1..a410ee13468dc0c070c3276ae48d8f24f45160f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-17  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Follow gnulib-tool changes, part 60.
+       Follow gnulib-tool change
+       2019-11-18  Bruno Haible  <bruno@clisp.org>
+       gnulib-tool: Fix build error on macOS with --conditional-dependencies.
+       * pygnulib/GLModuleSystem.py (GLModuleTable.add_dummy): Ignore modules
+       that are conditionally enabled.
+
 2024-03-17  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Don't try to remove files that don't exist.
index 8d76b38cd9bdf54a9803629852e4e66bdfa4277b..c02c9d1918fe1e5ace3a0327adc0c5189c3f6a1d 100644 (file)
@@ -161,17 +161,6 @@ Date:   Sat Feb 22 15:15:01 2020 +0100
 
 --------------------------------------------------------------------------------
 
-commit 0d41dbc7c88b10d16751466ec91efa75951426bb
-Author: Bruno Haible <bruno@clisp.org>
-Date:   Mon Nov 18 13:32:46 2019 +0100
-
-    gnulib-tool: Fix build error on macOS with --conditional-dependencies.
-
-    * gnulib-tool (func_modules_add_dummy): Ignore modules that are
-    conditionally enabled.
-
---------------------------------------------------------------------------------
-
 commit 30459fe101541698ec704acb224946d73676750e
 Author: Bruno Haible <bruno@clisp.org>
 Date:   Thu Jun 8 15:09:31 2017 +0200
index cbe2534c72a18328c3c7d8d6c5a09667317fc158..9f3a3a79d7583caa5f5f47006e32aa6bcf85eb9f 100644 (file)
@@ -1066,9 +1066,10 @@ class GLModuleTable(object):
 
         Add dummy package to list of modules if dummy package is needed. If not,
         return original list of modules.
-        GLConfig: auxdir, ac_version.'''
+        GLConfig: auxdir, ac_version, conddeps.'''
         auxdir = self.config['auxdir']
         ac_version = self.config['ac_version']
+        conddeps = self.config['conddeps']
         for module in modules:
             if type(module) is not GLModule:
                 raise TypeError('each module must be a GLModule instance')
@@ -1076,17 +1077,22 @@ class GLModuleTable(object):
         have_lib_sources = False
         for module in modules:
             if not module.isTests():
-                snippet = module.getAutomakeSnippet()
-                # Extract the value of "lib_SOURCES += ...".
-                snippet = constants.remove_backslash_newline(snippet)
-                pattern = re.compile('^lib_SOURCES[\t ]*\\+=([^#]*).*$', re.M)
-                for matching_rhs in pattern.findall(snippet):
-                    files = matching_rhs.split(' ')
-                    for file in files:
-                        # Ignore .h files since they are not compiled.
-                        if not file.endswith('.h'):
-                            have_lib_sources = True
-                            break
+                if conddeps and self.isConditional(module):
+                    # Ignore conditional modules, since they are not guaranteed to
+                    # contribute to lib_SOURCES.
+                    pass
+                else:
+                    snippet = module.getAutomakeSnippet()
+                    # Extract the value of "lib_SOURCES += ...".
+                    snippet = constants.remove_backslash_newline(snippet)
+                    pattern = re.compile('^lib_SOURCES[\t ]*\\+=([^#]*).*$', re.M)
+                    for matching_rhs in pattern.findall(snippet):
+                        files = matching_rhs.split(' ')
+                        for file in files:
+                            # Ignore .h files since they are not compiled.
+                            if not file.endswith('.h'):
+                                have_lib_sources = True
+                                break
         # Add the dummy module, to make sure the library will be non-empty.
         if not have_lib_sources:
             dummy = self.modulesystem.find('dummy')