Skip to content

Commit 1792470

Browse files
Stefan Budeanubnoordhuis
authored andcommitted
build: correctly detect clang version
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL. PR-URL: #5553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent e38e2a6 commit 1792470

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

configure

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def try_check_compiler(cc, lang):
441441
# Commands and regular expressions to obtain its version number are taken from
442442
# https://github.com/openssl/openssl/blob/OpenSSL_1_0_2-stable/crypto/sha/asm/sha512-x86_64.pl#L112-L129
443443
#
444-
def get_llvm_version(cc):
444+
def get_version_helper(cc, regexp):
445445
try:
446446
proc = subprocess.Popen(shlex.split(cc) + ['-v'], stdin=subprocess.PIPE,
447447
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
@@ -454,14 +454,20 @@ def get_llvm_version(cc):
454454
'''
455455
sys.exit()
456456

457-
match = re.search(r"(^clang version|based on LLVM) ([3-9]\.[0-9]+)",
458-
proc.communicate()[1])
457+
match = re.search(regexp, proc.communicate()[1])
459458

460459
if match:
461460