From 98e7ca354a1108b0b99236e29bedbc6bfbd8593e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 9 Aug 2022 16:11:09 +0200 Subject: gnulib-tool.py: Fix some code generation details. * pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): When removing a lib_LDFLAGS line, remove also the newline. Fix regex that matches lib_SOMETHING. Add a newline after each '## begin gnulib module' line. Don't emit 'endif' lines without corresponding 'if'. When emitting a '+=' augmentation, make sure it does not get emitted a second time. Don't emit a blank line when there is no AM_CPPFLAGS augmentation. Update after getLink() changed. In the value of DEFAULT_TEXT_DOMAIN, backslash-escape the double-quotes. Don't produce Windows CR-LFs on Windows. Simplify. (GLEmiter.tests_Makefile_am): When removing a lib_LDFLAGS line, remove also the newline. Fix regex that matches lib_SOMETHING. Don't remove a blank line before EXTRA_DIST. Add a newline after each '## begin gnulib module' line. Set uses_subdirs also when there is a .c file in a subdir of tests/. When emitting a '+=' augmentation, make sure it does not get emitted a second time. Don't produce Windows CR-LFs on Windows. Simplify. * pygnulib/GLImport.py (GLImport.execute): Update after getLink() changed. --- pygnulib/GLImport.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pygnulib/GLImport.py') diff --git a/pygnulib/GLImport.py b/pygnulib/GLImport.py index 87d85c5181..0197e0671d 100644 --- a/pygnulib/GLImport.py +++ b/pygnulib/GLImport.py @@ -1398,18 +1398,18 @@ AC_DEFUN([%s_FILE_LIST], [\n''' % macro_prefix # Get link directives. links = [ module.getLink() for module in self.moduletable['main'] ] - ulinks = list() - for link in links: - for lib in link: - ulinks += [lib] - ulinks = sorted(set(ulinks)) - if ulinks: + lines = [ line + for link in links + for line in link.split('\n') + if line != '' ] + lines = sorted(set(lines)) + if lines: print(''' You may need to use the following Makefile variables when linking. Use them in _LDADD when linking a program, or in _a_LDFLAGS or _la_LDFLAGS when linking a library.''') - for link in ulinks: - print(' %s' % link) + for line in lines: + print(' %s' % line) # Print reminders. print('') -- cgit v1.2.1