From: Ethan Mahintorabi Date: Thu, 29 Oct 2020 01:59:59 +0000 (-0700) Subject: This patch adds support for defining the ABC location at runtime instead of at compil... X-Git-Tag: working-ls180~215^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c36e7757c4a65c7dc32509534501bda4fb5e35e;p=yosys.git This patch adds support for defining the ABC location at runtime instead of at compile time. This is helpful in build systems like bazel which do not have stable locations for binaries or directories during the compilation phase. This change should be backwards compatible with the existing behavior. --- diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index ce50e9a5b..66ac6828f 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -1471,7 +1471,12 @@ struct AbcPass : public Pass { po_map.clear(); #ifdef ABCEXTERNAL - std::string exe_file = ABCEXTERNAL; + std::string exe_file; + if (std::getenv("ABC")) { + exe_file = std::getenv("ABC"); + } else { + exe_file = ABCEXTERNAL; + } #else std::string exe_file = proc_self_dirname() + proc_program_prefix() + "yosys-abc"; #endif