qemu-devel
[Top][All Lists]
Advanced

[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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]