15fa72b17c1372f0e7ffc36f54314f18bdea9994
[feed/packages.git] / utils / qemu / Makefile
1 #
2 # Copyright (C) 2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=qemu
11 PKG_VERSION:=2.6.2
12 PKG_RELEASE:=1
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14 PKG_SOURCE_URL:=http://wiki.qemu-project.org/download/
15 PKG_SOURCE_MD5SUM:=bdf1f3d0c177ebeb35a079a4bc3fc74e
16 PKG_LICENSE:=GPL-2.0
17 PKG_LICENSE_FILES:=LICENSE tcg/LICENSE
18 PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
19
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/uclibc++.mk
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/qemu-ga
26 SECTION:=utils
27 CATEGORY:=Utilities
28 TITLE:=QEMU Guest Agent
29 URL:=http://www.qemu.org
30 DEPENDS:=+glib2 +libpthread $(CXX_DEPENDS) +librt
31 endef
32
33 define Package/qemu-ga/description
34 This package contains the QEMU Guest Agent daemon
35 endef
36
37 PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_qemu-ga
38
39 # QEMU configure script does not recognize these options
40 CONFIGURE_ARGS:=$(filter-out \
41 --target=% \
42 --host=% \
43 --build=% \
44 --program-prefix=% \
45 --program-suffix=% \
46 --exec-prefix=% \
47 --disable-nls \
48 , $(CONFIGURE_ARGS))
49
50 # Building qemu-ga alone does not require zlib, pixman
51 #
52 # --disable-tools to disable building pixman which will fail at the moment on
53 # octeon mips64 target.
54 CONFIGURE_ARGS += \
55 --cross-prefix=$(TARGET_CROSS) \
56 --host-cc="$(HOSTCC)" \
57 --target-list='' \
58 --disable-docs \
59 --disable-zlib-test \
60 --disable-tools \
61 --without-pixman \
62
63 ifneq ($(CONFIG_PACKAGE_qemu-ga),)
64 CONFIGURE_ARGS += --enable-guest-agent
65 endif
66
67 MAKE_VARS += V=s
68
69 define Build/Compile
70 $(if $(CONFIG_PACKAGE_qemu-ga),$(call Build/Compile/Default,qemu-ga))
71 endef
72
73 define Package/qemu-ga/install
74 $(INSTALL_DIR) $(1)/usr/bin
75 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qemu-ga $(1)/usr/bin
76 $(INSTALL_DIR) $(1)/etc/init.d
77 $(INSTALL_BIN) ./files/qemu-ga.init $(1)/etc/init.d/qemu-ga
78 $(INSTALL_DIR) $(1)/etc/hotplug.d/virtio-ports
79 $(INSTALL_BIN) ./files/virtio-ports.hotplug $(1)/etc/hotplug.d/virtio-ports/qemu-ga
80 endef
81
82 $(eval $(call BuildPackage,qemu-ga))