2 # Copyright (C) 2016 OpenWrt.org
3 # Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=http
://wiki.qemu-project.org
/download
/
16 PKG_SOURCE_MD5SUM
:=bdf1f3d0c177ebeb35a079a4bc3fc74e
18 PKG_LICENSE_FILES
:=LICENSE tcg
/LICENSE
19 PKG_MAINTAINER
:=Yousong Zhou
<yszhou4tech@gmail.com
>
24 include $(INCLUDE_DIR
)/uclibc
++.mk
25 include $(INCLUDE_DIR
)/package.mk
28 define Package
/virtio-console-helper
31 TITLE
:=Helper script for vportNpn virtio-console devices
34 define Package
/virtio-console-helper
/install
35 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/virtio-ports
36 $(INSTALL_BIN
) .
/files
/00-virtio-ports.hotplug
$(1)/etc
/hotplug.d
/virtio-ports
/00-virtio-ports
40 define Package
/qemu-ga
43 TITLE
:=QEMU Guest Agent
44 URL
:=http
://www.qemu.org
45 DEPENDS
:= +glib2
+virtio-console-helper
$(CXX_DEPENDS
)
48 define Package
/qemu-ga
/description
49 This package contains the QEMU Guest Agent daemon
52 define Package
/qemu-ga
/install
53 $(INSTALL_DIR
) $(1)/usr
/bin
54 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/qemu-ga
$(1)/usr
/bin
55 $(INSTALL_DIR
) $(1)/etc
/init.d
56 $(INSTALL_BIN
) .
/files
/qemu-ga.init
$(1)/etc
/init.d
/qemu-ga
57 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/virtio-ports
58 $(INSTALL_BIN
) .
/files
/10-qemu-ga.hotplug
$(1)/etc
/hotplug.d
/virtio-ports
/10-qemu-ga
62 define Package
/qemu-blobs
65 TITLE
:=QEMU blobs of BIOS
, VGA BIOS and keymaps
66 URL
:=http
://www.qemu.org
70 define Package
/qemu-blobs
/install
71 $(INSTALL_DIR
) $(1)/usr
/share
/qemu
72 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/qemu
/* $(1)/usr
/share
/qemu
75 define Package
/qemu-bridge-helper
78 TITLE
:=QEMU bridge helper
79 URL
:=http
://www.qemu.org
80 DEPENDS
:=+glib2
$(CXX_DEPENDS
)
83 define Package
/qemu-bridge-helper
/install
84 $(INSTALL_DIR
) $(1)/usr
/lib
/
85 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/lib
/qemu-bridge-helper
$(1)/usr
/lib
86 $(INSTALL_DIR
) $(1)/etc
/qemu
87 $(INSTALL_DATA
) .
/files
/bridge.conf
$(1)/etc
/qemu
90 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_qemu-ga
92 # Naming rules used in qemu Makefile.target
94 $(if
$(filter %-softmmu
,$(1)), \
95 $(patsubst %-softmmu
,qemu-system-
%,$(1)), \
96 $(error unknown qemu target
$(1)) \
99 qemu-prog
= $(strip $(call qemu-prog_
,$(1)))
101 # Why libfdt was enabled for all softmmu targets: according to qemu's
102 # configure script, libfdt is only strictly required for the following targets
103 # and is optional for others. But libfdt support will be built into other
104 # targets when any single target enabled it.
106 # aarch64%-softmmu arm%-softmmu ppc%-softmmu microblaze%-softmmu
109 PKG_CONFIG_DEPENDS
+= CONFIG_PACKAGE_qemu-
$(1)
111 define Package
/qemu-
$(1)
114 TITLE
:=QEMU target
$(1)
115 URL
:=http
://www.qemu.org
116 DEPENDS
:= +glib2
+libpthread
+zlib
$(CXX_DEPENDS
) \
117 $(if
$(filter %-softmmu
,$(1)),+libncurses
+libfdt
+qemu-blobs
) \
118 @
(TARGET_x86_64||TARGET_sunxi
)
121 define Package
/qemu-
$(1)/description
122 This package contains the QEMU target
$(1)
125 define Package
/qemu-
$(1)/install
126 $(INSTALL_DIR
) $$(1)/usr
/bin
127 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$(call qemu-prog
,$(1)) $$(1)/usr
/bin
132 QEMU_TARGET_LIST
:= \
136 $(foreach target
,$(QEMU_TARGET_LIST
), \
137 $(eval
$(call qemu-target
,$(target
))) \
140 # QEMU configure script does not recognize these options
141 CONFIGURE_ARGS
:=$(filter-out \
151 # Tell build system of qemu to not add _FORTIFY_SOURCE options and let the base
152 # build system decide flavor of fortify_source to use
154 --cross-prefix
=$(TARGET_CROSS
) \
155 --host-cc
="$(HOSTCC)" \
156 --disable-fortify-source \
157 --disable-stack-protector \
160 --audio-drv-list
='' \
161 --disable-debug-info \
164 --disable-qom-cast-debug \
167 --disable-debug-tcg \
177 --disable-xen-pci-passthrough \
178 --disable-xen-pv-domain-build \
181 --disable-tcg-interpreter \
189 --disable-linux-aio \
195 --disable-smartcard \
197 --disable-usb-redir \
198 --disable-zlib-test \
202 --disable-guest-agent-msi \
205 --disable-glusterfs \
206 --disable-archipelago \
213 --disable-virglrenderer \
223 QEMU_CONFIGURE_TARGET_LIST
:= $(foreach target
,$(QEMU_TARGET_LIST
),$(if
$(CONFIG_PACKAGE_qemu-
$(target
)),$(target
)))
224 CONFIGURE_ARGS
+= --target-list
='$(QEMU_CONFIGURE_TARGET_LIST)'
226 ifneq ($(CONFIG_PACKAGE_qemu-ga
),)
227 CONFIGURE_ARGS
+= --enable-guest-agent
230 TARGET_LDFLAGS
+= -Wl
,--as-needed
232 # ARCH is special in qemu's build system, e.g. ARCH mips64 will be translated
233 # there to mips and stored in config-host.mak
234 MAKE_FLAGS
:=$(filter-out \
238 QEMU_MAKE_TARGETS
:= \
239 $(if
$(CONFIG_PACKAGE_qemu-ga
),qemu-ga
) \
240 $(if
$(CONFIG_PACKAGE_qemu-bridge-helper
),qemu-bridge-helper
) \
241 $(foreach target
,$(QEMU_TARGET_LIST
),$(if
$(CONFIG_PACKAGE_qemu-
$(target
)),subdir-
$(target
))) \
244 $(if
$(strip $(QEMU_MAKE_TARGETS
)),$(call Build
/Compile
/Default
,$(QEMU_MAKE_TARGETS
)))
247 $(eval
$(call BuildPackage
,virtio-console-helper
))
248 $(eval
$(call BuildPackage
,qemu-ga
))
249 $(eval
$(call BuildPackage
,qemu-bridge-helper
))
250 $(eval
$(call BuildPackage
,qemu-blobs
))
251 $(foreach target
,$(QEMU_TARGET_LIST
), \
252 $(eval
$(call BuildPackage
,qemu-
$(target
))) \