genconfig: undef bool options so #ifdef works
Instead of always defining config values, only #define options that are enabled, so that #ifdef/#ifndef can be used. Generate #undef lines for the disabled variables so the names are still visible in config.h. Change-Id: Iaf56597ea6ae57b384387cc8a292d63960b611e4 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
2a2615ec6e
commit
806eb493ca
@ -24,10 +24,9 @@ with open('CONFIG') as f:
|
|||||||
val = argval
|
val = argval
|
||||||
if default.lower() == 'y' or default.lower() == 'n':
|
if default.lower() == 'y' or default.lower() == 'n':
|
||||||
if val.lower() == 'y':
|
if val.lower() == 'y':
|
||||||
boolval = 1
|
print "#define SPDK_{} 1".format(var)
|
||||||
else:
|
else:
|
||||||
boolval = 0
|
print "#undef SPDK_{}".format(var)
|
||||||
print "#define SPDK_{} {}".format(var, boolval)
|
|
||||||
else:
|
else:
|
||||||
strval = val.replace('"', '\"')
|
strval = val.replace('"', '\"')
|
||||||
print "#define SPDK_{} \"{}\"".format(var, strval)
|
print "#define SPDK_{} \"{}\"".format(var, strval)
|
||||||
|
Loading…
Reference in New Issue
Block a user