All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Compatibility make fixes for meson
@ 2020-08-25 20:27 Roman Bolshakov
  2020-08-25 20:27 ` [PATCH v2 1/4] configure: Use discovered make for in-source build Roman Bolshakov
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Roman Bolshakov @ 2020-08-25 20:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Roman Bolshakov, Daniel P. Berrangé, Paolo Bonzini

The set of changes addresses "Diagnose "make is too old" in configure
(or in the makefile?)" from https://wiki.qemu.org/Features/Meson#Easy.
It also provides cleaner backwards compatible build invocation on macOS.

Changes since v1:
 - Added explicit error for partially-completed configure (Eric B.)
 - Added an empty rule for config-host.mak to avoid second call of
   recursive make (which happened because of implicit force rule)

Roman Bolshakov (4):
  configure: Use discovered make for in-source build
  Makefile: Require GNU make 3.82+
  configure: Prefer gmake on darwin
  configure: Test if $make actually exists

 Makefile  |  5 +++++
 configure | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

-- 
2.28.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/4] configure: Use discovered make for in-source build
  2020-08-25 20:27 [PATCH v2 0/4] Compatibility make fixes for meson Roman Bolshakov
@ 2020-08-25 20:27 ` Roman Bolshakov
  2020-08-25 20:27 ` [PATCH v2 2/4] Makefile: Require GNU make 3.82+ Roman Bolshakov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Roman Bolshakov @ 2020-08-25 20:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Roman Bolshakov, Daniel P. Berrangé, Paolo Bonzini

A recursive make is invoked if in-source build is used but $(MAKE) is
the same as the one used in the original make invocation.

Some platforms have preference to use gmake, or a make passed as an
option to "configure". Honor the choice.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 configure | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configure b/configure
index b1e11397a8..07732bf011 100755
--- a/configure
+++ b/configure
@@ -38,6 +38,11 @@ then
 # This file is auto-generated by configure to support in-source tree
 # 'make' command invocation
 
+ifeq ($(wildcard build/config-host.mak),)
+$(error Incomplete configuration. Please run `configure`)
+endif
+include build/config-host.mak
+
 ifeq ($(MAKECMDGOALS),)
 recurse: all
 endif
@@ -54,6 +59,7 @@ endif
 force: ;
 .PHONY: force
 GNUmakefile: ;
+build/config-host.mak: ;
 
 EOF
     cd build
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/4] Makefile: Require GNU make 3.82+
  2020-08-25 20:27 [PATCH v2 0/4] Compatibility make fixes for meson Roman Bolshakov
  2020-08-25 20:27 ` [PATCH v2 1/4] configure: Use discovered make for in-source build Roman Bolshakov
@ 2020-08-25 20:27 ` Roman Bolshakov
  2020-10-12  9:47   ` Thomas Huth
  2020-08-25 20:27 ` [PATCH v2 3/4] configure: Prefer gmake on darwin Roman Bolshakov
  2020-08-25 20:27 ` [PATCH v2 4/4] configure: Test if $make actually exists Roman Bolshakov
  3 siblings, 1 reply; 12+ messages in thread
From: Roman Bolshakov @ 2020-08-25 20:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Roman Bolshakov, Daniel P. Berrangé, Paolo Bonzini

QEMU build fails with cryptic messages if make is too old:

  Makefile.ninja:2655: *** multiple target patterns.  Stop.

To avoid the confusion it's worth to fail the build right away and print
a friendly error message.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index 81794d5c34..b4ebf3e30f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,11 @@ ifneq ($(words $(subst :, ,$(CURDIR))), 1)
   $(error main directory cannot contain spaces nor colons)
 endif
 
+ifeq ($(filter undefine,$(value .FEATURES)),)
+$(error Unsupported Make version: $(MAKE_VERSION). \
+        Please use GNU Make 3.82 or above)
+endif
+
 # Always point to the root of the build tree (needs GNU make).
 BUILD_DIR=$(CURDIR)
 
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/4] configure: Prefer gmake on darwin
  2020-08-25 20:27 [PATCH v2 0/4] Compatibility make fixes for meson Roman Bolshakov
  2020-08-25 20:27 ` [PATCH v2 1/4] configure: Use discovered make for in-source build Roman Bolshakov
  2020-08-25 20:27 ` [PATCH v2 2/4] Makefile: Require GNU make 3.82+ Roman Bolshakov
@ 2020-08-25 20:27 ` Roman Bolshakov
  2020-08-25 20:27 ` [PATCH v2 4/4] configure: Test if $make actually exists Roman Bolshakov
  3 siblings, 0 replies; 12+ messages in thread
From: Roman Bolshakov @ 2020-08-25 20:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Roman Bolshakov, Daniel P. Berrangé, Paolo Bonzini

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.bolshakov@yadro.com>
---
 configure | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/configure b/configure
index 07732bf011..664084992b 100755
--- a/configure
+++ b/configure
@@ -907,6 +907,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"
@@ -920,6 +921,31 @@ 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)
+
+ifeq ($(wildcard config-host.mak),)
+$(error Incomplete configuration. Please run `configure`)
+endif
+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: ;
+config-host.mak: ;
+
+EOF
 ;;
 SunOS)
   solaris="yes"
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 4/4] configure: Test if $make actually exists
  2020-08-25 20:27 [PATCH v2 0/4] Compatibility make fixes for meson Roman Bolshakov
                   ` (2 preceding siblings ...)
  2020-08-25 20:27 ` [PATCH v2 3/4] configure: Prefer gmake on darwin Roman Bolshakov
@ 2020-08-25 20:27 ` Roman Bolshakov
  2020-10-12  9:49   ` Thomas Huth
  3 siblings, 1 reply; 12+ messages in thread
From: Roman Bolshakov @ 2020-08-25 20:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Roman Bolshakov, Daniel P. Berrangé, Paolo Bonzini

configure doesn't detect if $make is installed on the build host.
This is also helpful for hosts where an alias for make is used, i.e.
configure would fail if gmake is not present on macOS.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 configure | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure b/configure
index 664084992b..9230832da2 100755
--- a/configure
+++ b/configure
@@ -2029,6 +2029,10 @@ if test -z "$python"
 then
     error_exit "Python not found. Use --python=/path/to/python"
 fi
+if ! has "$make"
+then
+    error_exit "GNU make ($make) not found"
+fi
 
 # Note that if the Python conditional here evaluates True we will exit
 # with status 1 which is a shell 'false' value.
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
  2020-08-25 20:27 ` [PATCH v2 2/4] Makefile: Require GNU make 3.82+ Roman Bolshakov
@ 2020-10-12  9:47   ` Thomas Huth
  2020-12-13 17:21     ` Laurent Vivier
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Huth @ 2020-10-12  9:47 UTC (permalink / raw)
  To: Roman Bolshakov, qemu-devel
  Cc: QEMU Trivial, Paolo Bonzini, Daniel P. Berrangé

On 25/08/2020 22.27, Roman Bolshakov wrote:
> QEMU build fails with cryptic messages if make is too old:
> 
>   Makefile.ninja:2655: *** multiple target patterns.  Stop.
> 
> To avoid the confusion it's worth to fail the build right away and print
> a friendly error message.
> 
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  Makefile | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 81794d5c34..b4ebf3e30f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -4,6 +4,11 @@ ifneq ($(words $(subst :, ,$(CURDIR))), 1)
>    $(error main directory cannot contain spaces nor colons)
>  endif
>  
> +ifeq ($(filter undefine,$(value .FEATURES)),)
> +$(error Unsupported Make version: $(MAKE_VERSION). \
> +        Please use GNU Make 3.82 or above)
> +endif
> +
>  # Always point to the root of the build tree (needs GNU make).
>  BUILD_DIR=$(CURDIR)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/4] configure: Test if $make actually exists
  2020-08-25 20:27 ` [PATCH v2 4/4] configure: Test if $make actually exists Roman Bolshakov
@ 2020-10-12  9:49   ` Thomas Huth
  2020-12-13 17:22     ` Laurent Vivier
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Huth @ 2020-10-12  9:49 UTC (permalink / raw)
  To: Roman Bolshakov, qemu-devel
  Cc: QEMU Trivial, Paolo Bonzini, Daniel P. Berrangé

On 25/08/2020 22.27, Roman Bolshakov wrote:
> configure doesn't detect if $make is installed on the build host.
> This is also helpful for hosts where an alias for make is used, i.e.
> configure would fail if gmake is not present on macOS.
> 
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  configure | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/configure b/configure
> index 664084992b..9230832da2 100755
> --- a/configure
> +++ b/configure
> @@ -2029,6 +2029,10 @@ if test -z "$python"
>  then
>      error_exit "Python not found. Use --python=/path/to/python"
>  fi
> +if ! has "$make"
> +then
> +    error_exit "GNU make ($make) not found"
> +fi
>  
>  # Note that if the Python conditional here evaluates True we will exit
>  # with status 1 which is a shell 'false' value.
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
  2020-10-12  9:47   ` Thomas Huth
@ 2020-12-13 17:21     ` Laurent Vivier
  2020-12-13 19:04       ` Peter Maydell
  0 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2020-12-13 17:21 UTC (permalink / raw)
  To: Thomas Huth, Roman Bolshakov, qemu-devel
  Cc: QEMU Trivial, Paolo Bonzini, Daniel P. Berrangé

Le 12/10/2020 à 11:47, Thomas Huth a écrit :
> On 25/08/2020 22.27, Roman Bolshakov wrote:
>> QEMU build fails with cryptic messages if make is too old:
>>
>>   Makefile.ninja:2655: *** multiple target patterns.  Stop.
>>
>> To avoid the confusion it's worth to fail the build right away and print
>> a friendly error message.
>>
>> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
>> ---
>>  Makefile | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index 81794d5c34..b4ebf3e30f 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -4,6 +4,11 @@ ifneq ($(words $(subst :, ,$(CURDIR))), 1)
>>    $(error main directory cannot contain spaces nor colons)
>>  endif
>>  
>> +ifeq ($(filter undefine,$(value .FEATURES)),)
>> +$(error Unsupported Make version: $(MAKE_VERSION). \
>> +        Please use GNU Make 3.82 or above)
>> +endif
>> +
>>  # Always point to the root of the build tree (needs GNU make).
>>  BUILD_DIR=$(CURDIR)
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/4] configure: Test if $make actually exists
  2020-10-12  9:49   ` Thomas Huth
@ 2020-12-13 17:22     ` Laurent Vivier
  0 siblings, 0 replies; 12+ messages in thread
From: Laurent Vivier @ 2020-12-13 17:22 UTC (permalink / raw)
  To: Thomas Huth, Roman Bolshakov, qemu-devel
  Cc: QEMU Trivial, Paolo Bonzini, Daniel P. Berrangé

Le 12/10/2020 à 11:49, Thomas Huth a écrit :
> On 25/08/2020 22.27, Roman Bolshakov wrote:
>> configure doesn't detect if $make is installed on the build host.
>> This is also helpful for hosts where an alias for make is used, i.e.
>> configure would fail if gmake is not present on macOS.
>>
>> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
>> ---
>>  configure | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/configure b/configure
>> index 664084992b..9230832da2 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2029,6 +2029,10 @@ if test -z "$python"
>>  then
>>      error_exit "Python not found. Use --python=/path/to/python"
>>  fi
>> +if ! has "$make"
>> +then
>> +    error_exit "GNU make ($make) not found"
>> +fi
>>  
>>  # Note that if the Python conditional here evaluates True we will exit
>>  # with status 1 which is a shell 'false' value.
>>
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
  2020-12-13 17:21     ` Laurent Vivier
@ 2020-12-13 19:04       ` Peter Maydell
  2020-12-13 22:56         ` Laurent Vivier
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2020-12-13 19:04 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Thomas Huth, Daniel P. Berrangé,
	QEMU Trivial, QEMU Developers, Roman Bolshakov, Paolo Bonzini

On Sun, 13 Dec 2020 at 17:22, Laurent Vivier <laurent@vivier.eu> wrote:
>
> Le 12/10/2020 à 11:47, Thomas Huth a écrit :
> > On 25/08/2020 22.27, Roman Bolshakov wrote:
> >> QEMU build fails with cryptic messages if make is too old:
> >>
> >>   Makefile.ninja:2655: *** multiple target patterns.  Stop.
> >>
> >> To avoid the confusion it's worth to fail the build right away and print
> >> a friendly error message.
> >>
> >> +ifeq ($(filter undefine,$(value .FEATURES)),)
> >> +$(error Unsupported Make version: $(MAKE_VERSION). \
> >> +        Please use GNU Make 3.82 or above)
> >> +endif
> >> +
> >>  # Always point to the root of the build tree (needs GNU make).
> >>  BUILD_DIR=$(CURDIR)
> >
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> >
> >
>
> Applied to my trivial-patches branch.

Commit 09e93326e448ab4 says that the switch to ninja from
ninjatool removed the requirement for Make 3.82. Is this
change still required?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
  2020-12-13 19:04       ` Peter Maydell
@ 2020-12-13 22:56         ` Laurent Vivier
  2020-12-14 13:46           ` Roman Bolshakov
  0 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2020-12-13 22:56 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Thomas Huth, Daniel P. Berrangé,
	QEMU Trivial, QEMU Developers, Roman Bolshakov, Paolo Bonzini

Le 13/12/2020 à 20:04, Peter Maydell a écrit :
> On Sun, 13 Dec 2020 at 17:22, Laurent Vivier <laurent@vivier.eu> wrote:
>>
>> Le 12/10/2020 à 11:47, Thomas Huth a écrit :
>>> On 25/08/2020 22.27, Roman Bolshakov wrote:
>>>> QEMU build fails with cryptic messages if make is too old:
>>>>
>>>>   Makefile.ninja:2655: *** multiple target patterns.  Stop.
>>>>
>>>> To avoid the confusion it's worth to fail the build right away and print
>>>> a friendly error message.
>>>>
>>>> +ifeq ($(filter undefine,$(value .FEATURES)),)
>>>> +$(error Unsupported Make version: $(MAKE_VERSION). \
>>>> +        Please use GNU Make 3.82 or above)
>>>> +endif
>>>> +
>>>>  # Always point to the root of the build tree (needs GNU make).
>>>>  BUILD_DIR=$(CURDIR)
>>>
>>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>>
>>>
>>
>> Applied to my trivial-patches branch.
> 
> Commit 09e93326e448ab4 says that the switch to ninja from
> ninjatool removed the requirement for Make 3.82. Is this
> change still required?
>

It seems 09e93326e448ab4 has been committed on 17th of October, so after Thomas' review.
I remove it from my queue.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
  2020-12-13 22:56         ` Laurent Vivier
@ 2020-12-14 13:46           ` Roman Bolshakov
  0 siblings, 0 replies; 12+ messages in thread
From: Roman Bolshakov @ 2020-12-14 13:46 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Peter Maydell, Thomas Huth, Daniel P. Berrangé,
	QEMU Trivial, QEMU Developers, Paolo Bonzini

On Sun, Dec 13, 2020 at 11:56:22PM +0100, Laurent Vivier wrote:
> Le 13/12/2020 à 20:04, Peter Maydell a écrit :
> > On Sun, 13 Dec 2020 at 17:22, Laurent Vivier <laurent@vivier.eu> wrote:
> >>
> >> Le 12/10/2020 à 11:47, Thomas Huth a écrit :
> >>> On 25/08/2020 22.27, Roman Bolshakov wrote:
> >>>> QEMU build fails with cryptic messages if make is too old:
> >>>>
> >>>>   Makefile.ninja:2655: *** multiple target patterns.  Stop.
> >>>>
> >>>> To avoid the confusion it's worth to fail the build right away and print
> >>>> a friendly error message.
> >>>>
> >>>> +ifeq ($(filter undefine,$(value .FEATURES)),)
> >>>> +$(error Unsupported Make version: $(MAKE_VERSION). \
> >>>> +        Please use GNU Make 3.82 or above)
> >>>> +endif
> >>>> +
> >>>>  # Always point to the root of the build tree (needs GNU make).
> >>>>  BUILD_DIR=$(CURDIR)
> >>>
> >>> Reviewed-by: Thomas Huth <thuth@redhat.com>
> >>>
> >>>
> >>
> >> Applied to my trivial-patches branch.
> > 
> > Commit 09e93326e448ab4 says that the switch to ninja from
> > ninjatool removed the requirement for Make 3.82. Is this
> > change still required?
> >
> 
> It seems 09e93326e448ab4 has been committed on 17th of October, so after Thomas' review.
> I remove it from my queue.
> 

I can confirm:

./configure --target-list=x86_64-softmmu --enable-trace-backends=dtrace && make -j$(nproc)

Works fine on macOS with the latest qemu HEAD. The patch can be
discarded.

Regards,
Roman


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-12-14 13:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 20:27 [PATCH v2 0/4] Compatibility make fixes for meson Roman Bolshakov
2020-08-25 20:27 ` [PATCH v2 1/4] configure: Use discovered make for in-source build Roman Bolshakov
2020-08-25 20:27 ` [PATCH v2 2/4] Makefile: Require GNU make 3.82+ Roman Bolshakov
2020-10-12  9:47   ` Thomas Huth
2020-12-13 17:21     ` Laurent Vivier
2020-12-13 19:04       ` Peter Maydell
2020-12-13 22:56         ` Laurent Vivier
2020-12-14 13:46           ` Roman Bolshakov
2020-08-25 20:27 ` [PATCH v2 3/4] configure: Prefer gmake on darwin Roman Bolshakov
2020-08-25 20:27 ` [PATCH v2 4/4] configure: Test if $make actually exists Roman Bolshakov
2020-10-12  9:49   ` Thomas Huth
2020-12-13 17:22     ` Laurent Vivier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.