Skip to content

Commit

Permalink
build: don't change locale on smartos
Browse files Browse the repository at this point in the history
PR-URL: #21220
Fixes: nodejs/build#1327
Refs: #20394
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
refack authored and targos committed Jun 13, 2018
1 parent 2655c7b commit 78c7d66
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,10 @@ def get_xcode_version(cc):
def get_gas_version(cc):
try:
custom_env = os.environ.copy()
custom_env["LC_ALL"] = "en_US"
# smartos (a.k.a. sunos5) does not have the en_US locale, and will give:
# `setlocale: LC_ALL: cannot change locale (en_US): Invalid argument`
if 'sunos' not in sys.platform:
custom_env["LC_ALL"] = "en_US"
proc = subprocess.Popen(shlex.split(cc) + ['-Wa,-v', '-c', '-o',
'/dev/null', '-x',
'assembler', '/dev/null'],
Expand All @@ -685,12 +688,13 @@ def get_gas_version(cc):
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.''')

match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)",
proc.communicate()[1])
gas_ret = proc.communicate()[1]
match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret)

if match:
return match.group(1)
else:
warn('Could not recognize `gas`: ' + gas_ret)
return '0'

# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes
Expand Down

0 comments on commit 78c7d66

Please sign in to comment.