scons: Don't use PROTOC for the protoc command and to flag its presence.
authorGabe Black <gabeblack@google.com>
Tue, 19 Nov 2019 00:00:22 +0000 (16:00 -0800)
committerGabe Black <gabeblack@google.com>
Thu, 21 Nov 2019 23:37:03 +0000 (23:37 +0000)
commitdc3c6eed1480bb8f1c3a3d193978de1b923f24a7
tree2c205e0a71eb8d8abd333e384f4ba753e95bc6a0
parent54e0a39b50b9bf53ebf21db59a000d76a59a8a6f
scons: Don't use PROTOC for the protoc command and to flag its presence.

Commands that blindly use PROTOC will try to execute "False" which is
very confusing for someone looking at the console output and error
messages. Instead, create a new environment setting HAVE_PROTOC which
is either true or false depending on if the protoc command exists and
passes muster.

Also, if there's an error running protoc, catch that and use it to
mark protoc as unavailable. The previous behavior was to supress errors
and just return an empty string instead, I assume with the expectation
that that would be an invalid version and fail later checks.

Change-Id: I1251b4e7e0e9894cdd3343e59498cc653b648b26
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22883
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
SConstruct