diff options
author | Andrei Sedoi <bsnote@gmail.com> | 2013-06-14 15:49:14 +0300 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-06-14 16:10:51 +0200 |
commit | acbdabb74b1b8484671fd3c44cd9eb9a7ea11f41 (patch) | |
tree | 82b9a0ff0261c6791f7e375df4b7c5fec832b9a2 | |
parent | 4bca631c1a5673c7d02cc25c2f1c8c329f385b9b (diff) | |
download | node-new-acbdabb74b1b8484671fd3c44cd9eb9a7ea11f41.tar.gz |
configure: fix cross-compilation host_arch_cc()
In case of cross-compilation host_arch_cc() function could return
target arch if CC was set to target arch compiler. Host arch
compiler should always be used in this case. This was broken
by commit 707863c.
-rwxr-xr-x | configure | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -296,11 +296,14 @@ def pkg_config(pkg): return (libs, cflags) -def cc_macros(): - """Checks predefined macros using the CC command.""" +def cc_macros(cc=None): + """Checks predefined macros using the C compiler command.""" + + if cc is None: + cc = CC try: - p = subprocess.Popen(shlex.split(CC) + ['-dM', '-E', '-'], + p = subprocess.Popen(shlex.split(cc) + ['-dM', '-E', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -375,7 +378,9 @@ def arm_hard_float_abi(): def host_arch_cc(): """Host architecture check using the CC command.""" - k = cc_macros() + # use 'cc', as CC may be set to a target arch compiler command + # in case of cross-compilation + k = cc_macros('cc') matchup = { '__x86_64__' : 'x64', |