aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2020-09-13 12:19:25 -0700
committerRichard Henderson <richard.henderson@linaro.org>2020-10-03 04:22:47 -0500
commit8b18cdbfd6c7add5fb8dae5c81596c381fe6e237 (patch)
treecacce97e4b33e00419be35a74d23e54dd71fc1ae /configure
parentdd8c1e808f1ca311e1f50bff218c3ee3198b1f02 (diff)
downloadqemu-8b18cdbfd6c7add5fb8dae5c81596c381fe6e237.zip
qemu-8b18cdbfd6c7add5fb8dae5c81596c381fe6e237.tar.gz
qemu-8b18cdbfd6c7add5fb8dae5c81596c381fe6e237.tar.bz2
capstone: Convert Makefile bits to meson bits
There are better ways to do this, e.g. meson cmake subproject, but that requires cmake 3.7 and some of our CI environments only provide cmake 3.5. Nor can we add a meson.build file to capstone/, because the git submodule would then always report "untracked files". Fixing that would require creating our own branch on the qemu git mirror, at which point we could just as easily create a native meson subproject. Instead, build the library via the main meson.build. This improves the current state of affairs in that we will re-link the qemu executables against a changed libcapstone.a, which we wouldn't do before-hand. In addition, the use of the configuration header file instead of command-line -DEFINES means that we will rebuild the capstone objects with changes to meson.build. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure68
1 files changed, 9 insertions, 59 deletions
diff --git a/configure b/configure
index a584124..f46f433 100755
--- a/configure
+++ b/configure
@@ -478,7 +478,7 @@ opengl=""
opengl_dmabuf="no"
cpuid_h="no"
avx2_opt=""
-capstone=""
+capstone="auto"
lzo=""
snappy=""
bzip2=""
@@ -1575,11 +1575,11 @@ for opt do
;;
--enable-vhost-kernel) vhost_kernel="yes"
;;
- --disable-capstone) capstone="no"
+ --disable-capstone) capstone="disabled"
;;
- --enable-capstone) capstone="yes"
+ --enable-capstone) capstone="enabled"
;;
- --enable-capstone=git) capstone="git"
+ --enable-capstone=git) capstone="internal"
;;
--enable-capstone=system) capstone="system"
;;
@@ -5017,51 +5017,11 @@ fi
# capstone
case "$capstone" in
- "" | yes)
- if $pkg_config capstone; then
- capstone=system
- elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
- capstone=git
- elif test -e "${source_path}/capstone/Makefile" ; then
- capstone=internal
- elif test -z "$capstone" ; then
- capstone=no
- else
- feature_not_found "capstone" "Install capstone devel or git submodule"
- fi
- ;;
-
- system)
- if ! $pkg_config capstone; then
- feature_not_found "capstone" "Install capstone devel"
- fi
- ;;
-esac
-
-case "$capstone" in
- git | internal)
- if test "$capstone" = git; then
+ auto | enabled | internal)
+ # Simpler to always update submodule, even if not needed.
+ if test -e "${source_path}/.git" && test $git_update = 'yes' ; then
git_submodules="${git_submodules} capstone"
fi
- mkdir -p capstone
- if test "$mingw32" = "yes"; then
- LIBCAPSTONE=capstone.lib
- else
- LIBCAPSTONE=libcapstone.a
- fi
- capstone_libs="-Lcapstone -lcapstone"
- capstone_cflags="-I${source_path}/capstone/include"
- ;;
-
- system)
- capstone_libs="$($pkg_config --libs capstone)"
- capstone_cflags="$($pkg_config --cflags capstone)"
- ;;
-
- no)
- ;;
- *)
- error_exit "Unknown state for capstone: $capstone"
;;
esac
@@ -7142,11 +7102,6 @@ fi
if test "$ivshmem" = "yes" ; then
echo "CONFIG_IVSHMEM=y" >> $config_host_mak
fi
-if test "$capstone" != "no" ; then
- echo "CONFIG_CAPSTONE=y" >> $config_host_mak
- echo "CAPSTONE_CFLAGS=$capstone_cflags" >> $config_host_mak
- echo "CAPSTONE_LIBS=$capstone_libs" >> $config_host_mak
-fi
if test "$debug_mutex" = "yes" ; then
echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
fi
@@ -7664,13 +7619,7 @@ done # for target in $targets
if [ "$fdt" = "git" ]; then
subdirs="$subdirs dtc"
fi
-if [ "$capstone" = "git" -o "$capstone" = "internal" ]; then
- subdirs="$subdirs capstone"
-fi
echo "SUBDIRS=$subdirs" >> $config_host_mak
-if test -n "$LIBCAPSTONE"; then
- echo "LIBCAPSTONE=$LIBCAPSTONE" >> $config_host_mak
-fi
if test "$numa" = "yes"; then
echo "CONFIG_NUMA=y" >> $config_host_mak
@@ -7846,7 +7795,8 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \
-Dmalloc=$malloc -Dmalloc_trim=$malloc_trim \
-Dcocoa=$cocoa -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
- -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f\
+ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f \
+ -Dcapstone=$capstone \
$cross_arg \
"$PWD" "$source_path"