bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_CHECK_HEADER/AC_CHECK_DECL 2.69->2.69c probably changed quoting,


From: Zack Weinberg
Subject: Re: AC_CHECK_HEADER/AC_CHECK_DECL 2.69->2.69c probably changed quoting, breaks gimp as "...: ${+y}: bad substitution"
Date: Sun, 25 Oct 2020 09:54:42 -0400

On Sun, Oct 25, 2020 at 9:13 AM Sergei Trofimovich <slyfox@gentoo.org> wrote:
...
> gimp's use of macros looks underquoted

Yes, this is an underquotation problem, and also a "macros that use
AC_REQUIRE internally are not safe to use inside hand-coded shell
conditionals" problem.  This particular example is so badly broken
that I'm amazed it worked at all with 2.69.

The AC_ARG_WITH part is fine (although it could be improved by using
AS_HELP_STRING) but the actual check should be done like this:

have_linux_input="no (linux input support disabled)"
AS_IF([test "x$with_linux_input" != "xno"],
  [AC_CHECK_HEADER([linux/input.h],
    [AC_CHECK_DECL([KEY_OK],
                   [have_linux_input=yes],
                   [have_linux_input="no (needs Linux 2.6)"],
                   [#include <linux/input.h>])])])

This kind of correction is, regrettably, beyond the power of autoupdate.

> but I would expect
> behavior to be roughly the same between 2.69 and 2.69c.

Unfortunately no.  There have been major changes since 2.69 in the way
AC_CHECK_HEADER and AC_CHECK_DECL work, and this breakage appears to
have been a consequence.  Looking at the diffs between the generated
configure scripts, the underquoted version has shell function
definitions intertwined with top-level control flow, because
AC_CHECK_DECL was expanded first and then treated as *multiple
arguments* to AC_CHECK_HEADER.  Plus, code that needs to be executed
unconditionally was emitted inside the "if" block.

zw



reply via email to

[Prev in Thread] Current Thread [Next in Thread]