@@ -335,6 +335,10 @@ subdir-dtc:dtc/libfdt dtc/tests
dtc/%:
mkdir -p $@
+# ??? Overriding CFLAGS causes us to lose defines added in the sub-makefile.
+subdir-capstone:
+ $(call quiet-command,$(MAKE) -C $(SRC_PATH)/capstone CAPSTONE_SHARED=no BUILDDIR="$(BUILD_DIR)/capstone" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) $(BUILD_DIR)/capstone/libcapstone.a)
+
$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \
$(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
@@ -34,3 +34,6 @@
[submodule "roms/QemuMacDrivers"]
path = roms/QemuMacDrivers
url = git://git.qemu.org/QemuMacDrivers.git
+[submodule "capstone"]
+ path = capstone
+ url = https://github.com/aquynh/capstone.git
new file mode 160000
@@ -0,0 +1 @@
+Subproject commit a279481dbfd54bb1e2336d771e89978cc6d43176
@@ -4378,7 +4378,14 @@ fi
# capstone
if test "$capstone" != no; then
- if $pkg_config capstone; then
+ if test -d ${source_path}/capstone ; then
+ # have submodule capstone - use it
+ capstone=yes
+ capstone_internal=yes
+ mkdir -p capstone
+ QEMU_CFLAGS="$QEMU_CFLAGS -I\$(SRC_PATH)/capstone/include"
+ LIBS="\$(BUILD_DIR)/capstone/libcapstone.a $LIBS"
+ elif $pkg_config capstone; then
capstone=yes
QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags capstone)"
LIBS="$($pkg_config --libs capstone) $LIBS"
@@ -6577,6 +6584,9 @@ done # for target in $targets
if [ "$dtc_internal" = "yes" ]; then
echo "config-host.h: subdir-dtc" >> $config_host_mak
fi
+if [ "$capstone_internal" = "yes" ]; then
+ echo "config-host.h: subdir-capstone" >> $config_host_mak
+fi
if test "$numa" = "yes"; then
echo "CONFIG_NUMA=y" >> $config_host_mak
Do not require the submodule, but use it if present (in preference even to a system copy). This will allow us to easily use capstone in older systems for which a package is not available, and also easily track bug fixes from upstream. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- Makefile | 4 ++++ .gitmodules | 3 +++ capstone | 1 + configure | 12 +++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 160000 capstone -- 2.13.5