]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Follow gnulib-tool changes, part 50.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 9 Mar 2024 09:41:02 +0000 (01:41 -0800)
committerBruno Haible <bruno@clisp.org>
Sat, 9 Mar 2024 14:20:59 +0000 (15:20 +0100)
Follow gnulib-tool changes
2021-12-12  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Try to support non-recursive-gnulib-prefix-hack with tests.
2021-12-13  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Fix mistake in last commit.

* pygnulib/GLImport.py (GLImport.gnulib_comp): Expect the filetable as a
parameter instead of a list of all files. Add type checks. Invoke
AC_CONFIG_LIBOBJ_DIR based on the location of alloca.c.
(GLImport.execute): Adjust call to GLImport.gnulib_comp to reflect
parameter changes.

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

index 3295f44c10bf950dfe671180148bea64ad1e1ee1..3c3a8cfb96530da2ba73ec29087ba5202fb3ddcc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-03-09  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Follow gnulib-tool changes, part 50.
+       Follow gnulib-tool changes
+       2021-12-12  Bruno Haible  <bruno@clisp.org>
+       gnulib-tool: Try to support non-recursive-gnulib-prefix-hack with tests.
+       2021-12-13  Bruno Haible  <bruno@clisp.org>
+       gnulib-tool: Fix mistake in last commit.
+       * pygnulib/GLImport.py (GLImport.gnulib_comp): Expect the filetable as a
+       parameter instead of a list of all files. Add type checks. Invoke
+       AC_CONFIG_LIBOBJ_DIR based on the location of alloca.c.
+       (GLImport.execute): Adjust call to GLImport.gnulib_comp to reflect
+       parameter changes.
+
 2024-03-09  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Follow gnulib-tool changes, part 49.
index 7031462593319d34ac5157cb082aa2580a969974..eedb916ca99ed8f632ee4441ca965326c2a2600d 100644 (file)
@@ -344,26 +344,6 @@ Date:   Wed Dec 15 19:18:31 2021 +0100
 
 --------------------------------------------------------------------------------
 
-commit dc08febea1fc0a8c902dfa89d0abc2952873529b
-Author: Bruno Haible <bruno@clisp.org>
-Date:   Mon Dec 13 03:03:13 2021 +0100
-
-    gnulib-tool: Fix mistake in last commit.
-
-commit 4e7b4cc6fb3e3b659c98baf6db26d8a06099fbee
-Author: Bruno Haible <bruno@clisp.org>
-Date:   Mon Dec 13 02:43:21 2021 +0100
-
-    gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests.
-
-    * gnulib-tool (func_import): Synthesize an AC_CONFIG_LIBOBJ_DIR
-    invocation.
-    * m4/non-recursive-gnulib-prefix-hack.m4
-    (gl_NON_RECURSIVE_GNULIB_PREFIX_HACK): Don't invoke
-    AC_CONFIG_LIBOBJ_DIR.
-
---------------------------------------------------------------------------------
-
 commit 4b071c115309079528db7b60e8d2ffb22b129088
 Author: Paul Eggert <eggert@cs.ucla.edu>
 Date:   Mon Apr 26 23:31:29 2021 -0700
index 24c6623293b19afd8430285ae67f6852183df6ce..9ba277542520f4e1d53cc29f24711763f20af05b 100644 (file)
@@ -562,16 +562,21 @@ class GLImport(object):
             emit += 'gl_VC_FILES([%s])\n' % vc_files
         return constants.nlconvert(emit)
 
-    def gnulib_comp(self, files, gentests):
+    def gnulib_comp(self, filetable, gentests):
         '''GLImport.gnulib_comp(files) -> str
 
         Emit the contents of generated $m4base/gnulib-comp.m4 file.
         GLConfig: destdir, localpath, tests, sourcebase, m4base, pobase, docbase,
         testsbase, conddeps, libtool, macro_prefix, podomain, vc_files.
 
-        files is the list of files to use.
+        filetable is a dictionary with a category used as a key to access
+          a list of files.
         gentests is True if a tests Makefile.am is being generated, False
           otherwise.'''
+        if type(filetable) is not dict:
+            raise TypeError(f'filetable should be a dict, not {type(filetable).__name__}')
+        if type(gentests) is not bool:
+            raise TypeError(f'gentests should be a bool, not {type(gentests).__name__}')
         emit = ''
         assistant = self.assistant
         moduletable = self.moduletable
@@ -640,6 +645,21 @@ AC_DEFUN([%s_EARLY],
 # "Check for header files, types and library functions".
 AC_DEFUN([%s_INIT],
 [\n''' % (configure_ac, macro_prefix)
+
+        # This AC_CONFIG_LIBOBJ_DIR invocation silences an error from the automake
+        # front end:
+        #   error: required file './alloca.c' not found
+        # It is needed because of the last remaining use of AC_LIBSOURCES in
+        # _AC_LIBOBJ_ALLOCA, invoked from AC_FUNC_ALLOCA.
+        # All the m4_pushdef/m4_popdef logic in func_emit_initmacro_start/_end
+        # does not help to avoid this error.
+        newfile_set = {x[1] for x in filetable['new']}
+        if 'lib/alloca.c' in newfile_set:
+            emit += '  AC_CONFIG_LIBOBJ_DIR([%s])\n' % sourcebase
+        elif 'tests=lib/alloca.c' in newfile_set:
+            # alloca.c will be present in $testsbase.
+            emit += '  AC_CONFIG_LIBOBJ_DIR([%s])\n' % testsbase
+
         if libtool:
             emit += '  AM_CONDITIONAL([GL_COND_LIBTOOL], [true])\n'
             emit += '  gl_cond_libtool=true\n'
@@ -702,7 +722,7 @@ AC_DEFUN([%s_INIT],
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
-        emit += '  %s\n' % '\n  '.join(files)
+        emit += '  %s\n' % '\n  '.join(filetable['all'])
         emit += '])\n'
         return emit
 
@@ -1277,7 +1297,7 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix
         # Create m4/gnulib-comp.m4.
         basename = joinpath(m4base, 'gnulib-comp.m4')
         tmpfile = self.assistant.tmpfilename(basename)
-        emit = self.gnulib_comp(filetable['all'], gentests)
+        emit = self.gnulib_comp(filetable, gentests)
         with codecs.open(tmpfile, 'wb', 'UTF-8') as file:
             file.write(emit)
         filename, backup, flag = self.assistant.super_update(basename, tmpfile)