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):