summaryrefslogtreecommitdiffstats
path: root/security/nss/coreconf/check_cc_clang.py
blob: 145ec0a72580f8ab0baf4c23dcff1a89db69b6f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python

import os
import subprocess
import sys

def main():
    if sys.platform == 'win32':
        print 0
    else:
        cc = os.environ.get('CC', 'cc')
        try:
            cc_is_clang = 'clang' in subprocess.check_output([cc, '--version'])
        except OSError:
            # We probably just don't have CC/cc.
            cc_is_clang = False
        print int(cc_is_clang)

if __name__ == '__main__':
    main()