1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/usr/bin/python3
# Architecture-specific long double formats for
# cross compilation
#
# This script expects two positional argument
# 1. the meson cross file
# 2. the DEB_HOST_ARCH architecture name
#
import configparser
import sys
class CaseSensitiveConfigParser(configparser.ConfigParser):
optionxform = staticmethod(str)
cross_file = CaseSensitiveConfigParser()
with open(sys.argv[1]) as f:
cross_file.read_file(f)
cross_file["properties"]["longdouble_format"] = repr(
{
"amd64": "INTEL_EXTENDED_16_BYTES_LE",
"arm64": "IEEE_QUAD_LE",
"armel": "IEEE_DOUBLE_LE",
"armhf": "IEEE_DOUBLE_LE",
"hppa": "IEEE_DOUBLE_BE",
"i386": "INTEL_EXTENDED_12_BYTES_LE",
"m68k": "MOTOROLA_EXTENDED_12_BYTES_BE",
"mips64el": "IEEE_QUAD_LE",
"ppc64": "IBM_DOUBLE_DOUBLE_BE",
"ppc64el": "IEEE_QUAD_LE",
"riscv64": "IEEE_QUAD_LE",
"s390x": "IEEE_QUAD_BE",
"sparc64": "IEEE_QUAD_BE",
}.get(sys.argv[2], "UNKNOWN")
)
with open(sys.argv[1], "w") as f:
cross_file.write(f)
|