2013-06-06 01:53:30 +02:00
|
|
|
|
################################################################################
|
2012-10-19 05:13:46 +02:00
|
|
|
|
#
|
|
|
|
|
# qemu
|
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
|
################################################################################
|
2012-10-19 05:13:46 +02:00
|
|
|
|
|
2014-10-08 00:38:11 +02:00
|
|
|
|
QEMU_VERSION = 2.1.2
|
2012-10-19 05:13:46 +02:00
|
|
|
|
QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
|
|
|
|
|
QEMU_SITE = http://wiki.qemu.org/download
|
2012-12-10 14:44:21 +01:00
|
|
|
|
QEMU_LICENSE = GPLv2 LGPLv2.1 MIT BSD-3c BSD-2c Others/BSD-1c
|
|
|
|
|
QEMU_LICENSE_FILES = COPYING COPYING.LIB
|
|
|
|
|
# NOTE: there is no top-level license file for non-(L)GPL licenses;
|
|
|
|
|
# the non-(L)GPL license texts are specified in the affected
|
|
|
|
|
# individual source files.
|
2012-10-19 05:13:46 +02:00
|
|
|
|
|
2012-12-13 12:39:37 +01:00
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
# Host-qemu
|
|
|
|
|
|
2015-02-06 11:36:25 +01:00
|
|
|
|
HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
|
2012-11-04 07:35:24 +01:00
|
|
|
|
|
2012-10-19 05:13:46 +02:00
|
|
|
|
# BR ARCH qemu
|
|
|
|
|
# ------- ----
|
|
|
|
|
# arm arm
|
|
|
|
|
# armeb armeb
|
|
|
|
|
# bfin not supported
|
|
|
|
|
# i386 i386
|
|
|
|
|
# i486 i386
|
|
|
|
|
# i586 i386
|
|
|
|
|
# i686 i386
|
|
|
|
|
# x86_64 x86_64
|
|
|
|
|
# m68k m68k
|
|
|
|
|
# microblaze microblaze
|
|
|
|
|
# mips mips
|
|
|
|
|
# mipsel mipsel
|
|
|
|
|
# mips64 ?
|
|
|
|
|
# mips64el ?
|
|
|
|
|
# powerpc ppc
|
|
|
|
|
# sh2a not supported
|
|
|
|
|
# sh4 sh4
|
|
|
|
|
# sh4eb sh4eb
|
|
|
|
|
# sh4a ?
|
|
|
|
|
# sh4aeb ?
|
|
|
|
|
# sh64 not supported
|
|
|
|
|
# sparc sparc
|
|
|
|
|
|
2012-12-13 12:39:37 +01:00
|
|
|
|
HOST_QEMU_ARCH = $(ARCH)
|
|
|
|
|
ifeq ($(HOST_QEMU_ARCH),i486)
|
2014-10-25 08:20:44 +02:00
|
|
|
|
HOST_QEMU_ARCH = i386
|
2012-10-19 05:13:46 +02:00
|
|
|
|
endif
|
2012-12-13 12:39:37 +01:00
|
|
|
|
ifeq ($(HOST_QEMU_ARCH),i586)
|
2014-10-25 08:20:44 +02:00
|
|
|
|
HOST_QEMU_ARCH = i386
|
2012-10-19 05:13:46 +02:00
|
|
|
|
endif
|
2012-12-13 12:39:37 +01:00
|
|
|
|
ifeq ($(HOST_QEMU_ARCH),i686)
|
2014-10-25 08:20:44 +02:00
|
|
|
|
HOST_QEMU_ARCH = i386
|
2012-10-19 05:13:46 +02:00
|
|
|
|
endif
|
2012-12-13 12:39:37 +01:00
|
|
|
|
ifeq ($(HOST_QEMU_ARCH),powerpc)
|
2014-10-25 08:20:44 +02:00
|
|
|
|
HOST_QEMU_ARCH = ppc
|
2012-10-19 05:13:46 +02:00
|
|
|
|
endif
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
|
HOST_QEMU_TARGETS = $(HOST_QEMU_ARCH)-linux-user
|
2012-10-19 05:13:46 +02:00
|
|
|
|
|
2014-12-10 23:11:59 +01:00
|
|
|
|
ifeq ($(BR2_PACKAGE_HOST_QEMU),y)
|
|
|
|
|
HOST_QEMU_HOST_SYSTEM_TYPE = $(shell uname -s)
|
|
|
|
|
ifneq ($(HOST_QEMU_HOST_SYSTEM_TYPE),Linux)
|
|
|
|
|
$(error "qemu-user can only be used on Linux hosts")
|
|
|
|
|
endif
|
|
|
|
|
|
2015-02-06 13:02:23 +01:00
|
|
|
|
# kernel version as major*256 + minor
|
|
|
|
|
HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
|
|
|
|
|
HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
|
|
|
|
|
HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
|
2014-12-10 23:11:59 +01:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# The principle of qemu-user is that it emulates the instructions of
|
|
|
|
|
# the target architecture when running the binary, and then when this
|
|
|
|
|
# binary does a system call, it converts this system call into a
|
|
|
|
|
# system call on the host machine. This mechanism makes an assumption:
|
|
|
|
|
# that the target binary will not do system calls that do not exist on
|
|
|
|
|
# the host. This basically requires that the target binary should be
|
|
|
|
|
# built with kernel headers that are older or the same as the kernel
|
|
|
|
|
# version running on the host machine.
|
|
|
|
|
#
|
2015-02-06 13:02:23 +01:00
|
|
|
|
ifneq ($(HOST_QEMU_COMPARE_VERSION),OK)
|
2014-12-10 23:11:59 +01:00
|
|
|
|
$(error "Refusing to build qemu-user: target Linux version newer than host's.")
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2012-10-19 05:13:46 +02:00
|
|
|
|
define HOST_QEMU_CONFIGURE_CMDS
|
2014-10-08 00:38:10 +02:00
|
|
|
|
cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure \
|
2012-10-19 05:13:46 +02:00
|
|
|
|
--target-list="$(HOST_QEMU_TARGETS)" \
|
|
|
|
|
--prefix="$(HOST_DIR)/usr" \
|
|
|
|
|
--interp-prefix=$(STAGING_DIR) \
|
|
|
|
|
--cc="$(HOSTCC)" \
|
|
|
|
|
--host-cc="$(HOSTCC)" \
|
2015-02-06 11:36:25 +01:00
|
|
|
|
--python=$(HOST_DIR)/usr/bin/python2 \
|
2012-10-19 05:13:46 +02:00
|
|
|
|
--extra-cflags="$(HOST_CFLAGS)" \
|
2014-10-08 00:38:10 +02:00
|
|
|
|
--extra-ldflags="$(HOST_LDFLAGS)"
|
2012-10-19 05:13:46 +02:00
|
|
|
|
endef
|
|
|
|
|
|
2014-10-08 00:38:10 +02:00
|
|
|
|
define HOST_QEMU_BUILD_CMDS
|
|
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define HOST_QEMU_INSTALL_CMDS
|
2014-11-15 11:58:00 +01:00
|
|
|
|
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
|
2014-10-08 00:38:10 +02:00
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
$(eval $(host-generic-package))
|
2012-10-19 05:13:46 +02:00
|
|
|
|
|
|
|
|
|
# variable used by other packages
|
2012-12-14 08:53:47 +01:00
|
|
|
|
QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(HOST_QEMU_ARCH)
|
2014-10-08 00:38:12 +02:00
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------
|
|
|
|
|
# Target-qemu
|
|
|
|
|
|
|
|
|
|
QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
|
|
|
|
|
|
|
|
|
|
# Need the LIBS variable because librt and libm are
|
|
|
|
|
# not automatically pulled. :-(
|
|
|
|
|
QEMU_LIBS = -lrt -lm
|
|
|
|
|
|
|
|
|
|
QEMU_OPTS =
|
|
|
|
|
|
|
|
|
|
QEMU_VARS = \
|
|
|
|
|
LIBTOOL=$(HOST_DIR)/usr/bin/libtool \
|
2014-11-03 22:37:34 +01:00
|
|
|
|
PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
2014-10-25 08:20:44 +02:00
|
|
|
|
PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
|
2014-10-08 00:38:12 +02:00
|
|
|
|
|
2014-11-08 14:13:29 +01:00
|
|
|
|
# If we want to specify only a subset of targets, we must still enable all
|
|
|
|
|
# of them, so that QEMU properly builds its list of default targets, from
|
|
|
|
|
# which it then checks if the specified sub-set is valid. That's what we
|
|
|
|
|
# do in the first part of the if-clause.
|
|
|
|
|
# Otherwise, if we do not want to pass a sub-set of targets, we then need
|
|
|
|
|
# to either enable or disable -user and/or -system emulation appropriately.
|
|
|
|
|
# That's what we do in the else-clause.
|
|
|
|
|
ifneq ($(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS)),)
|
|
|
|
|
QEMU_OPTS += --enable-system --enable-linux-user
|
|
|
|
|
QEMU_OPTS += --target-list="$(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS))"
|
|
|
|
|
else
|
|
|
|
|
|
2014-10-08 00:38:13 +02:00
|
|
|
|
ifeq ($(BR2_PACKAGE_QEMU_SYSTEM),y)
|
|
|
|
|
QEMU_OPTS += --enable-system
|
|
|
|
|
else
|
|
|
|
|
QEMU_OPTS += --disable-system
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_QEMU_LINUX_USER),y)
|
|
|
|
|
QEMU_OPTS += --enable-linux-user
|
|
|
|
|
else
|
|
|
|
|
QEMU_OPTS += --disable-linux-user
|
|
|
|
|
endif
|
|
|
|
|
|
2014-10-08 00:38:14 +02:00
|
|
|
|
endif
|
|
|
|
|
|
2014-10-08 00:38:15 +02:00
|
|
|
|
ifeq ($(BR2_PACKAGE_QEMU_SDL),y)
|
|
|
|
|
QEMU_OPTS += --enable-sdl
|
|
|
|
|
QEMU_DEPENDENCIES += sdl
|
|
|
|
|
QEMU_VARS += SDL_CONFIG=$(BR2_STAGING_DIR)/usr/bin/sdl-config
|
|
|
|
|
else
|
|
|
|
|
QEMU_OPTS += --disable-sdl
|
|
|
|
|
endif
|
|
|
|
|
|
2014-11-17 22:25:40 +01:00
|
|
|
|
ifeq ($(BR2_PACKAGE_QEMU_FDT),y)
|
|
|
|
|
QEMU_OPTS += --enable-fdt
|
|
|
|
|
QEMU_DEPENDENCIES += dtc
|
|
|
|
|
else
|
|
|
|
|
QEMU_OPTS += --disable-fdt
|
|
|
|
|
endif
|
|
|
|
|
|
2014-10-08 00:38:12 +02:00
|
|
|
|
define QEMU_CONFIGURE_CMDS
|
2014-10-27 09:25:28 +01:00
|
|
|
|
( cd $(@D); \
|
|
|
|
|
LIBS='$(QEMU_LIBS)' \
|
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
|
|
|
|
$(QEMU_VARS) \
|
|
|
|
|
./configure \
|
|
|
|
|
--prefix=/usr \
|
|
|
|
|
--cross-prefix=$(TARGET_CROSS) \
|
|
|
|
|
--with-system-pixman \
|
|
|
|
|
--audio-drv-list= \
|
|
|
|
|
--enable-kvm \
|
|
|
|
|
--enable-attr \
|
|
|
|
|
--enable-vhost-net \
|
|
|
|
|
--disable-bsd-user \
|
|
|
|
|
--disable-xen \
|
|
|
|
|
--disable-slirp \
|
|
|
|
|
--disable-vnc \
|
|
|
|
|
--disable-virtfs \
|
|
|
|
|
--disable-brlapi \
|
|
|
|
|
--disable-curses \
|
|
|
|
|
--disable-curl \
|
|
|
|
|
--disable-bluez \
|
|
|
|
|
--disable-guest-base \
|
|
|
|
|
--disable-uuid \
|
|
|
|
|
--disable-vde \
|
|
|
|
|
--disable-linux-aio \
|
|
|
|
|
--disable-cap-ng \
|
|
|
|
|
--disable-docs \
|
|
|
|
|
--disable-spice \
|
|
|
|
|
--disable-rbd \
|
|
|
|
|
--disable-libiscsi \
|
|
|
|
|
--disable-usb-redir \
|
|
|
|
|
--disable-smartcard-nss \
|
|
|
|
|
--disable-strip \
|
|
|
|
|
--disable-seccomp \
|
|
|
|
|
--disable-sparse \
|
|
|
|
|
--disable-tools \
|
|
|
|
|
$(QEMU_OPTS) \
|
2014-10-08 00:38:12 +02:00
|
|
|
|
)
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define QEMU_BUILD_CMDS
|
|
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
define QEMU_INSTALL_TARGET_CMDS
|
|
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) DESTDIR=$(TARGET_DIR) install
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|