blob: 0e1411af641a92c5c95458a0c005132cc5d4aee7 [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"
Patrick Williamsc0f7c042017-02-23 20:41:17 -06005RDEPENDS_${PN}_class-target += "bash"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006
7require qemu-targets.inc
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008inherit autotools pkgconfig bluetooth
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009BBCLASSEXTEND = "native nativesdk"
10
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011# QEMU_TARGETS is overridable variable
12QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
13
Brad Bishop6e60e8b2018-02-01 10:27:11 -050014EXTRA_OECONF = " \
15 --prefix=${prefix} \
16 --bindir=${bindir} \
17 --includedir=${includedir} \
18 --libdir=${libdir} \
19 --mandir=${mandir} \
20 --datadir=${datadir} \
21 --docdir=${docdir}/${BPN} \
22 --sysconfdir=${sysconfdir} \
23 --libexecdir=${libexecdir} \
24 --localstatedir=${localstatedir} \
25 --with-confsuffix=/${BPN} \
26 --disable-strip \
27 --disable-werror \
28 --target-list=${@get_qemu_target_list(d)} \
29 --with-system-pixman \
30 --extra-cflags='${CFLAGS}' \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031 "
Brad Bishop6e60e8b2018-02-01 10:27:11 -050032EXTRA_OECONF_append_class-native = " --python=${USRBINPATH}/python2.7"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060033
34EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
35
36LDFLAGS_append_class-native = " -fuse-ld=bfd"
37
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038export LIBTOOL="${HOST_SYS}-libtool"
39
40do_configure_prepend_class-native() {
41 # Append build host pkg-config paths for native target since the host may provide sdl
42 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
43 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
44 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -060046
47 # Alter target makefiles to accept CFLAGS set via env
48 sed -i -r \
49 -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
50 "${S}"/Makefile "${S}"/Makefile.target
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051}
52
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053do_configure() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054 ${S}/configure ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055 test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
56}
57
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058do_install () {
59 export STRIP="true"
60 autotools_do_install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061}
62
63# The following fragment will create a wrapper for qemu-mips user emulation
64# binary in order to work around a segmentation fault issue. Basically, by
65# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
66# This will trigger a MMU access fault in the virtual CPU. With this change,
67# the qemu-mips works fine.
68# IMPORTANT: This piece needs to be removed once the root cause is fixed!
69do_install_append() {
70 if [ -e "${D}/${bindir}/qemu-mips" ]; then
71 create_wrapper ${D}/${bindir}/qemu-mips \
72 QEMU_RESERVED_VA=0x0
73 fi
74}
75# END of qemu-mips workaround
76
77PACKAGECONFIG ??= " \
78 fdt sdl \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050079 fdt sdl kvm \
80 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081 "
Brad Bishop6e60e8b2018-02-01 10:27:11 -050082PACKAGECONFIG_class-native ??= "fdt alsa kvm"
83PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm"
84
85# Handle distros such as CentOS 5 32-bit that do not have kvm support
86PACKAGECONFIG_class-native_remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
87
88# Disable kvm on targets that do not support it
89PACKAGECONFIG_remove_darwin = "kvm"
90PACKAGECONFIG_remove_mingw32 = "kvm"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060091
92PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
94PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
95PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
96PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
98PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
99PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
100PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500101PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600103PACKAGECONFIG[gtk+] = "--enable-gtk --with-gtkabi=3.0 --enable-vte,--disable-gtk --disable-vte,gtk+3 vte"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500104PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
105PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500106PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500107PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
109PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500110PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
112PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
113PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
114PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600115PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500116PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}"
117PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
118PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500119
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500120INSANE_SKIP_${PN} = "arch"