]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Follow gnulib-tool changes, part 52.
authorCollin Funk <collin.funk1@gmail.com>
Mon, 11 Mar 2024 04:50:59 +0000 (21:50 -0700)
committerBruno Haible <bruno@clisp.org>
Mon, 11 Mar 2024 11:37:12 +0000 (12:37 +0100)
Follow gnulib-tool change
2021-12-15  Bruno Haible  <bruno@clisp.org>
automake-subdir support: Look for 'subdir-objects' also in configure.ac.

* pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects'
in the AM_INIT_AUTOMAKE macro of configure.ac.

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

index 324e0bc04f440e136dc1f7b6d3d2906e60f48dbc..9135b6b7794473437b5b87b871af4c68e7d72e54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-11  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Follow gnulib-tool changes, part 52.
+       Follow gnulib-tool change
+       2021-12-15  Bruno Haible  <bruno@clisp.org>
+       automake-subdir support: Look for 'subdir-objects' also in configure.ac.
+       * pygnulib/GLImport.py (GLImport.__init__): Check for 'subdir-objects'
+       in the AM_INIT_AUTOMAKE macro of configure.ac.
+
 2024-03-10  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Tweak last commit.
index 51e6cd9e1815df652327ffdaefb454d3d2f5de6f..e6c94c8bb842e5c17722418ed0d42da36e7e5403 100644 (file)
@@ -305,17 +305,6 @@ Date:   Sun Dec 19 12:49:16 2021 +0100
 
 --------------------------------------------------------------------------------
 
-commit b8124d982f454b8526b5e11934a2f71faac2b600
-Author: Bruno Haible <bruno@clisp.org>
-Date:   Wed Dec 15 21:49:41 2021 +0100
-
-    automake-subdir support: Look for 'subdir-objects' also in configure.ac.
-
-    * gnulib-tool: Look for the automake options also in the first argument
-    of the AM_INIT_AUTOMAKE invocation in configure.ac.
-
---------------------------------------------------------------------------------
-
 commit 4b071c115309079528db7b60e8d2ffb22b129088
 Author: Paul Eggert <eggert@cs.ucla.edu>
 Date:   Mon Apr 26 23:31:29 2021 -0700
index 64a0bc9b131ac49575ae582e82ae5169a8ac6c5f..de2961c55ed4fc72d124b6035c31644e004abdc7 100644 (file)
@@ -261,12 +261,22 @@ class GLImport(object):
 
         # Determine whether --automake-subdir is supported.
         if self.config['automake_subdir']:
-            found_subdir_objects = False
+            automake_options = set()
+            if self.config['destdir']:
+                pattern = re.compile(r'^.*AM_INIT_AUTOMAKE\([\[ ]*([^\]\)]*).*$', re.MULTILINE)
+                with open(self.config['configure_ac'], encoding='utf-8') as file:
+                    data = file.read()
+                configure_ac_automake_options = pattern.findall(data)
+                if configure_ac_automake_options:
+                    automake_options = { x
+                                         for y in configure_ac_automake_options
+                                         for x in y.split() }
+            found_subdir_objects = 'subdir-objects' in automake_options
             if self.config['destdir']:
                 base = self.config['destdir']
             else:
                 base = '.'
-            if isfile(joinpath(base, 'Makefile.am')):
+            if not found_subdir_objects and isfile(joinpath(base, 'Makefile.am')):
                 pattern = re.compile(r'^AUTOMAKE_OPTIONS[\t ]*=(.*)$', re.MULTILINE)
                 with open(joinpath(base, 'Makefile.am'), encoding='utf-8') as file:
                     data = file.read()