Subject: bug#13349: Re-execute with the "correct" make implementation

From: Stefano Lattarini <[email-masked]>
Date: Fri, 04 Jan 2013 00:54:23 +0100

On 01/04/2013 12:31 AM, Eric Blake wrote:
> On 01/03/2013 03:05 PM, Stefano Lattarini wrote:
>>>>>
>>>> Yeah, probably AM_INIT_AUTOMAKE should enhance the configure help message
>>>> to report the "quirky" role of $MAKE (patches welcome).
>>>
>>> I'll think about an automake patch to make it precious (at this point,
>>> I'm thinking that the use of MAKE is too closely tied to automake, and
>>> that autoconf itself has no business in setting MAKE as precious, only
>>> documenting in the generic INSTALL that MAKE is often important because
>>> of automake).
>>>
>> Yes, this seems the best approach.
> 
> Then again, it is autoconf that defines AC_PROG_MAKE_SET which in turn
> provides @SET_MAKE@ for substitution in Makefiles;
>
Right, I had forgotten about that.  I somehow just took it for granted
that it was all Automake's doing ...

So, it would again be Autoconf that should implement the probe we had
talked about, if we decide to go down that road ...

> so maybe autoconf should be the one that lets $(MAKE) be precious
> after all.  Does this (relatively untested) patch look like the
> right thing to do?
>
Almost, but with a nit below.

> diff --git i/doc/autoconf.texi w/doc/autoconf.texi
> index bb83443..67a862d 100644
> --- i/doc/autoconf.texi
> +++ w/doc/autoconf.texi
> @@ -2208,7 +2208,7 @@ Output
>  @code{$(MAKE)}, define output variable @code{SET_MAKE} to be empty.
>  Otherwise, define @code{SET_MAKE} to a macro definition that sets
>  @code{$(MAKE)}, such as @samp{MAKE=make}.  Calls @code{AC_SUBST} for
> -@code{SET_MAKE}.
> +@code{SET_MAKE}, and also calls @code{AC_ARG_VAR} for @code{MAKE}.
>  @end defmac
> 
>  If you use this macro, place a line like this in each @file{Makefile.in}
> diff --git i/lib/autoconf/programs.m4 w/lib/autoconf/programs.m4
> index f7af8b5..b6a8f78 100644
> --- i/lib/autoconf/programs.m4
> +++ w/lib/autoconf/programs.m4
> @@ -813,10 +813,12 @@ fi
>  # does not run the test Makefile, we assume that the Make program the
> user will
>  # invoke does set $(MAKE).  This is typical, and emitting `MAKE=foomake' is
>  # always wrong if `foomake' is not available or does not work.
> +# Calling this macro also marks $MAKE as a precious variable.
>  AN_MAKEVAR([MAKE], [AC_PROG_MAKE_SET])
>  AN_PROGRAM([make], [AC_PROG_MAKE_SET])
>  AC_DEFUN([AC_PROG_MAKE_SET],
> -[AC_MSG_CHECKING([whether ${MAKE-make} sets \$(MAKE)])
> +[AC_ARG_VAR([MAKE], [which program will run Makefiles (default make)])
>
It's more of a "which program you intend to use to run Makefiles", no?

Regards,
  Stefano