Checks predefined macros using the C compiler command.
(cc=None)
| 1643 | |
| 1644 | |
| 1645 | def cc_macros(cc=None): |
| 1646 | """Checks predefined macros using the C compiler command.""" |
| 1647 | |
| 1648 | try: |
| 1649 | p = subprocess.Popen(shlex.split(cc or CC) + ['-dM', '-E', '-'], |
| 1650 | stdin=subprocess.PIPE, |
| 1651 | stdout=subprocess.PIPE, |
| 1652 | stderr=subprocess.PIPE) |
| 1653 | except OSError: |
| 1654 | error('''No acceptable C compiler found! |
| 1655 | |
| 1656 | Please make sure you have a C compiler installed on your system and/or |
| 1657 | consider adjusting the CC environment variable if you installed |
| 1658 | it in a non-standard prefix.''') |
| 1659 | |
| 1660 | with p: |
| 1661 | p.stdin.write(b'\n') |
| 1662 | out = to_utf8(p.communicate()[0]).split('\n') |
| 1663 | |
| 1664 | k = {} |
| 1665 | for line in out: |
| 1666 | lst = shlex.split(line) |
| 1667 | if len(lst) > 2: |
| 1668 | key = lst[1] |
| 1669 | val = lst[2] |
| 1670 | k[key] = val |
| 1671 | return k |
| 1672 | |
| 1673 | |
| 1674 | def is_arch_armv7(): |
no test coverage detected
searching dependent graphs…