2 # Copyright (C) 2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
13 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
14 PKG_SOURCE_URL
:=http
://wiki.qemu-project.org
/download
/
15 PKG_SOURCE_MD5SUM
:=bdf1f3d0c177ebeb35a079a4bc3fc74e
17 PKG_LICENSE_FILES
:=LICENSE tcg
/LICENSE
18 PKG_MAINTAINER
:=Yousong Zhou
<yszhou4tech@gmail.com
>
23 include $(INCLUDE_DIR
)/uclibc
++.mk
24 include $(INCLUDE_DIR
)/package.mk
26 define Package
/qemu-ga
29 TITLE
:=QEMU Guest Agent
30 URL
:=http
://www.qemu.org
31 DEPENDS
:= +glib2
$(CXX_DEPENDS
)
34 define Package
/qemu-ga
/description
35 This package contains the QEMU Guest Agent daemon
38 define Package
/qemu-ga
/install
39 $(INSTALL_DIR
) $(1)/usr
/bin
40 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/qemu-ga
$(1)/usr
/bin
41 $(INSTALL_DIR
) $(1)/etc
/init.d
42 $(INSTALL_BIN
) .
/files
/qemu-ga.init
$(1)/etc
/init.d
/qemu-ga
43 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/virtio-ports
44 $(INSTALL_BIN
) .
/files
/virtio-ports.hotplug
$(1)/etc
/hotplug.d
/virtio-ports
/qemu-ga
47 define Package
/qemu-blobs
50 TITLE
:=QEMU blobs of BIOS
, VGA BIOS and keymaps
51 URL
:=http
://www.qemu.org
55 define Package
/qemu-blobs
/install
56 $(INSTALL_DIR
) $(1)/usr
/share
/qemu
57 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/qemu
/* $(1)/usr
/share
/qemu
60 define Package
/qemu-bridge-helper
63 TITLE
:=QEMU bridge helper
64 URL
:=http
://www.qemu.org
65 DEPENDS
:=+glib2
$(CXX_DEPENDS
)
68 define Package
/qemu-bridge-helper
/install
69 $(INSTALL_DIR
) $(1)/usr
/lib
/
70 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/qemu-bridge-helper
$(1)/usr
/lib
71 $(INSTALL_DIR
) $(1)/etc
/qemu
72 $(INSTALL_DATA
) .
/files
/bridge.conf
$(1)/etc
/qemu
75 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_qemu-ga
77 # Naming rules used in qemu Makefile.target
79 $(if
$(filter %-softmmu
,$(1)), \
80 $(patsubst %-softmmu
,qemu-system-
%,$(1)), \
81 $(error unknown qemu target
$(1)) \
84 qemu-prog
= $(strip $(call qemu-prog_
,$(1)))
86 # Why libfdt was enabled for all softmmu targets: according to qemu's
87 # configure script, libfdt is only strictly required for the following targets
88 # and is optional for others. But libfdt support will be built into other
89 # targets when any single target enabled it.
91 # aarch64%-softmmu arm%-softmmu ppc%-softmmu microblaze%-softmmu
94 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_qemu-
$(1)
96 define Package
/qemu-
$(1)
99 TITLE
:=QEMU target
$(1)
100 URL
:=http
://www.qemu.org
101 DEPENDS
:= +glib2
+libpthread
+zlib
$(CXX_DEPENDS
) \
102 $(if
$(filter %-softmmu
,$(1)),+libncurses
+libfdt
+qemu-blobs
) \
103 @
(TARGET_x86_64||TARGET_sunxi
)
106 define Package
/qemu-
$(1)/description
107 This package contains the QEMU target
$(1)
110 define Package
/qemu-
$(1)/install
111 $(INSTALL_DIR
) $$(1)/usr
/bin
112 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$(call qemu-prog
,$(1)) $$(1)/usr
/bin
117 QEMU_TARGET_LIST
:= \
121 $(foreach target
,$(QEMU_TARGET_LIST
), \
122 $(eval
$(call qemu-target
,$(target
))) \
125 # QEMU configure script does not recognize these options
126 CONFIGURE_ARGS
:=$(filter-out \
136 # Tell build system of qemu to not add _FORTIFY_SOURCE options and let the base
137 # build system decide flavor of fortify_source to use
139 --cross-prefix
=$(TARGET_CROSS
) \
140 --host-cc
="$(HOSTCC)" \
141 --disable-fortify-source \
142 --disable-stack-protector \
145 --audio-drv-list
='' \
146 --disable-debug-info \
149 --disable-qom-cast-debug \
152 --disable-debug-tcg \
162 --disable-xen-pci-passthrough \
163 --disable-xen-pv-domain-build \
166 --disable-tcg-interpreter \
174 --disable-linux-aio \
180 --disable-smartcard \
182 --disable-usb-redir \
183 --disable-zlib-test \
187 --disable-guest-agent-msi \
190 --disable-glusterfs \
191 --disable-archipelago \
198 --disable-virglrenderer \
208 QEMU_CONFIGURE_TARGET_LIST
:= $(foreach target
,$(QEMU_TARGET_LIST
),$(if
$(CONFIG_PACKAGE_qemu-
$(target
)),$(target
)))
209 CONFIGURE_ARGS
+= --target-list
='$(QEMU_CONFIGURE_TARGET_LIST)'
211 ifneq ($(CONFIG_PACKAGE_qemu-ga
),)
212 CONFIGURE_ARGS
+= --enable-guest-agent
215 TARGET_LDFLAGS
+= -Wl
,--as-needed
217 # ARCH is special in qemu's build system, e.g. ARCH mips64 will be translated
218 # there to mips and stored in config-host.mak
219 MAKE_FLAGS
:=$(filter-out \
223 QEMU_MAKE_TARGETS
:= \
224 $(if
$(CONFIG_PACKAGE_qemu-ga
),qemu-ga
) \
225 $(if
$(CONFIG_PACKAGE_qemu-bridge-helper
),qemu-bridge-helper
) \
226 $(foreach target
,$(QEMU_TARGET_LIST
),$(if
$(CONFIG_PACKAGE_qemu-
$(target
)),subdir-
$(target
))) \
229 $(if
$(strip $(QEMU_MAKE_TARGETS
)),$(call Build
/Compile
/Default
,$(QEMU_MAKE_TARGETS
)))
232 $(eval
$(call BuildPackage
,qemu-ga
))
233 $(eval
$(call BuildPackage
,qemu-bridge-helper
))
234 $(eval
$(call BuildPackage
,qemu-blobs
))
235 $(foreach target
,$(QEMU_TARGET_LIST
), \
236 $(eval
$(call BuildPackage
,qemu-
$(target
))) \