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
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from buildconfig
import substs
10 def main(output
, *other_libs
):
12 # ar doesn't like it when the file exists beforehand.
13 os
.unlink(output
.name
)
15 parent
= os
.path
.dirname(output
.name
)
16 libs
.extend(os
.path
.join(parent
, l
) for l
in other_libs
)
18 result
= subprocess
.run(
19 [substs
["AR"]] + [f
.replace("$@", lib
) for f
in substs
["AR_FLAGS"]]
21 if result
.returncode
!= 0:
22 return result
.returncode