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~