From bf90317ad14dde82f16a0f0f3d2561d38ac970ff Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 4 Dec 2013 18:57:29 +0100 Subject: build: remove execute kwarg to check_cc when cross-compiling This prevents waf from running test programs after compilation. A better approach would be to only remove this option if the check actually errors, but we are using this only for Lua anyway. --- waftools/checks/custom.py | 2 +- waftools/checks/generic.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py index fee56134b4..09a5c01018 100644 --- a/waftools/checks/custom.py +++ b/waftools/checks/custom.py @@ -61,7 +61,7 @@ def check_lua(ctx, dependency_identifier): [lv for lv in lua_versions if lv[0] == ctx.options.LUA_VER] for lua_version, pkgconfig_query in lua_versions: - if compose_checks( + if compose_checks( check_pkg_config(pkgconfig_query, uselib_store=lua_version), check_cc(fragment=fragment, use=[lua_version] + quvi_lib_storage, diff --git a/waftools/checks/generic.py b/waftools/checks/generic.py index 65145ef635..4867b2f355 100644 --- a/waftools/checks/generic.py +++ b/waftools/checks/generic.py @@ -1,6 +1,7 @@ import os from inflectors import DependencyInflector from waflib.ConfigSet import ConfigSet +from waflib import Utils __all__ = [ "check_pkg_config", "check_cc", "check_statement", "check_libs", @@ -21,6 +22,12 @@ def __merge_options__(dependency_identifier, *args): [options_accu.update(arg) for arg in args if arg] return options_accu +def _filter_cc_arguments(ctx, opts): + if ctx.env.DEST_OS != Utils.unversioned_sys_platform(): + # cross compiling, remove execute=True if present + if opts['execute'] == True: + opts['execute'] = False + return opts def check_libs(libs, function): libs = [None] + libs @@ -42,7 +49,7 @@ def check_statement(header, statement, **kw_ext): {'fragment':fragment}, __define_options__(dependency_identifier), kw_ext, kw) - return ctx.check_cc(**opts) + return ctx.check_cc(**_filter_cc_arguments(ctx, opts)) return fn def check_cc(**kw_ext): @@ -50,7 +57,7 @@ def check_cc(**kw_ext): options = __merge_options__(dependency_identifier, __define_options__(dependency_identifier), kw_ext, kw) - return ctx.check_cc(**options) + return ctx.check_cc(**_filter_cc_arguments(ctx, options)) return fn def check_pkg_config(*args, **kw_ext): -- cgit v1.2.3