Change uses of sys.platform == 'linux2' to
sys.platform.startswith('linux')
Although the current method is valid up till python 3.3 (which is not supported) this seems to be a clearer way of checking for linux and moves the tests towards python 3 compatibility. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220534 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
79578cd14f
commit
5636e63563
@ -367,7 +367,7 @@ class Configuration(object):
|
|||||||
# Configure extra compiler flags.
|
# Configure extra compiler flags.
|
||||||
self.compile_flags += ['-I' + self.src_root + '/include',
|
self.compile_flags += ['-I' + self.src_root + '/include',
|
||||||
'-I' + self.src_root + '/test/support']
|
'-I' + self.src_root + '/test/support']
|
||||||
if sys.platform == 'linux2':
|
if sys.platform.startswith('linux'):
|
||||||
self.compile_flags += ['-D__STDC_FORMAT_MACROS',
|
self.compile_flags += ['-D__STDC_FORMAT_MACROS',
|
||||||
'-D__STDC_LIMIT_MACROS',
|
'-D__STDC_LIMIT_MACROS',
|
||||||
'-D__STDC_CONSTANT_MACROS']
|
'-D__STDC_CONSTANT_MACROS']
|
||||||
@ -402,7 +402,7 @@ class Configuration(object):
|
|||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
self.link_flags += ['-lSystem']
|
self.link_flags += ['-lSystem']
|
||||||
elif sys.platform == 'linux2':
|
elif sys.platform.startswith('linux'):
|
||||||
self.link_flags += ['-lgcc_eh', '-lc', '-lm', '-lpthread',
|
self.link_flags += ['-lgcc_eh', '-lc', '-lm', '-lpthread',
|
||||||
'-lrt', '-lgcc_s']
|
'-lrt', '-lgcc_s']
|
||||||
elif sys.platform.startswith('freebsd'):
|
elif sys.platform.startswith('freebsd'):
|
||||||
@ -431,7 +431,7 @@ class Configuration(object):
|
|||||||
san = self.get_lit_conf('llvm_use_sanitizer', '').strip()
|
san = self.get_lit_conf('llvm_use_sanitizer', '').strip()
|
||||||
if san:
|
if san:
|
||||||
self.compile_flags += ['-fno-omit-frame-pointer']
|
self.compile_flags += ['-fno-omit-frame-pointer']
|
||||||
if sys.platform == 'linux2':
|
if sys.platform.startswith('linux'):
|
||||||
self.link_flags += ['-ldl']
|
self.link_flags += ['-ldl']
|
||||||
if san == 'Address':
|
if san == 'Address':
|
||||||
self.compile_flags += ['-fsanitize=address']
|
self.compile_flags += ['-fsanitize=address']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user