blob: f7b41412ad0c547e592028be2321792e66f5d67e [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Fast open source processor emulator"
2HOMEPAGE = "http://qemu.org"
3LICENSE = "GPLv2 & LGPLv2.1"
Brad Bishop19323692019-04-05 15:28:33 -04004
5RDEPENDS_${PN}-ptest = "bash make"
6
7LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
Brad Bishopc342db32019-05-15 21:57:59 -04008 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
Brad Bishop19323692019-04-05 15:28:33 -04009
10SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
11 file://powerpc_rom.bin \
Brad Bishop19323692019-04-05 15:28:33 -040012 file://run-ptest \
Brad Bishopc342db32019-05-15 21:57:59 -040013 file://0001-qemu-Add-missing-wacom-HID-descriptor.patch \
14 file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \
15 file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \
16 file://0004-qemu-disable-Valgrind.patch \
17 file://0005-qemu-Limit-paths-searched-during-user-mode-emulation.patch \
18 file://0006-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch \
19 file://0007-chardev-connect-socket-to-a-spawned-command.patch \
20 file://0008-apic-fixup-fallthrough-to-PIC.patch \
21 file://0009-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \
22 file://0010-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \
23 file://0013-Revert-target-arm-Use-vector-operations-for-saturati.patch \
Brad Bishop19323692019-04-05 15:28:33 -040024 "
25UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
26
Brad Bishopc342db32019-05-15 21:57:59 -040027SRC_URI[md5sum] = "0afeca336fd57ae3d3086ec07f59d708"
28SRC_URI[sha256sum] = "13a93dfe75b86734326f8d5b475fde82ec692d5b5a338b4262aeeb6b0fa4e469"
Brad Bishop19323692019-04-05 15:28:33 -040029
30COMPATIBLE_HOST_mipsarchn32 = "null"
31COMPATIBLE_HOST_mipsarchn64 = "null"
32
33do_install_append() {
34 # Prevent QA warnings about installed ${localstatedir}/run
35 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
36}
37
38do_compile_ptest() {
39 make buildtest-TESTS
40}
41
42do_install_ptest() {
43 cp -rL ${B}/tests ${D}${PTEST_PATH}
44 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
45
46 cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
47 # Don't check the file genreated by configure
48 sed -i -e '/wildcard config-host.mak/d' \
49 -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include
50}
51
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052
53require qemu-targets.inc
Brad Bishop19323692019-04-05 15:28:33 -040054inherit pkgconfig bluetooth ptest
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056# QEMU_TARGETS is overridable variable
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080057QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc riscv32 riscv64 sh4 x86_64"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058
Brad Bishop6e60e8b2018-02-01 10:27:11 -050059EXTRA_OECONF = " \
60 --prefix=${prefix} \
61 --bindir=${bindir} \
62 --includedir=${includedir} \
63 --libdir=${libdir} \
64 --mandir=${mandir} \
65 --datadir=${datadir} \
66 --docdir=${docdir}/${BPN} \
67 --sysconfdir=${sysconfdir} \
68 --libexecdir=${libexecdir} \
69 --localstatedir=${localstatedir} \
70 --with-confsuffix=/${BPN} \
71 --disable-strip \
72 --disable-werror \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050073 --extra-cflags='${CFLAGS}' \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074 ${PACKAGECONFIG_CONFARGS} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 "
Patrick Williamsc0f7c042017-02-23 20:41:17 -060076
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077export LIBTOOL="${HOST_SYS}-libtool"
78
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080079B = "${WORKDIR}/build"
80
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081do_configure_prepend_class-native() {
82 # Append build host pkg-config paths for native target since the host may provide sdl
83 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
84 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
85 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086 fi
87}
88
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089do_configure() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050090 ${S}/configure ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091}
92
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093do_install () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080094 export STRIP=""
95 oe_runmake 'DESTDIR=${D}' install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096}
97
98# The following fragment will create a wrapper for qemu-mips user emulation
99# binary in order to work around a segmentation fault issue. Basically, by
100# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
101# This will trigger a MMU access fault in the virtual CPU. With this change,
102# the qemu-mips works fine.
103# IMPORTANT: This piece needs to be removed once the root cause is fixed!
104do_install_append() {
105 if [ -e "${D}/${bindir}/qemu-mips" ]; then
106 create_wrapper ${D}/${bindir}/qemu-mips \
107 QEMU_RESERVED_VA=0x0
108 fi
109}
110# END of qemu-mips workaround
111
Brad Bishop19323692019-04-05 15:28:33 -0400112make_qemu_wrapper() {
113 gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0`
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500114
Brad Bishop19323692019-04-05 15:28:33 -0400115 for tool in `ls ${D}${bindir}/qemu-system-*`; do
116 create_wrapper $tool \
117 GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \
118 FONTCONFIG_PATH=/etc/fonts \
119 GTK_THEME=Adwaita
120 done
121}
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500122
Brad Bishop19323692019-04-05 15:28:33 -0400123# Disable kvm/virgl/mesa on targets that do not support it
124PACKAGECONFIG_remove_darwin = "kvm virglrenderer glx gtk+"
125PACKAGECONFIG_remove_mingw32 = "kvm virglrenderer glx gtk+"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600126
Brad Bishopc342db32019-05-15 21:57:59 -0400127PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500128PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
129PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
130PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
131PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500132PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
133PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
134PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
135PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500136PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500137PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
Brad Bishopc342db32019-05-15 21:57:59 -0400138PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native"
139PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500140PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
141PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500142PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500143PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500144PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
145PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500146PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500147PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
148PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
149PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
150PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600151PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500152PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}"
153PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
154PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800155PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer"
156# spice will be in meta-networking layer
157PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice"
158# usbredir will be in meta-networking layer
159PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir"
Brad Bishopc342db32019-05-15 21:57:59 -0400160PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500161
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500162INSANE_SKIP_${PN} = "arch"
Brad Bishopc342db32019-05-15 21:57:59 -0400163
164FILES_${PN} += "${datadir}/icons"