[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/11] capstone: Convert Makefile bits to meson bits
From: |
Richard Henderson |
Subject: |
Re: [PATCH 01/11] capstone: Convert Makefile bits to meson bits |
Date: |
Mon, 14 Sep 2020 09:23:34 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 9/14/20 6:28 AM, Paolo Bonzini wrote:
> We can simplify it further if we move the selection logic to
> meson.build. Here in configure the whole capstone stanza
> is replaced by
>
> capstone=auto
> ...
> case "$capstone" in
> auto|git)
> # 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
> test "$capstone" = git && capstone=internal
> ;;
> esac
Do we really need to keep testing $source/.git and $git_update?
Surely we can accumulate git_submodules and then do (or not do) something with
that at the end without all of the tests?
> and in meson.build:
>
> capstone = not_found
> build_internal_capstone = false
> if get_option('capstone') != 'no'
> if get_option('capstone') != 'internal'
> capstone = dependency('capstone',
> required: get_option('capstone') == 'system',
> method: 'pkg-config',
> static: enable_static)
> endif
> build_internal_capstone = not capstone.found()
> endif
> ...
> if build_internal_capstone
> ...
> capstone = declare_dependency(...)
> endif
This doesn't seem like it would do the right thing for capstone=auto,
--disable-git-update, and no system library. In that case auto should resolve
to no.
I don't think we can move this detection to meson until the definition of
CONFIG_CAPSTONE is under control of meson.
> +option('capstone', type: 'combo', value: 'auto',
> + choices: ['auto', 'system', 'internal', 'no'],
> + description: 'How to find the capstone library')
I can certainly change this. I presume this validates that the -Dcapstone=foo
value passed to meson is correct?
r~
- [PATCH 00/11] capstone + disassembler patches, Richard Henderson, 2020/09/13
- [PATCH 02/11] capstone: Update to upstream "next" branch, Richard Henderson, 2020/09/13
- [PATCH 03/11] disas: Move host asm annotations to tb_gen_code, Richard Henderson, 2020/09/13
- [PATCH 05/11] disas: Use qemu/bswap.h for bfd endian loads, Richard Henderson, 2020/09/13
- [PATCH 04/11] disas: Clean up CPUDebug initialization, Richard Henderson, 2020/09/13
- [PATCH 06/11] disas: Cleanup plugin_disas, Richard Henderson, 2020/09/13
- [PATCH 07/11] disas: Configure capstone for aarch64 host without libvixl, Richard Henderson, 2020/09/13