summaryrefslogtreecommitdiff
path: root/m4/ghc_convert_cpu.m4
blob: 880daee61e6f0aadcb50d5131f48d95f68883b9e (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# GHC_CONVERT_CPU(cpu, target_var)
# --------------------------------
# Converts cpu from gnu to ghc naming, and assigns the result to $target_var.
# Should you modify this list, you are invited to reflect the changes in
# `libraries/base/System/Info.hs`'s documentation.
AC_DEFUN([GHC_CONVERT_CPU],[
case "$1" in
  aarch64*|arm64*)
    $2="aarch64"
    ;;
  alpha*)
    $2="alpha"
    ;;
  arm*)
    $2="arm"
    ;;
  hppa1.1*)
    $2="hppa1_1"
    ;;
  hppa*)
    $2="hppa"
    ;;
  i386|i486|i586|i686)
    $2="i386"
    ;;
  ia64)
    $2="ia64"
    ;;
  m68k*)
    $2="m68k"
    ;;
  mipseb*)
    $2="mipseb"
    ;;
  mipsel*)
    $2="mipsel"
    ;;
  mips*)
    $2="mips"
    ;;
  nios2)
    $2="nios2"
    ;;
  powerpc64le*)
    $2="powerpc64le"
    ;;
  powerpc64*)
    $2="powerpc64"
    ;;
  powerpc*)
    $2="powerpc"
    ;;
  riscv64*)
    $2="riscv64"
    ;;
  riscv|riscv32*)
    $2="riscv32"
    ;;
  loongarch64*)
    $2="loongarch64"
    ;;
  loongarch32*)
    $2="loongarch32"
    ;;
  rs6000)
    $2="rs6000"
    ;;
  s390x*)
    $2="s390x"
    ;;
  s390*)
    $2="s390"
    ;;
  sh4)
    $2="sh4"
    ;;
  vax)
    $2="vax"
    ;;
  x86_64|amd64)
    $2="x86_64"
    ;;
  wasm32)
    $2="wasm32"
    ;;
  javascript)
    $2="javascript"
    ;;
  *)
    echo "Unknown CPU $1"
    exit 1
    ;;
  esac
])