On 18/12/20 12:57, Alex Bennée wrote:

Paolo Bonzini <pbonz...@redhat.com> writes:

On 17/12/20 18:56, Alex Bennée wrote:
To be honest at the moment the information is a little hidden at the top
of the output. It would be nice if we could teach meson to echo it in
it's nice coloured output.

Paolo,

Any ideas for the cleanest way to do that?

The code in configure is pretty small:

(for i in $cross_cc_vars; do
    export $i
done
export target_list source_path use_containers
$source_path/tests/tcg/configure.sh)

configure would place the cross-cc variables (which are really just
command line options) in a file, something like config-cross-cc.mak, and
the Meson translation of the above would be

env = environment()
foreach k, v : keyval.load(meson.current_build_dir() /
'config-cross-cc.mak')
    env.set(k, v)
endforeach
env.set('target_list', ','.join(target_dirs))
env.set('source_path', meson.source_root())
env.set('use_containers',
          'CROSS_CC_CONTAINERS' in config_host ? 'yes' : 'no')
message(run_command(files('tests/tcg/configure.sh'), env: env).stdout())

For a bit more polish, one could make tests/tcg/configure.sh print the
result in keyval format, parse it back from meson as a dictionary with
keyval.load(), and pass the result to summary().

Don't we already have this in the form of tests/tcg/config-$TARGET.mak?
Shouldn't we just injest that into meson after configure.sh has run?

Yes, that's also a possibility I guess! We can also do both (use run_command, and then reread tests/tcg/config-$TARGET.mak). Long term, I'd like to run tests/tcg/configure.sh separately for each target so that we can reuse it for pc-bios.

Paolo


Reply via email to