File: arch.py

package info (click to toggle)
fs-uae 3.2.35-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,376 kB
  • sloc: cpp: 257,557; ansic: 121,965; sh: 4,895; makefile: 1,577; python: 446; asm: 275; xml: 10
file content (19 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3
import sys
import platform
machine = platform.machine().lower()
if machine in ["x86_64", "amd64", "i386", "i486", "i585", "i686"]:
    if platform.architecture()[0] == "32bit":
        print("x86")
        sys.exit(0)
    if platform.architecture()[0] == "64bit":
        print("x86-64")
        sys.exit(0)
if machine.startswith("power"):
    if platform.architecture()[0] == "32bit":
        print("PPC")
        sys.exit(0)
if machine == "arm64":
    print("ARM64")
    sys.exit(0)
raise Exception(f"Unknown platform for machine {machine}")