* 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.
+2022-01-09 Bruno Haible <bruno@clisp.org>
+
+ 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.
+
2022-01-08 Bruno Haible <bruno@clisp.org>
gnulib-tool: Fix "Don't forget" messages (regression 2021-12-12).
if func_acceptable $module; then
func_append outmodules " $module"
if test "$cond_dependencies" = true; then
- if ! $gnu_make \
- && func_get_automake_snippet_conditional $module \
- | grep '^if ' > /dev/null; then
- # A module whose Makefile.am snippet contains a reference to an
- # automake conditional. If we were to use it conditionally, we
- # would get an error
- # configure: error: conditional "..." was never defined.
- # because automake 1.11.1 does not handle nested conditionals
- # correctly. As a workaround, make the module unconditional.
- func_uncond_add_module $module
- fi
if func_cond_module_p $module; then
conditional=true
else
])
])
+# 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.
*) 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])
-# libgmp.m4 serial 6
+# libgmp.m4 serial 7
# Configure the GMP library or a replacement.
dnl Copyright 2020-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
else
GL_GENERATE_GMP_H=true
fi
- AM_CONDITIONAL([GL_GENERATE_MINI_GMP_H],
+ gl_CONDITIONAL([GL_GENERATE_MINI_GMP_H],
[test $HAVE_LIBGMP != yes])
- AM_CONDITIONAL([GL_GENERATE_GMP_GMP_H],
+ gl_CONDITIONAL([GL_GENERATE_GMP_GMP_H],
[test $HAVE_LIBGMP = yes && test "$ac_cv_header_gmp_h" != yes])
])
]],
[posix_spawn_ported=no],
[posix_spawn_ported=yes])
-AM_CONDITIONAL([POSIX_SPAWN_PORTED], [test $posix_spawn_ported = yes])
+gl_CONDITIONAL([POSIX_SPAWN_PORTED], [test $posix_spawn_ported = yes])
Makefile.am:
TESTS += test-posix_spawn_file_actions_addfchdir
else
gl_cv_cxxheader_cuchar=no
fi
-AM_CONDITIONAL([CXX_HAVE_CUCHAR], [test $gl_cv_cxxheader_cuchar != no])
+gl_CONDITIONAL([CXX_HAVE_CUCHAR], [test $gl_cv_cxxheader_cuchar != no])
Makefile.am:
if ANSICXX