Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Fast open source processor emulator" |
| 2 | HOMEPAGE = "http://qemu.org" |
| 3 | LICENSE = "GPLv2 & LGPLv2.1" |
| 4 | DEPENDS = "glib-2.0 zlib pixman" |
| 5 | RDEPENDS_${PN}_class-target += "bash python" |
| 6 | RDEPENDS_${PN}-ptest = "bash make" |
| 7 | |
| 8 | require qemu-targets.inc |
| 9 | inherit autotools ptest |
| 10 | BBCLASSEXTEND = "native nativesdk" |
| 11 | |
| 12 | PR = "r1" |
| 13 | |
| 14 | # QEMU_TARGETS is overridable variable |
| 15 | QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64" |
| 16 | |
| 17 | SRC_URI = "\ |
| 18 | file://powerpc_rom.bin \ |
| 19 | file://disable-grabs.patch \ |
| 20 | file://exclude-some-arm-EABI-obsolete-syscalls.patch \ |
| 21 | file://wacom.patch \ |
| 22 | file://add-ptest-in-makefile.patch \ |
| 23 | file://run-ptest \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | " |
| 25 | |
| 26 | SRC_URI_append_class-native = "\ |
| 27 | file://fix-libcap-header-issue-on-some-distro.patch \ |
| 28 | file://cpus.c-qemu_cpu_kick_thread_debugging.patch \ |
| 29 | " |
| 30 | |
| 31 | EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'" |
| 32 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \ |
| 34 | " |
| 35 | export LIBTOOL="${HOST_SYS}-libtool" |
| 36 | |
| 37 | do_configure_prepend_class-native() { |
| 38 | # Append build host pkg-config paths for native target since the host may provide sdl |
| 39 | BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") |
| 40 | if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then |
| 41 | export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH |
Ed Bartosh | ca7c3f6 | 2015-11-03 19:03:49 +0200 | [diff] [blame] | 42 | # link with system dbus on Ubuntu 15.10 |
| 43 | # FIXME: remove below 4 lines when oe dbus is upgraded |
| 44 | if [ -r /etc/lsb-release -a "$(lsb_release -is)$(lsb_release -rs)" = "Ubuntu15.10" ] ; then |
| 45 | libs=$(PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=$BHOST_PKGCONFIG_PATH PATH=/usr/bin:/bin pkg-config --libs dbus-1 || echo "") |
| 46 | [ -n "$libs" ] && export LDFLAGS="$libs $LDFLAGS" |
| 47 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | fi |
| 49 | } |
| 50 | |
| 51 | KVMENABLE = "--enable-kvm" |
| 52 | KVMENABLE_darwin = "--disable-kvm" |
| 53 | KVMENABLE_mingw32 = "--disable-kvm" |
| 54 | |
| 55 | do_configure() { |
| 56 | # Handle distros such as CentOS 5 32-bit that do not have kvm support |
| 57 | KVMOPTS="--disable-kvm" |
| 58 | if [ "${PN}" != "qemu-native" -a "${PN}" != "nativesdk-qemu" ] \ |
| 59 | || [ -f /usr/include/linux/kvm.h ] ; then |
| 60 | KVMOPTS="${KVMENABLE}" |
| 61 | fi |
| 62 | |
| 63 | ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS |
| 64 | test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh |
| 65 | } |
| 66 | |
| 67 | do_compile_ptest() { |
| 68 | make buildtest-TESTS |
| 69 | } |
| 70 | |
| 71 | do_install_ptest() { |
| 72 | cp -rL ${B}/tests ${D}${PTEST_PATH} |
| 73 | find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {} |
| 74 | |
| 75 | cp ${S}/tests/Makefile ${D}${PTEST_PATH}/tests |
| 76 | } |
| 77 | |
| 78 | do_install () { |
| 79 | export STRIP="true" |
| 80 | autotools_do_install |
| 81 | install -d ${D}${datadir}/qemu |
| 82 | install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu |
| 83 | } |
| 84 | |
| 85 | # The following fragment will create a wrapper for qemu-mips user emulation |
| 86 | # binary in order to work around a segmentation fault issue. Basically, by |
| 87 | # default, the reserved virtual address space for 32-on-64 bit is set to 4GB. |
| 88 | # This will trigger a MMU access fault in the virtual CPU. With this change, |
| 89 | # the qemu-mips works fine. |
| 90 | # IMPORTANT: This piece needs to be removed once the root cause is fixed! |
| 91 | do_install_append() { |
| 92 | if [ -e "${D}/${bindir}/qemu-mips" ]; then |
| 93 | create_wrapper ${D}/${bindir}/qemu-mips \ |
| 94 | QEMU_RESERVED_VA=0x0 |
| 95 | fi |
| 96 | } |
| 97 | # END of qemu-mips workaround |
| 98 | |
| 99 | PACKAGECONFIG ??= " \ |
| 100 | fdt sdl \ |
| 101 | ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \ |
| 102 | ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen', '', d)} \ |
| 103 | " |
| 104 | PACKAGECONFIG_class-native ??= "fdt alsa uuid" |
| 105 | PACKAGECONFIG_class-nativesdk ??= "fdt sdl" |
| 106 | NATIVEDEPS = "" |
| 107 | NATIVEDEPS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxext-native', '',d)}" |
| 108 | PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl ${NATIVEDEPS}," |
| 109 | PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr," |
| 110 | PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio," |
| 111 | PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs," |
| 112 | PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 113 | PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl," |
| 114 | PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg," |
| 115 | PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng," |
| 116 | PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 117 | PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss," |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 118 | PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," |
| 119 | PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses," |
| 120 | PACKAGECONFIG[gtk+] = "--enable-gtk --enable-vte,--disable-gtk --disable-vte,gtk+ libvte," |
| 121 | PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," |
| 122 | PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 123 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,gcrypt," |
| 124 | PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 125 | PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1" |
| 126 | PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc" |
| 127 | PACKAGECONFIG[alsa] = ",,alsa-lib" |
| 128 | PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" |
| 129 | PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo" |
| 130 | PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl" |
| 131 | PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls" |
| 132 | |
| 133 | EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}" |
| 134 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 135 | INSANE_SKIP_${PN} = "arch" |