Dactyloidae/security/nss/coreconf/check_cc.py

27 lines
761 B
Python
Raw Normal View History

#!/usr/bin/env python
import os
import subprocess
import sys
def main():
if sys.platform == 'win32' or len(sys.argv) < 2:
2026-06-29 21:29:25 +01:00
print((0))
else:
cc = os.environ.get('CC', 'cc')
try:
2026-06-29 21:29:25 +01:00
if sys.argv[1] == "cc":
cc_output = subprocess.check_output(
[cc, '--version'], universal_newlines=True)
cc_is_arg = "cc" in cc_output and not ("gcc" in cc_output)
else:
cc_is_arg = sys.argv[1] in subprocess.check_output(
[cc, '--version'], universal_newlines=True)
except OSError:
# We probably just don't have CC/cc.
cc_is_arg = False
2026-06-29 21:29:25 +01:00
print((int(cc_is_arg)))
if __name__ == '__main__':
main()