blob: 738bf2b22e3fc18b76832bace753e0ad4ce412b9 [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
34EXTRA_OECONF_append_class-native = " --enable-debug --enable-debug-info"
35INHIBIT_SYSROOT_STRIP = "1"
36
37EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
38 "
39export LIBTOOL="${HOST_SYS}-libtool"
40
41do_configure_prepend_class-native() {
42 # Append build host pkg-config paths for native target since the host may provide sdl
43 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
44 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
45 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
46 fi
47}
48
49KVMENABLE = "--enable-kvm"
50KVMENABLE_darwin = "--disable-kvm"
51KVMENABLE_mingw32 = "--disable-kvm"
52
53do_configure() {
54 # Handle distros such as CentOS 5 32-bit that do not have kvm support
55 KVMOPTS="--disable-kvm"
56 if [ "${PN}" != "qemu-native" -a "${PN}" != "nativesdk-qemu" ] \
57 || [ -f /usr/include/linux/kvm.h ] ; then
58 KVMOPTS="${KVMENABLE}"
59 fi
60
61 ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
62 test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
63}
64
65do_compile_ptest() {
66 make buildtest-TESTS
67}
68
69do_install_ptest() {
70 cp -rL ${B}/tests ${D}${PTEST_PATH}
71 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
72
73 cp ${S}/tests/Makefile ${D}${PTEST_PATH}/tests
74}
75
76do_install () {
77 export STRIP="true"
78 autotools_do_install
79 install -d ${D}${datadir}/qemu
80 install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
81}
82
83# The following fragment will create a wrapper for qemu-mips user emulation
84# binary in order to work around a segmentation fault issue. Basically, by
85# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
86# This will trigger a MMU access fault in the virtual CPU. With this change,
87# the qemu-mips works fine.
88# IMPORTANT: This piece needs to be removed once the root cause is fixed!
89do_install_append() {
90 if [ -e "${D}/${bindir}/qemu-mips" ]; then
91 create_wrapper ${D}/${bindir}/qemu-mips \
92 QEMU_RESERVED_VA=0x0
93 fi
94}
95# END of qemu-mips workaround
96
97PACKAGECONFIG ??= " \
98 fdt sdl \
99 ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
100 ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen', '', d)} \
101 "
102PACKAGECONFIG_class-native ??= "fdt alsa uuid"
103PACKAGECONFIG_class-nativesdk ??= "fdt sdl"
104NATIVEDEPS = ""
105NATIVEDEPS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxext-native', '',d)}"
106PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl ${NATIVEDEPS},"
107PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
108PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
109PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
110PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest"
111PACKAGECONFIG[vnc-tls] = "--enable-vnc --enable-vnc-tls,--disable-vnc-tls, gnutls,"
112PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
113PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
114PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
115PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl,"
116PACKAGECONFIG[nss] = "--enable-smartcard-nss,--disable-smartcard-nss,nss,"
117PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
118PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
119PACKAGECONFIG[gtk+] = "--enable-gtk --enable-vte,--disable-gtk --disable-vte,gtk+ libvte,"
120PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
121PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
122PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
123PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
124PACKAGECONFIG[alsa] = ",,alsa-lib"
125PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
126PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
127PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
128PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
129
130EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}"
131
132# Qemu target will not build in world build for ARM or Mips
133BROKEN_qemuarm = "1"
134BROKEN_qemumips64 = "1"
135BROKEN_qemumips = "1"
136
137INSANE_SKIP_${PN} = "arch"