From: Adam Duskett <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/1] qemu: add support for python3
Date: Tue, 4 Sep 2018 14:39:34 -0400 [thread overview]
Message-ID: <20180904183934.12291-1-aduskett@gmail.com> (raw)
qemu 2.12.0 now supports building against python3.
see: https://wiki.qemu.org/ChangeLog/2.12#Build_Dependencies
Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
Changes v1 -> v2:
- Split the python version check into two seperate checks for
readability, one for the target, one for the host.
- Fix location of the python version check for target and host.
package/qemu/qemu.mk | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index afb2aa92f6..6dd9ce4a62 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -16,7 +16,7 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
#-------------------------------------------------------------
# Target-qemu
-QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
+QEMU_DEPENDENCIES = host-pkgconf libglib2 zlib pixman
# Need the LIBS variable because librt and libm are
# not automatically pulled. :-(
@@ -25,9 +25,19 @@ QEMU_LIBS = -lrt -lm
QEMU_OPTS =
QEMU_VARS = \
- LIBTOOL=$(HOST_DIR)/bin/libtool \
- PYTHON=$(HOST_DIR)/bin/python2 \
+ LIBTOOL=$(HOST_DIR)/bin/libtool
+
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+QEMU_DEPENDENCIES += host-python3
+QEMU_VARS += \
+ PYTHON=$(HOST_DIR)/bin/python3 \
+ PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
+else
+QEMU_DEPENDENCIES += host-python
+QEMU_VARS += \
+ PYTHON=$(HOST_DIR)/bin/python \
PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+endif
# If we want to specify only a subset of targets, we must still enable all
# of them, so that QEMU properly builds its list of default targets, from
@@ -150,7 +160,7 @@ $(eval $(generic-package))
#-------------------------------------------------------------
# Host-qemu
-HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
+HOST_QEMU_DEPENDENCIES = host-pkgconf host-zlib host-libglib2 host-pixman
# BR ARCH qemu
# ------- ----
@@ -263,12 +273,19 @@ define HOST_QEMU_CONFIGURE_CMDS
--interp-prefix=$(STAGING_DIR) \
--cc="$(HOSTCC)" \
--host-cc="$(HOSTCC)" \
- --python=$(HOST_DIR)/bin/python2 \
--extra-cflags="$(HOST_CFLAGS)" \
--extra-ldflags="$(HOST_LDFLAGS)" \
$(HOST_QEMU_OPTS)
endef
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+HOST_QEMU_DEPENDENCIES += host-python3
+HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python3
+else
+HOST_QEMU_DEPENDENCIES += host-python
+HOST_QEMU_CONFIGURE_CMDS += --python=$(HOST_DIR)/bin/python2
+endif
+
define HOST_QEMU_BUILD_CMDS
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
endef
--
2.17.1
next reply other threads:[~2018-09-04 18:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-04 18:39 Adam Duskett [this message]
2018-09-04 18:47 ` [Buildroot] [PATCH v2 1/1] qemu: add support for python3 Baruch Siach
2018-09-04 19:09 ` Adam Duskett
2018-09-05 3:59 ` Baruch Siach
2018-09-05 16:43 ` Adam Duskett
2018-09-05 17:47 ` Baruch Siach
2018-09-06 7:50 ` Thomas Petazzoni
2018-09-06 22:58 ` Hollis Blanchard
2018-09-06 19:32 ` Thomas Petazzoni
2018-09-10 18:35 ` Trent Piepho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180904183934.12291-1-aduskett@gmail.com \
--to=aduskett@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox