diff options
author | lloyd <[email protected]> | 2013-11-28 17:14:25 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-11-28 17:14:25 +0000 |
commit | c6b01f12d2bb7f9d781cbb65c717b9d0ef0efa61 (patch) | |
tree | 9fbd9ca3750d8e53d3f264619a7d099a7f481f6a /configure.py | |
parent | 1250f37fdf54d9380b7de0446c5e648842978494 (diff) |
Give everything setting a feature test macro in build.h a version code
so application code can check for the specific API it expects without
having to keep track of what versions APIs x,y,z changed. Arbitrarily
set all current API versions to 20131128.
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/configure.py b/configure.py index 2d91c4188..ec8705215 100755 --- a/configure.py +++ b/configure.py @@ -41,6 +41,10 @@ import botan_version def flatten(l): return sum(l, []) +def chunks(l, n): + for i in xrange(0, len(l), n): + yield l[i:i+n] + def is_official_release(): # Assume a release date implies official release return (botan_version.release_datestamp > 20130000) @@ -507,12 +511,14 @@ def lex_me_harder(infofile, to_obj, allowed_groups, name_val_pairs): lexer.lineno) elif token in name_val_pairs.keys(): - next_val = lexer.get_token() - if type(to_obj.__dict__[token]) is list: - to_obj.__dict__[token].append(next_val) + to_obj.__dict__[token].append(lexer.get_token()) + + # Dirty hack + if token == 'define': + to_obj.__dict__[token].append(lexer.get_token()) else: - to_obj.__dict__[token] = next_val + to_obj.__dict__[token] = lexer.get_token() else: # No match -> error raise LexerError('Bad token "%s"' % (token), lexer.lineno) @@ -614,7 +620,7 @@ class ModuleInfo(object): return self.header_internal def defines(self): - return ['HAS_' + d for d in self.define] + return ['HAS_' + d[0] + ' ' + d[1] for d in chunks(self.define, 2)] def compatible_cpu(self, archinfo, options): |