1eb8dc403SDave CobbleySUMMARY = "Fast open source processor emulator" 2eb8dc403SDave CobbleyHOMEPAGE = "http://qemu.org" 3eb8dc403SDave CobbleyLICENSE = "GPLv2 & LGPLv2.1" 419323693SBrad Bishop 519323693SBrad BishopRDEPENDS_${PN}-ptest = "bash make" 619323693SBrad Bishop 719323693SBrad BishopLIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ 8*c342db35SBrad Bishop file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" 919323693SBrad Bishop 1019323693SBrad BishopSRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ 1119323693SBrad Bishop file://powerpc_rom.bin \ 1219323693SBrad Bishop file://run-ptest \ 13*c342db35SBrad Bishop file://0001-qemu-Add-missing-wacom-HID-descriptor.patch \ 14*c342db35SBrad Bishop file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \ 15*c342db35SBrad Bishop file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ 16*c342db35SBrad Bishop file://0004-qemu-disable-Valgrind.patch \ 17*c342db35SBrad Bishop file://0005-qemu-Limit-paths-searched-during-user-mode-emulation.patch \ 18*c342db35SBrad Bishop file://0006-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch \ 19*c342db35SBrad Bishop file://0007-chardev-connect-socket-to-a-spawned-command.patch \ 20*c342db35SBrad Bishop file://0008-apic-fixup-fallthrough-to-PIC.patch \ 21*c342db35SBrad Bishop file://0009-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ 22*c342db35SBrad Bishop file://0010-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \ 23*c342db35SBrad Bishop file://0013-Revert-target-arm-Use-vector-operations-for-saturati.patch \ 2419323693SBrad Bishop " 2519323693SBrad BishopUPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" 2619323693SBrad Bishop 27*c342db35SBrad BishopSRC_URI[md5sum] = "0afeca336fd57ae3d3086ec07f59d708" 28*c342db35SBrad BishopSRC_URI[sha256sum] = "13a93dfe75b86734326f8d5b475fde82ec692d5b5a338b4262aeeb6b0fa4e469" 2919323693SBrad Bishop 3019323693SBrad BishopCOMPATIBLE_HOST_mipsarchn32 = "null" 3119323693SBrad BishopCOMPATIBLE_HOST_mipsarchn64 = "null" 3219323693SBrad Bishop 3319323693SBrad Bishopdo_install_append() { 3419323693SBrad Bishop # Prevent QA warnings about installed ${localstatedir}/run 3519323693SBrad Bishop if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi 3619323693SBrad Bishop} 3719323693SBrad Bishop 3819323693SBrad Bishopdo_compile_ptest() { 3919323693SBrad Bishop make buildtest-TESTS 4019323693SBrad Bishop} 4119323693SBrad Bishop 4219323693SBrad Bishopdo_install_ptest() { 4319323693SBrad Bishop cp -rL ${B}/tests ${D}${PTEST_PATH} 4419323693SBrad Bishop find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {} 4519323693SBrad Bishop 4619323693SBrad Bishop cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests 4719323693SBrad Bishop # Don't check the file genreated by configure 4819323693SBrad Bishop sed -i -e '/wildcard config-host.mak/d' \ 4919323693SBrad Bishop -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include 5019323693SBrad Bishop} 5119323693SBrad Bishop 52eb8dc403SDave Cobbley 53eb8dc403SDave Cobbleyrequire qemu-targets.inc 5419323693SBrad Bishopinherit pkgconfig bluetooth ptest 55eb8dc403SDave Cobbley 56eb8dc403SDave Cobbley# QEMU_TARGETS is overridable variable 571a4b7ee2SBrad BishopQEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc riscv32 riscv64 sh4 x86_64" 58eb8dc403SDave Cobbley 59eb8dc403SDave CobbleyEXTRA_OECONF = " \ 60eb8dc403SDave Cobbley --prefix=${prefix} \ 61eb8dc403SDave Cobbley --bindir=${bindir} \ 62eb8dc403SDave Cobbley --includedir=${includedir} \ 63eb8dc403SDave Cobbley --libdir=${libdir} \ 64eb8dc403SDave Cobbley --mandir=${mandir} \ 65eb8dc403SDave Cobbley --datadir=${datadir} \ 66eb8dc403SDave Cobbley --docdir=${docdir}/${BPN} \ 67eb8dc403SDave Cobbley --sysconfdir=${sysconfdir} \ 68eb8dc403SDave Cobbley --libexecdir=${libexecdir} \ 69eb8dc403SDave Cobbley --localstatedir=${localstatedir} \ 70eb8dc403SDave Cobbley --with-confsuffix=/${BPN} \ 71eb8dc403SDave Cobbley --disable-strip \ 72eb8dc403SDave Cobbley --disable-werror \ 73eb8dc403SDave Cobbley --extra-cflags='${CFLAGS}' \ 741a4b7ee2SBrad Bishop ${PACKAGECONFIG_CONFARGS} \ 75eb8dc403SDave Cobbley " 76eb8dc403SDave Cobbley 77eb8dc403SDave Cobbleyexport LIBTOOL="${HOST_SYS}-libtool" 78eb8dc403SDave Cobbley 791a4b7ee2SBrad BishopB = "${WORKDIR}/build" 801a4b7ee2SBrad Bishop 81eb8dc403SDave Cobbleydo_configure_prepend_class-native() { 82eb8dc403SDave Cobbley # Append build host pkg-config paths for native target since the host may provide sdl 83eb8dc403SDave Cobbley BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") 84eb8dc403SDave Cobbley if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then 85eb8dc403SDave Cobbley export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH 86eb8dc403SDave Cobbley fi 87eb8dc403SDave Cobbley} 88eb8dc403SDave Cobbley 89eb8dc403SDave Cobbleydo_configure() { 90eb8dc403SDave Cobbley ${S}/configure ${EXTRA_OECONF} 91eb8dc403SDave Cobbley} 92eb8dc403SDave Cobbley 93eb8dc403SDave Cobbleydo_install () { 941a4b7ee2SBrad Bishop export STRIP="" 951a4b7ee2SBrad Bishop oe_runmake 'DESTDIR=${D}' install 96eb8dc403SDave Cobbley} 97eb8dc403SDave Cobbley 98eb8dc403SDave Cobbley# The following fragment will create a wrapper for qemu-mips user emulation 99eb8dc403SDave Cobbley# binary in order to work around a segmentation fault issue. Basically, by 100eb8dc403SDave Cobbley# default, the reserved virtual address space for 32-on-64 bit is set to 4GB. 101eb8dc403SDave Cobbley# This will trigger a MMU access fault in the virtual CPU. With this change, 102eb8dc403SDave Cobbley# the qemu-mips works fine. 103eb8dc403SDave Cobbley# IMPORTANT: This piece needs to be removed once the root cause is fixed! 104eb8dc403SDave Cobbleydo_install_append() { 105eb8dc403SDave Cobbley if [ -e "${D}/${bindir}/qemu-mips" ]; then 106eb8dc403SDave Cobbley create_wrapper ${D}/${bindir}/qemu-mips \ 107eb8dc403SDave Cobbley QEMU_RESERVED_VA=0x0 108eb8dc403SDave Cobbley fi 109eb8dc403SDave Cobbley} 110eb8dc403SDave Cobbley# END of qemu-mips workaround 111eb8dc403SDave Cobbley 11219323693SBrad Bishopmake_qemu_wrapper() { 11319323693SBrad Bishop gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0` 114eb8dc403SDave Cobbley 11519323693SBrad Bishop for tool in `ls ${D}${bindir}/qemu-system-*`; do 11619323693SBrad Bishop create_wrapper $tool \ 11719323693SBrad Bishop GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \ 11819323693SBrad Bishop FONTCONFIG_PATH=/etc/fonts \ 11919323693SBrad Bishop GTK_THEME=Adwaita 12019323693SBrad Bishop done 12119323693SBrad Bishop} 122eb8dc403SDave Cobbley 12319323693SBrad Bishop# Disable kvm/virgl/mesa on targets that do not support it 12419323693SBrad BishopPACKAGECONFIG_remove_darwin = "kvm virglrenderer glx gtk+" 12519323693SBrad BishopPACKAGECONFIG_remove_mingw32 = "kvm virglrenderer glx gtk+" 126eb8dc403SDave Cobbley 127*c342db35SBrad BishopPACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2" 128eb8dc403SDave CobbleyPACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr," 129eb8dc403SDave CobbleyPACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio," 130eb8dc403SDave CobbleyPACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs," 131eb8dc403SDave CobbleyPACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest" 132eb8dc403SDave CobbleyPACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl," 133eb8dc403SDave CobbleyPACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg," 134eb8dc403SDave CobbleyPACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng," 135eb8dc403SDave CobbleyPACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl," 136eb8dc403SDave CobbleyPACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss," 137eb8dc403SDave CobbleyPACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses," 138*c342db35SBrad BishopPACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native" 139*c342db35SBrad BishopPACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native" 140eb8dc403SDave CobbleyPACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," 141eb8dc403SDave CobbleyPACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2," 142eb8dc403SDave CobbleyPACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt," 143eb8dc403SDave CobbleyPACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle" 144eb8dc403SDave CobbleyPACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1" 145eb8dc403SDave CobbleyPACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc" 146eb8dc403SDave CobbleyPACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib" 147eb8dc403SDave CobbleyPACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" 148eb8dc403SDave CobbleyPACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo" 149eb8dc403SDave CobbleyPACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl" 150eb8dc403SDave CobbleyPACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls" 151eb8dc403SDave CobbleyPACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" 152eb8dc403SDave CobbleyPACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}" 153eb8dc403SDave CobbleyPACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi" 154eb8dc403SDave CobbleyPACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm" 1551a4b7ee2SBrad BishopPACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer" 1561a4b7ee2SBrad Bishop# spice will be in meta-networking layer 1571a4b7ee2SBrad BishopPACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice" 1581a4b7ee2SBrad Bishop# usbredir will be in meta-networking layer 1591a4b7ee2SBrad BishopPACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir" 160*c342db35SBrad BishopPACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy" 161eb8dc403SDave Cobbley 162eb8dc403SDave CobbleyINSANE_SKIP_${PN} = "arch" 163*c342db35SBrad Bishop 164*c342db35SBrad BishopFILES_${PN} += "${datadir}/icons" 165