build: fix 'ar' invocation when cross-compiling

This shouldn't use the host's 'ar' when building static libs. It only
worked until now because Linux 'ar' is usually built with PE support.

Couldn't confirm whether it works, because this dumb crap is just
broken when cross-compiling to mingw.
This commit is contained in:
wm4 2014-11-01 00:20:10 +01:00
parent 650b57cd6e
commit b66669ef2c
1 changed files with 3 additions and 1 deletions

View File

@ -833,15 +833,17 @@ def configure(ctx):
ctx.resetenv(ctx.options.variant)
ctx.check_waf_version(mini='1.8.1')
target = os.environ.get('TARGET')
(cc, pkg_config, windres) = ('cc', 'pkg-config', 'windres')
(cc, pkg_config, ar, windres) = ('cc', 'pkg-config', 'ar', 'windres')
if target:
cc = '-'.join([target, 'gcc'])
pkg_config = '-'.join([target, pkg_config])
ar = '-'.join([target, ar])
windres = '-'.join([target, windres])
ctx.find_program(cc, var='CC')
ctx.find_program(pkg_config, var='PKG_CONFIG')
ctx.find_program(ar, var='AR')
ctx.find_program('perl', var='BIN_PERL')
ctx.find_program('rst2man', var='RST2MAN', mandatory=False)
ctx.find_program('rst2pdf', var='RST2PDF', mandatory=False)