Skip to contentSkip to conversation

tools: Fix configure of upstream QEMU

PATCH In review Anthony PERARD 3 participants 3 messages Sep 23, 2020 – Sep 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: Fix configure of upstream QEMU

QEMU as recently switch its build system to use meson and the ./configure step with meson is more restrictive that the step used to be, most installation path wants to be within prefix, otherwise we have this error message:

ERROR: The value of the 'datadir' option is '/usr/share/qemu-xen' which must be a subdir of the prefix '/usr/lib/xen'.

In order to workaround the limitation, we will set prefix to the same one as for the rest of Xen installation, and set all the other paths.

For reference, a thread in qemu-devel:
"configure with datadir outside of --prefix fails with meson"
https://lore.kernel.org/qemu-devel/[email protected]/t/

And an issue in meson:
"artificial limitation of directories (forced to be in prefix)"
https://github.com/mesonbuild/meson/issues/2561

---

I've tested the change with an oldish QEMU, qemu-xen-4.12, and the layout of the tarball generated by osstest doesn't change.

---
 tools/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/Makefile +5 -1
index 198b239edcc1..ff21f1125f66 100644
@@ -238,7 +238,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
 		$$enable_trace_backend \
-		--prefix=$(LIBEXEC) \
+		--prefix=$(prefix) \
 		--libdir=$(LIBEXEC_LIB) \
 		--includedir=$(LIBEXEC_INC) \
 		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
@@ -274,6 +274,10 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--localstatedir=$(localstatedir) \
+		--docdir=$(LIBEXEC)/share/doc \
+		--mandir=$(LIBEXEC)/share/man \
+		--libexecdir=$(LIBEXEC)/libexec \
+		--firmwarepath=$(LIBEXEC)/share/qemu-firmware \
 		--disable-kvm \
 		--disable-docs \
 		--disable-guest-agent \
Signature · 1 line
Anthony PERARD
Tested-by on v1 1/1
#1 lore raw
Quoted 23 lines

-----Original Message-----
From: Anthony PERARD <[email protected]>
Sent: 23 September 2020 12:03
To: [email protected]
Cc: Paul Durrant <[email protected]>; Anthony PERARD <[email protected]>; Ian Jackson <[email protected]>; Wei Liu <[email protected]>
Subject: [XEN PATCH] tools: Fix configure of upstream QEMU

QEMU as recently switch its build system to use meson and the ./configure step with meson is more restrictive that the step used to be, most installation path wants to be within prefix, otherwise we have this error message:

ERROR: The value of the 'datadir' option is '/usr/share/qemu-xen' which must be a subdir of the
prefix '/usr/lib/xen'.

In order to workaround the limitation, we will set prefix to the same one as for the rest of Xen installation, and set all the other paths.

For reference, a thread in qemu-devel:
"configure with datadir outside of --prefix fails with meson"
https://lore.kernel.org/qemu-devel/[email protected]/t/

Quoted 6 lines

And an issue in meson:
"artificial limitation of directories (forced to be in prefix)"
https://github.com/mesonbuild/meson/issues/2561

Acked-by on v1 1/1
#2 lore raw
In reply to Anthony PERARD
Quoted 18 lines · Anthony PERARD

QEMU as recently switch its build system to use meson and the ./configure step with meson is more restrictive that the step used to be, most installation path wants to be within prefix, otherwise we have this error message:

ERROR: The value of the 'datadir' option is '/usr/share/qemu-xen' which must be a subdir of the prefix '/usr/lib/xen'.

In order to workaround the limitation, we will set prefix to the same one as for the rest of Xen installation, and set all the other paths.

For reference, a thread in qemu-devel:
"configure with datadir outside of --prefix fails with meson"
https://lore.kernel.org/qemu-devel/[email protected]/t/

And an issue in meson:
"artificial limitation of directories (forced to be in prefix)"
https://github.com/mesonbuild/meson/issues/2561

Quoted 5 lines

---

I've tested the change with an oldish QEMU, qemu-xen-4.12, and the layout of the tarball generated by osstest doesn't change.