Compatibility make fixes for meson
v2 cover Compatibility make fixes for meson
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(+)
Signature · 1 line
2.28.0
PATCH v2 1/4 configure: Use discovered make for in-source build
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.
--- configure | 6 ++++++ 1 file changed, 6 insertions(+)
configure +6 -0
@@ -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
Signature · 1 line
2.28.0
PATCH v2 2/4 Makefile: Require GNU make 3.82+
In reply to Roman BolshakovQEMU 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.
--- Makefile | 5 +++++ 1 file changed, 5 insertions(+)
Makefile +5 -0
@@ -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)
Signature · 1 line
2.28.0
Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
Quoted 18 lines · Roman Bolshakov
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é <[email protected]>Signed-off-by Roman Bolshakov <[email protected]>--- Makefile | 5 +++++ 1 file changed, 5 insertions(+)Makefile +0
-0
Makefile ifneq ($(words $(subst :, ,$(CURDIR))), 1) · line 13
Quoted 10 lines
Makefile +5
-0@@ -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)
Laurent Vivier
AppliedRe: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
Le 12/10/2020 à 11:47, Thomas Huth a écrit :
Quoted 22 lines · Roman Bolshakov
Quoted 21 lines
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é <[email protected]>Signed-off-by Roman Bolshakov <[email protected]>--- Makefile | 5 +++++ 1 file changed, 5 insertions(+)Makefile +0
-0@@ -4,6 +4,11 @@ ifneq ($(words $(subst :, ,$(CURDIR))), 1) $(error main directory cannot contain spaces nor colons) endif
Quoted 11 lines
Makefile ifneq ($(words $(subst :, ,$(CURDIR))), 1) · line 13
Quoted 7 lines
Makefile +5
-0+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 <[email protected]>
Applied to my trivial-patches branch.
Thanks,
Laurent
Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
Quoted 22 lines · Laurent Vivier
Quoted 8 lines · Thomas Huth
Quoted 7 lines · Roman Bolshakov
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.
Quoted 11 lines
Makefile ifneq ($(words $(subst :, ,$(CURDIR))), 1) · line 13
Quoted 7 lines
Makefile +5
-0+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 <[email protected]>
Quoted 1 line
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
Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
Le 13/12/2020 à 20:04, Peter Maydell a écrit :
Quoted 23 lines · Laurent Vivier
Quoted 22 lines · Thomas Huth
Quoted 19 lines · Roman Bolshakov
Quoted 7 lines
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.
Makefile ifneq ($(words $(subst :, ,$(CURDIR))), 1) · line 13
Quoted 7 lines
Makefile +5
-0+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 <[email protected]>
Quoted 6 lines
Quoted 1 line
Applied to my trivial-patches branch.
Commit
09e93326e448ab4says 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
Re: [PATCH v2 2/4] Makefile: Require GNU make 3.82+
Quoted 26 lines · Laurent Vivier
Le 13/12/2020 à 20:04, Peter Maydell a écrit :
Quoted 25 lines · Laurent Vivier
Quoted 23 lines · Thomas Huth
Quoted 8 lines · Roman Bolshakov
Quoted 7 lines
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.
Quoted 11 lines
Makefile ifneq ($(words $(subst :, ,$(CURDIR))), 1) · line 13
Quoted 7 lines
Makefile +5
-0+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 <[email protected]>Applied to my trivial-patches branch.
Quoted 8 lines
Quoted 4 lines
Commit
09e93326e448ab4says that the switch to ninja from ninjatool removed the requirement for Make 3.82. Is this change still required?It seems
09e93326e448ab4has 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
PATCH v2 3/4 configure: Prefer gmake on darwin
In reply to Roman BolshakovNew 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.
--- configure | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
configure +26 -0
@@ -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"
Signature · 1 line
2.28.0
PATCH v2 4/4 configure: Test if $make actually exists
In reply to Roman Bolshakovconfigure 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.
--- configure | 4 ++++ 1 file changed, 4 insertions(+)
configure +4 -0
@@ -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.
Signature · 1 line
2.28.0
Re: [PATCH v2 4/4] configure: Test if $make actually exists
Quoted 16 lines · Roman Bolshakov
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é <[email protected]>Signed-off-by Roman Bolshakov <[email protected]>--- configure | 4 ++++ 1 file changed, 4 insertions(+)configure +0
-0
configure if test -z "$python" · line 2038
Quoted 10 lines
configure +4
-0@@ -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.
Laurent Vivier
AppliedRe: [PATCH v2 4/4] configure: Test if $make actually exists
Le 12/10/2020 à 11:49, Thomas Huth a écrit :
Quoted 24 lines · Roman Bolshakov
Quoted 23 lines
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é <[email protected]>Signed-off-by Roman Bolshakov <[email protected]>--- configure | 4 ++++ 1 file changed, 4 insertions(+)configure +4
-0@@ -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
Quoted 7 lines
configure if test -z "$python" · line 2038
Quoted 3 lines
configure +0
-0# 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 <[email protected]>
Applied to my trivial-patches branch.
Thanks,
Laurent