From 3ef794d11bcbea3b8ae57767772a3255b669b8ce Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 26 Apr 2023 04:57:31 +0200 Subject: 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. --- ChangeLog | 8 ++++++++ gnulib-tool | 2 +- pygnulib/GLEmiter.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0884a04d7c..67378ac0ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-04-26 Po Lu (tiny change) + Bruno Haible + + 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 expm1 tests: Avoid test failure on 32-bit mingw. diff --git a/gnulib-tool b/gnulib-tool index 5373333f74..74c395d9a4 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -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"` diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 93f50b728c..dc46ba89e9 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -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 -- cgit v1.2.1