]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Fix libgnu_la_LDFLAGS section in generated Makefile.am.
authorTim Rühsen <tim.ruehsen@gmx.de>
Sat, 30 Nov 2019 12:04:28 +0000 (13:04 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 30 Nov 2019 12:04:28 +0000 (13:04 +0100)
Reported by Dagobert Michelsen <dam@opencsw.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00086.html>.

* pygnulib/GLModuleSystem.py (getLink): Don't join the parts. Return a
list of strings instead of one string.
* pygnulib/GLEmiter.py (lib_Makefile_am): Adapt accordingly.
* pygnulib/GLImport.py (execute): Likewise.

ChangeLog
pygnulib/GLEmiter.py
pygnulib/GLImport.py
pygnulib/GLModuleSystem.py

index c0940d63fd80c010891a47dceeb40b4ba860545b..276cefc19a4b58c73d1714f4bff64dd848d6a4ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2019-11-29  Tim Rühsen  <tim.ruehsen@gmx.de>
+
+       gnulib-tool.py: Fix libgnu_la_LDFLAGS section in generated Makefile.am.
+       Reported by Dagobert Michelsen <dam@opencsw.org> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00086.html>.
+       * pygnulib/GLModuleSystem.py (getLink): Don't join the parts. Return a
+       list of strings instead of one string.
+       * pygnulib/GLEmiter.py (lib_Makefile_am): Adapt accordingly.
+       * pygnulib/GLImport.py (execute): Likewise.
+
 2019-11-27  Bruno Haible  <bruno@clisp.org>
 
        openpty, forkpty: Fix build error on Solaris 11.4.
index a350ba7531e82b01ec8ddb5b0a85b70e1170270f..f0746f8278015f634a715975588cb012519ddd96 100644 (file)
@@ -853,17 +853,18 @@ AC_DEFUN([%V1%_LIBSOURCES], [
             emit += '%s_%s_LDFLAGS += -no-undefined\n' % (libname, libext)
             # Synthesize an ${libname}_${libext}_LDFLAGS augmentation by combining
             # the link dependencies of all modules.
-            listing = list()
             links = [module.getLink()
                      for module in modules if not module.isTests()]
+            ulinks = list()
             for link in links:
-                link = constants.nlremove(link)
-                position = link.find(' when linking with libtool')
-                if position != -1:
-                    link = link[:position]
-                listing += [link]
-            listing = sorted(set([link for link in listing if link != '']))
-            for link in listing:
+                for lib in link:
+                    lib = constants.nlremove(lib)
+                    position = lib.find(' when linking with libtool')
+                    if position != -1:
+                        lib = lib[:position]
+                    ulinks += [lib]
+            ulinks = sorted(set(ulinks))
+            for link in ulinks:
                 emit += '%s_%s_LDFLAGS += %s\n' % (libname, libext, link)
         emit += '\n'
         if pobase:
index 19ade5e8d1bddd677acc6e4137bbe38867c99790..27a01be432636e60984b6631c9f1db98cd711f2d 100644 (file)
@@ -1374,13 +1374,17 @@ for the following .h files.')
 
         # Get link directives.
         links = [module.getLink() for module in self.moduletable['main']]
-        links = sorted(set([link for link in links if link.strip()]))
-        if links:
+        ulinks = list()
+        for link in links:
+            for lib in link:
+                ulinks += [lib]
+        ulinks = sorted(set(ulinks))
+        if ulinks:
             print('''
 You may need to use the following Makefile variables when linking.
 Use them in <program>_LDADD when linking a program, or
 in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a library.''')
-            for link in links:
+            for link in ulinks:
                 print('  %s' % link)
 
         # Print reminders.
index f2f9df4ac96edf658287dd28b62ac63373b887fe..9560bc2731cdea2b37c106682b1a642cdb958327 100644 (file)
@@ -791,13 +791,11 @@ Include:|Link:|License:|Maintainer:)'
         Return link directive.'''
         section = 'Link:'
         if 'link' not in self.cache:
-            if section not in self.content:
-                result = string()
-            else:  # if section in self.content
+            parts = list()
+            if section in self.content:
                 snippet = self.content.split(section)[-1]
                 snippet = snippet.replace('\r\n', '\n')
                 lines = ['%s\n' % line for line in snippet.split('\n')]
-                parts = list()
                 for line in lines:
                     regex = '^(Description|Comment|Status|Notice|Applicability|'
                     regex += 'Files|Depends-on|configure\\.ac-early|configure\\.ac|'
@@ -808,8 +806,8 @@ Include:|Link:|License:|Maintainer:)'
                         break
                     parts += [line]
                 parts = [part.strip() for part in parts if part.strip()]
-                result = ''.join(parts)
-            self.cache['link'] = result
+                # result = ' '.join(parts)
+            self.cache['link'] = parts
         return(self.cache['link'])
 
     def getLicense(self):