On Sun, Aug 23, 2020 at 12:21:28AM +0300, Roman Bolshakov wrote:
> New meson/make build requires GNU make 3.82+ but macOS ships 3.81 even
> on Big Sur while homebrew provides GNU make 4.3 as 'gmake' in $PATH.
> 
> With the change, 'make' switches over to gmake implicitly.
> 
> Signed-off-by: Roman Bolshakov <r.bolsha...@yadro.com>
> ---
>  configure | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/configure b/configure
> index 9e0d505067..90b02b7271 100755
> --- a/configure
> +++ b/configure
> @@ -903,6 +903,7 @@ Darwin)
>    darwin="yes"
>    hax="yes"
>    hvf="yes"
> +  make="${MAKE-gmake}"
>    LDFLAGS_SHARED="-bundle -undefined dynamic_lookup"
>    if [ "$cpu" = "x86_64" ] ; then
>      QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
> @@ -916,6 +917,27 @@ Darwin)
>    # won't work when we're compiling with gcc as a C compiler.
>    QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
>    HOST_VARIANT_DIR="darwin"
> +  cat > GNUmakefile <<'EOF'
> +# This file is auto-generated by configure to implicitly switch from a 'make'
> +# invocation to 'gmake'
> +
> +OLD_MAKE := $(MAKE)
> +
> +include config-host.mak
> +
> +ifeq ($(MAKECMDGOALS),)
> +recurse: all
> +endif
> +
> +.NOTPARALLEL: %
> +%: force
> +     @echo 'Switch from $(OLD_MAKE) to $(MAKE)'
> +     @$(MAKE) -f Makefile $(MAKECMDGOALS)
> +force: ;
> +.PHONY: force
> +GNUmakefile: ;
> +
> +EOF


I was wondering why you duplicated the GNUmakefile I created earlier, then
I realized this one is created in the build dir, whereas the other was
created in the source dir. I would note this works for macOS which has a
GNU make, but doesn't work for FreeBSD has non-GNU make by default.

I kind of feel like the previous patch which raises an error is good
enough. User can just put the homebrew  newer GNU make first in their
$PATH, which is sensible regardless IMHO.

None the less, this patch does what it claims so

Reviewed-by: Daniel P. Berrangé <berra...@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to