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