]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: For conditional dependencies, generate portable sh code.
authorPo Lu <luangruo@yahoo.com>
Wed, 26 Apr 2023 02:57:31 +0000 (04:57 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 26 Apr 2023 02:57:31 +0000 (04:57 +0200)
* gnulib-tool (func_emit_autoconf_snippets): Avoid sh syntax
'if ! variable', that does not work with Solaris /bin/sh.
* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Likewise.

ChangeLog
gnulib-tool
pygnulib/GLEmiter.py

index 0884a04d7c5182cfa97ea2c6e6846d19b0e8c2f7..67378ac0aee77c1879a42242c50c0a470c6c5090 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-04-26  Po Lu  <luangruo@yahoo.com>  (tiny change)
+            Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: For conditional dependencies, generate portable sh code.
+       * gnulib-tool (func_emit_autoconf_snippets): Avoid sh syntax
+       'if ! variable', that does not work with Solaris /bin/sh.
+       * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Likewise.
+
 2023-04-25  Bruno Haible  <bruno@clisp.org>
 
        expm1 tests: Avoid test failure on 32-bit mingw.
index 5373333f740c049c3cef7b8d6d1e33387f9921c7..74c395d9a435ad5053c6eb00666894c74e87ed29 100755 (executable)
@@ -4731,7 +4731,7 @@ func_emit_autoconf_snippets ()
           func_module_shellvar_name "$module"
           echo "  $shellfunc ()"
           echo '  {'
-          echo "    if ! \$$shellvar; then"
+          echo "    if \$$shellvar; then :; else"
           func_emit_autoconf_snippet "      "
           echo "      $shellvar=true"
           deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"`
index 93f50b728c9268acfd58e09f5dc0ef38def7bbc3..dc46ba89e9bcb724b4d2928be01d5de41d5cc140 100644 (file)
@@ -283,7 +283,7 @@ class GLEmiter(object):
                         shellvar = module.getShellVar()
                         emit += '  %s ()\n' % shellfunc
                         emit += '  {\n'
-                        emit += '    if ! $%s; then\n' % shellvar
+                        emit += '    if $%s; then :; else\n' % shellvar
                         emit += self.autoconfSnippet(module, toplevel,
                                                      disable_libtool, disable_gettext, replace_auxdir, '      ')
                         emit += '      %s=true\n' % shellvar