diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk index c3a7e7738e..cec656fe85 100644 --- a/package/qemu/qemu.mk +++ b/package/qemu/qemu.mk @@ -13,6 +13,127 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB # the non-(L)GPL license texts are specified in the affected # individual source files. +#------------------------------------------------------------- +# 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)/bin/libtool \ + PYTHON=$(HOST_DIR)/bin/python2 \ + PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages + +# 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 + +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 + +endif + +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 + +ifeq ($(BR2_PACKAGE_QEMU_FDT),y) +QEMU_OPTS += --enable-fdt +QEMU_DEPENDENCIES += dtc +else +QEMU_OPTS += --disable-fdt +endif + +ifeq ($(BR2_PACKAGE_QEMU_TOOLS),y) +QEMU_OPTS += --enable-tools +else +QEMU_OPTS += --disable-tools +endif + +ifeq ($(BR2_PACKAGE_LIBSSH2),y) +QEMU_OPTS += --enable-libssh2 +QEMU_DEPENDENCIES += libssh2 +else +QEMU_OPTS += --disable-libssh2 +endif + +# Override CPP, as it expects to be able to call it like it'd +# call the compiler. +define QEMU_CONFIGURE_CMDS + ( cd $(@D); \ + LIBS='$(QEMU_LIBS)' \ + $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_ARGS) \ + CPP="$(TARGET_CC) -E" \ + $(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-vde \ + --disable-linux-aio \ + --disable-cap-ng \ + --disable-docs \ + --disable-spice \ + --disable-rbd \ + --disable-libiscsi \ + --disable-usb-redir \ + --disable-strip \ + --disable-seccomp \ + --disable-sparse \ + $(QEMU_OPTS) \ + ) +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)) + #------------------------------------------------------------- # Host-qemu @@ -148,124 +269,3 @@ $(eval $(host-generic-package)) # variable used by other packages QEMU_USER = $(HOST_DIR)/bin/qemu-$(HOST_QEMU_ARCH) - -#------------------------------------------------------------- -# 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)/bin/libtool \ - PYTHON=$(HOST_DIR)/bin/python2 \ - PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages - -# 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 - -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 - -endif - -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 - -ifeq ($(BR2_PACKAGE_QEMU_FDT),y) -QEMU_OPTS += --enable-fdt -QEMU_DEPENDENCIES += dtc -else -QEMU_OPTS += --disable-fdt -endif - -ifeq ($(BR2_PACKAGE_QEMU_TOOLS),y) -QEMU_OPTS += --enable-tools -else -QEMU_OPTS += --disable-tools -endif - -ifeq ($(BR2_PACKAGE_LIBSSH2),y) -QEMU_OPTS += --enable-libssh2 -QEMU_DEPENDENCIES += libssh2 -else -QEMU_OPTS += --disable-libssh2 -endif - -# Override CPP, as it expects to be able to call it like it'd -# call the compiler. -define QEMU_CONFIGURE_CMDS - ( cd $(@D); \ - LIBS='$(QEMU_LIBS)' \ - $(TARGET_CONFIGURE_OPTS) \ - $(TARGET_CONFIGURE_ARGS) \ - CPP="$(TARGET_CC) -E" \ - $(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-vde \ - --disable-linux-aio \ - --disable-cap-ng \ - --disable-docs \ - --disable-spice \ - --disable-rbd \ - --disable-libiscsi \ - --disable-usb-redir \ - --disable-strip \ - --disable-seccomp \ - --disable-sparse \ - $(QEMU_OPTS) \ - ) -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))