build: don't change locale on smartos · nodejs/node@78c7d66
@@ -672,7 +672,10 @@ def get_xcode_version(cc):
672672def get_gas_version(cc):
673673 try:
674674 custom_env = os.environ.copy()
675- custom_env["LC_ALL"] = "en_US"
675+# smartos (a.k.a. sunos5) does not have the en_US locale, and will give:
676+# `setlocale: LC_ALL: cannot change locale (en_US): Invalid argument`
677+if 'sunos' not in sys.platform:
678+ custom_env["LC_ALL"] = "en_US"
676679 proc = subprocess.Popen(shlex.split(cc) + ['-Wa,-v', '-c', '-o',
677680'/dev/null', '-x',
678681'assembler', '/dev/null'],
@@ -685,12 +688,13 @@ def get_gas_version(cc):
685688 consider adjusting the CC environment variable if you installed
686689 it in a non-standard prefix.''')
687690688-match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)",
689- proc.communicate()[1])
691+gas_ret = proc.communicate()[1]
692+match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret)
690693691694if match:
692695return match.group(1)
693696 else:
697+ warn('Could not recognize `gas`: ' + gas_ret)
694698return '0'
695699696700# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes