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" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 5 | RDEPENDS_${PN}_class-target += "bash" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | |
| 7 | require qemu-targets.inc |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 8 | inherit autotools pkgconfig bluetooth |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | BBCLASSEXTEND = "native nativesdk" |
| 10 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | # QEMU_TARGETS is overridable variable |
| 12 | QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64" |
| 13 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 14 | EXTRA_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)} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 29 | --extra-cflags='${CFLAGS}' \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | " |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 31 | EXTRA_OECONF_append_class-native = " --python=python2.7" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 32 | |
| 33 | EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'" |
| 34 | |
| 35 | LDFLAGS_append_class-native = " -fuse-ld=bfd" |
| 36 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | export LIBTOOL="${HOST_SYS}-libtool" |
| 38 | |
| 39 | do_configure_prepend_class-native() { |
| 40 | # Append build host pkg-config paths for native target since the host may provide sdl |
| 41 | BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") |
| 42 | if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then |
| 43 | export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 45 | |
| 46 | # Alter target makefiles to accept CFLAGS set via env |
| 47 | sed -i -r \ |
| 48 | -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ |
| 49 | "${S}"/Makefile "${S}"/Makefile.target |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | } |
| 51 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | do_configure() { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 53 | ${S}/configure ${EXTRA_OECONF} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh |
| 55 | } |
| 56 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | do_install () { |
| 58 | export STRIP="true" |
| 59 | autotools_do_install |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | # The following fragment will create a wrapper for qemu-mips user emulation |
| 63 | # binary in order to work around a segmentation fault issue. Basically, by |
| 64 | # default, the reserved virtual address space for 32-on-64 bit is set to 4GB. |
| 65 | # This will trigger a MMU access fault in the virtual CPU. With this change, |
| 66 | # the qemu-mips works fine. |
| 67 | # IMPORTANT: This piece needs to be removed once the root cause is fixed! |
| 68 | do_install_append() { |
| 69 | if [ -e "${D}/${bindir}/qemu-mips" ]; then |
| 70 | create_wrapper ${D}/${bindir}/qemu-mips \ |
| 71 | QEMU_RESERVED_VA=0x0 |
| 72 | fi |
| 73 | } |
| 74 | # END of qemu-mips workaround |
| 75 | |
| 76 | PACKAGECONFIG ??= " \ |
| 77 | fdt sdl \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 78 | fdt sdl kvm \ |
| 79 | ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 81 | PACKAGECONFIG_class-native ??= "fdt alsa kvm" |
| 82 | PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm" |
| 83 | |
| 84 | # Handle distros such as CentOS 5 32-bit that do not have kvm support |
| 85 | PACKAGECONFIG_class-native_remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}" |
| 86 | |
| 87 | # Disable kvm on targets that do not support it |
| 88 | PACKAGECONFIG_remove_darwin = "kvm" |
| 89 | PACKAGECONFIG_remove_mingw32 = "kvm" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 90 | |
| 91 | PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 92 | PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr," |
| 93 | PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio," |
| 94 | PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs," |
| 95 | 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] | 96 | PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl," |
| 97 | PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg," |
| 98 | PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng," |
| 99 | PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 100 | PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss," |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses," |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 102 | PACKAGECONFIG[gtk+] = "--enable-gtk --with-gtkabi=3.0 --enable-vte,--disable-gtk --disable-vte,gtk+3 vte" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 103 | PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," |
| 104 | PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2," |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 105 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 106 | PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 107 | PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1" |
| 108 | PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 109 | PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 110 | PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" |
| 111 | PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo" |
| 112 | PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl" |
| 113 | PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 114 | PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 115 | PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}" |
| 116 | PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi" |
| 117 | PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 118 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 119 | INSANE_SKIP_${PN} = "arch" |