1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +00:00

core: unroll the utils.BITCOIN_ONLY constant in mpy-cross

This commit is contained in:
Pavol Rusnak 2019-08-22 20:18:26 +02:00
parent 4036f2243b
commit 8a61ef4f6e
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -23,7 +23,10 @@ def generate(env):
target = str(target[0])
source = str(source[0])
source_name = source.replace(env['source_dir'], '')
return '$MPY_CROSS -o %s -s %s %s' % (target, source_name, source)
# unroll the utils.BITCOIN_ONLY constant
btc_only = 'True' if env['bitcoin_only'] == '1' else 'False'
interim = "%s.i" % target[:-4] # replace .mpy with .i
return '$SED "s:utils\.BITCOIN_ONLY:%s:g" %s > %s && $MPY_CROSS -o %s -s %s %s' % (btc_only, source, interim, target, source_name, interim)
env['BUILDERS']['FrozenModule'] = SCons.Builder.Builder(
generator=generate_frozen_module,