1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 # You can obtain one at http://mozilla.org/MPL/2.0/.
5 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
6 # vim: set filetype=python:
7 # This Source Code Form is subject to the terms of the Mozilla Public
8 # License, v. 2.0. If a copy of the MPL was not distibuted with this
9 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 from io
import StringIO
16 from mozbuild
.preprocessor
import Preprocessor
19 def main(output
, input_file
):
20 with
open(input_file
) as fh
:
21 if buildconfig
.substs
["EXPAND_LIBS_LIST_STYLE"] == "linkerscript":
24 assert line
.startswith('INPUT("')
25 assert line
.endswith('")')
26 return line
[len('INPUT("') : -len('")')]
28 objs
= [cleanup(l
.strip()) for l
in fh
.readlines()]
30 objs
= [l
.strip() for l
in fh
.readlines()]
34 pp
.do_include(os
.path
.join(buildconfig
.topobjdir
, "buildid.h"))
35 buildid
= pp
.context
["MOZ_BUILDID"]
36 output
.write('extern const char gToolkitBuildID[] = "%s";' % buildid
)
38 os
.path
.join("build", o
)
40 if os
.path
.splitext(os
.path
.basename(o
))[0] != "buildid"