On Fri, Sep 4, 2020 at 4:38 PM Zack Weinberg wrote:
> OK, after a quick investigation, the failure happens at configure time
> but the problem code belongs to automake. Specifically,
> AM_MISSING_HAS_RUN. I think the tidiest fix is to quote the value of
> $am_aux_dir/missing unconditionally:
>
> diff --git a/m4/missing.m4 b/m4/missing.m4
> index 6f742fb20..56c84fbf5 100644
> --- a/m4/missing.m4
> +++ b/m4/missing.m4
> @@ -21,12 +21,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
> [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
> AC_REQUIRE_AUX_FILE([missing])dnl
> if test x"${MISSING+set}" != xset; then
> - case $am_aux_dir in
> - *\ * | *\*)
> -MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
> - *)
> -MISSING="\${SHELL} $am_aux_dir/missing" ;;
> - esac
> + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
> fi
> # Use eval to expand $SHELL
> if eval "$MISSING --is-lightweight"; then
>
> This doesn't handle the possibility of $am_aux_dir containing
> backslash or double quote characters, but that's ok because
> AM_SANITY_CHECK will already have refused to run configure with either
> the current working directory or the source directory named like that.
> (An alternative patch would be to add ( ) to the set of characters
> rejected by AM_SANITY_CHECK.)
Thanks for investigating and patching.
I think this patch is the right way to go.
Otherwise, I suspect we'd have to make AM_SANITY_CHECK disallow not
only parentheses, but also at least these !?*[]
While looking at this, I wondered... why are the inner quotes double quotes?
I.e., we might as well use single quotes. Slightly cleaner, too, since
no backslash is required for them:
+ MISSING="\${SHELL} '$am_aux_dir/missing'" ;;