Commit 806eb493 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 2a2615ec
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -24,10 +24,9 @@ with open('CONFIG') as f:
                            val = argval
                if default.lower() == 'y' or default.lower() == 'n':
                    if val.lower() == 'y':
                        boolval = 1
                        print "#define SPDK_{} 1".format(var)
                    else:
                        boolval = 0
                    print "#define SPDK_{} {}".format(var, boolval)
                        print "#undef SPDK_{}".format(var)
                else:
                    strval = val.replace('"', '\"')
                    print "#define SPDK_{} \"{}\"".format(var, strval)