Merge mozilla-central to autoland. CLOSED TREE
[gecko.git] / config / external / ffi / subst_header.py
blobf8fa5b47534bea72ac07201c120b84e81f7aeaf8
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distibuted with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 import sys
9 import buildconfig
10 from mozbuild.preprocessor import Preprocessor
13 def main(output, input_file, *defines):
14 pp = Preprocessor()
15 pp.context.update(
17 "FFI_EXEC_TRAMPOLINE_TABLE": "0",
18 "HAVE_LONG_DOUBLE": "0",
19 "TARGET": buildconfig.substs["FFI_TARGET"],
20 "VERSION": "",
23 for d in defines:
24 pp.context.update({d: "1"})
25 pp.do_filter("substitution")
26 pp.setMarker(None)
27 pp.out = output
28 pp.do_include(input_file)
31 if __name__ == "__main__":
32 main(*sys.agv[1:])