From 0bb77f24fac0855533b855a8020e327b172742e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Mon, 26 Dec 2016 14:29:25 +0100 Subject: [PATCH] build: add (not) cross-compiled configure flags Adds --cross-compiling and --no-cross-compiling flags Fixes: https://github.com/nodejs/node/issues/10271 PR-URL: https://github.com/nodejs/node/pull/10287 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis --- configure | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configure b/configure index d33760dcf3..be38ff770e 100755 --- a/configure +++ b/configure @@ -79,6 +79,17 @@ parser.add_option('--dest-cpu', choices=valid_arch, help='CPU architecture to build for ({0})'.format(', '.join(valid_arch))) +parser.add_option('--cross-compiling', + action='store_true', + dest='cross_compiling', + default=None, + help='force build to be considered as cross compiled') +parser.add_option('--no-cross-compiling', + action='store_false', + dest='cross_compiling', + default=None, + help='force build to be considered as NOT cross compiled') + parser.add_option('--dest-os', action='store', dest='dest_os', @@ -725,7 +736,9 @@ def configure_node(o): o['variables']['target_arch'] = target_arch o['variables']['node_byteorder'] = sys.byteorder - cross_compiling = target_arch != host_arch + cross_compiling = (options.cross_compiling + if options.cross_compiling is not None + else target_arch != host_arch) want_snapshots = not options.without_snapshot o['variables']['want_separate_host_toolset'] = int( cross_compiling and want_snapshots)