diff options
author | Bruno Haible <bruno@clisp.org> | 2022-01-09 15:38:51 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2022-01-09 15:38:51 +0100 |
commit | 4bf9c96497946ce6f7b84f6527ed0291657cf728 (patch) | |
tree | e77ed554559028af398d39ea68811516ff8ad2fe /m4/gnulib-common.m4 | |
parent | 1cc82c4280bb76f677f3604bdef7116922d77511 (diff) | |
download | gnulib-4bf9c96497946ce6f7b84f6527ed0291657cf728.tar.gz |
Remove influence of Automake conditionals on conditional dependencies.
* m4/gnulib-common.m4 (gl_CONDITIONAL): New macro.
(gl_CONDITIONAL_HEADER): Use it instead of AM_CONDITIONAL.
* m4/libgmp.m4 (gl_LIBGMP): Likewise.
* modules/posix_spawn_file_actions_addfchdir-tests (configure.ac):
Likewise.
* modules/uchar-c++-tests (configure.ac): Likewise.
* gnulib-tool (func_modules_transitive_closure): Don't inhibit
conditional dependencies processing on a module that uses an Automake
conditional.
Diffstat (limited to 'm4/gnulib-common.m4')
-rw-r--r-- | m4/gnulib-common.m4 | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index afe0836083..bd7318aead 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -813,6 +813,24 @@ AC_DEFUN([gl_CACHE_VAL_SILENT], ]) ]) +# gl_CONDITIONAL(conditional, condition) +# is like AM_CONDITIONAL(conditional, condition), except that it does not +# produce an error +# configure: error: conditional "..." was never defined. +# Usually this means the macro was only invoked conditionally. +# when only invoked conditionally. Instead, in that case, both the _TRUE +# and the _FALSE case are disabled. +AC_DEFUN([gl_CONDITIONAL], +[ + pushdef([AC_CONFIG_COMMANDS_PRE], [:])dnl + AM_CONDITIONAL([$1], [$2]) + popdef([AC_CONFIG_COMMANDS_PRE])dnl + if test -z "${[$1]_TRUE}" && test -z "${[$1]_FALSE}"; then + [$1]_TRUE='#' + [$1]_FALSE='#' + fi +]) + # gl_CC_ALLOW_WARNINGS # sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option # that reverts a preceding '-Werror' option, if available. @@ -969,7 +987,7 @@ AC_DEFUN([gl_CONDITIONAL_HEADER], *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;; esac AC_SUBST(gl_header_name) - AM_CONDITIONAL(gl_generate_cond, [$gl_generate_var]) + gl_CONDITIONAL(gl_generate_cond, [$gl_generate_var]) m4_popdef([gl_generate_cond]) m4_popdef([gl_generate_var]) m4_popdef([gl_header_name]) |