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/.
8 from buildconfig
import substs
11 def main(output
, *other_libs
):
13 # ar doesn't like it when the file exists beforehand.
14 os
.unlink(output
.name
)
16 parent
= os
.path
.dirname(output
.name
)
17 libs
.extend(os
.path
.join(parent
, l
) for l
in other_libs
)
19 result
= subprocess
.run(
20 [substs
["AR"]] + [f
.replace("$@", lib
) for f
in substs
["AR_FLAGS"]]
22 if result
.returncode
!= 0:
23 return result
.returncode