Change uses of `sys.platform == 'linux2' to `sys.platform.startswith('linux')
authorEric Fiselier <eric@efcs.ca>
Thu, 23 Oct 2014 23:05:46 +0000 (23:05 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 23 Oct 2014 23:05:46 +0000 (23:05 +0000)
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.

llvm-svn: 220535

libcxxabi/test/lit.cfg

index c2f2e33..f6efacf 100644 (file)
@@ -201,7 +201,7 @@ if link_flags_str is None:
             link_flags += ['-lc++abi']
         if sys.platform == 'darwin':
             link_flags += ['-lSystem']
-        elif sys.platform == 'linux2':
+        elif sys.platform.startswith('linux'):
             if not llvm_unwinder:
                 link_flags += ['-lgcc_eh']
             link_flags += ['-lc', '-lm', '-lpthread']
@@ -227,7 +227,7 @@ san = lit_config.params.get('llvm_use_sanitizer', None)
 if san is None:
     san = getattr(config, 'llvm_use_sanitizer', None)
 if san:
-    if sys.platform == 'linux2':
+    if sys.platform.startswith('linux'):
         link_flags += ['-ldl']
     if san == 'Address':
         compile_flags += ['-fsanitize=address']
@@ -251,7 +251,7 @@ if san:
 exec_env = {}
 if sys.platform == 'darwin':
     exec_env['DYLD_LIBRARY_PATH'] = os.path.join(libcxxabi_obj_root, 'lib')
-elif sys.platform == 'linux2':
+elif sys.platform.startswith('linux'):
     link_flags += ['-Wl,-R', libcxxabi_obj_root + '/lib']
 else:
     lit_config.fatal("unrecognized system")