]> 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>
Thu, 27 Apr 2023 16:38:35 +0000 (18:38 +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 834606fdfbcc28e56278faecf235ea7ea9406c21..f28a8952c579d7ae24081bd8feb0c5cfaa9f691c 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 2a971de9eaa03ddfb6984c099dcaded4a0a48328..0955333c4fafa17bd22ac426b0ba97231be18676 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2002-2022 Free Software Foundation, Inc.
+# Copyright (C) 2002-2023 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -4714,7 +4714,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 6d523bda3c5b3942dc744ccca20662c8a110dae7..884c3cb8c65382eaca35c30a21c03ab2973aae44 100644 (file)
@@ -315,7 +315,7 @@ add AM_GNU_GETTEXT([external]) or similar to configure.ac.')
                         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, fileassistant, toplevel,
                                                      disable_libtool, disable_gettext, replace_auxdir, '      ')
                         emit += '      %s=true\n' % shellvar