|
AS_CASE([$host], |
|
[[i[3456]86-*-linux*]], |
|
[arch=i386; system=linux_elf], |
|
[[i[3456]86-*-*bsd*]], |
|
[arch=i386; system=bsd_elf], |
|
[[i[3456]86-*-haiku*]], |
|
[arch=i386; system=beos], |
|
[[i[3456]86-*-cygwin]], |
|
[arch=i386; system=cygwin], |
|
[[i[3456]86-*-gnu*]], |
|
[arch=i386; system=gnu], |
|
[[i[3456]86-*-mingw32]], |
|
[arch=i386; system=mingw], |
|
[i686-pc-windows], |
|
[arch=i386; system=win32], |
|
[x86_64-pc-windows], |
|
[arch=amd64; system=win64], |
|
[[powerpc64le*-*-linux*]], |
|
[arch=power; model=ppc64le; system=elf], |
|
[[powerpc*-*-linux*]], |
|
[arch=power; AS_IF([$arch64],[model=ppc64],[model=ppc]); system=elf], |
|
[[s390x*-*-linux*]], |
|
[arch=s390x; model=z10; system=elf], |
|
# expected to match "gnueabihf" as well as "musleabihf" |
|
[armv6*-*-linux-*eabihf], |
|
[arch=arm; model=armv6; system=linux_eabihf], |
|
[armv7*-*-linux-*eabihf], |
|
[arch=arm; model=armv7; system=linux_eabihf], |
|
[armv8*-*-linux-*eabihf], |
|
[arch=arm; model=armv8; system=linux_eabihf], |
|
[armv8*-*-linux-*eabi], |
|
[arch=arm; model=armv8; system=linux_eabi], |
|
[armv7*-*-linux-*eabi], |
|
[arch=arm; model=armv7; system=linux_eabi], |
|
[armv6t2*-*-linux-*eabi], |
|
[arch=arm; model=armv6t2; system=linux_eabi], |
|
[armv6*-*-linux-*eabi], |
|
[arch=arm; model=armv6; system=linux_eabi], |
|
[armv6*-*-freebsd*], |
|
[arch=arm; model=armv6; system=freebsd], |
|
[earmv6*-*-netbsd*], |
|
[arch=arm; model=armv6; system=netbsd], |
|
[earmv7*-*-netbsd*], |
|
[arch=arm; model=armv7; system=netbsd], |
|
[armv5te*-*-linux-*eabi], |
|
[arch=arm; model=armv5te; system=linux_eabi], |
|
[armv5*-*-linux-*eabi], |
|
[arch=arm; model=armv5; system=linux_eabi], |
|
[arm*-*-linux-*eabihf], |
|
[arch=arm; system=linux_eabihf], |
|
[arm*-*-linux-*eabi], |
|
[arch=arm; system=linux_eabi], |
|
[arm*-*-openbsd*], |
|
[arch=arm; system=bsd], |
|
[zaurus*-*-openbsd*], |
|
[arch=arm; system=bsd], |
|
[x86_64-*-linux*], |
|
[arch=amd64; system=linux], |
|
[x86_64-*-gnu*], |
|
[arch=amd64; system=gnu], |
|
[x86_64-*-dragonfly*], |
|
[arch=amd64; system=dragonfly], |
|
[x86_64-*-solaris*], |
|
[arch=amd64; system=solaris], |
|
[x86_64-*-freebsd*], |
|
[arch=amd64; system=freebsd], |
|
[x86_64-*-netbsd*], |
|
[arch=amd64; system=netbsd], |
|
[x86_64-*-openbsd*], |
|
[arch=amd64; system=openbsd], |
|
[x86_64-*-haiku*], |
|
[arch=amd64; system=beos], |
|
[arm64-*-darwin*], |
|
[arch=arm64; system=macosx], |
|
[aarch64-*-darwin*], |
|
[arch=arm64; system=macosx], |
|
[x86_64-*-darwin*], |
|
[arch=amd64; system=macosx], |
|
[x86_64-*-mingw32], |
|
[arch=amd64; system=mingw64], |
|
[aarch64-*-linux*], |
|
[arch=arm64; system=linux], |
|
[aarch64-*-freebsd*], |
|
[arch=arm64; system=freebsd], |
|
[x86_64-*-cygwin*], |
|
[arch=amd64; system=cygwin], |
|
[riscv64-*-linux*], |
|
[arch=riscv; model=riscv64; system=linux] |
|
) |
Currently, in OCaml code in the wild, people use the output of
ocamlc -configto detect the architecture and OS of the system they are on.However while debugging janestreet/core#145 I discovered that the variable
system, in particular, is not consistent and does not always return "linux" on linux systems for example.This pattern of using the
systemvariable to detect the OS is especially prevalent in dune where there is no other builtin way to get this information (see ocaml/dune#4895).In addition of fixing dune and other build systems with similar issues (I believe
oasis, back in the days, also used thesystemvariable: https://github.com/ocaml/oasis/blob/master/setup.ml#L4133), I think it would be nice to make the variable more consistent. e.g.linuxbsd_elfandbsdasbsdopenbsd(currently it's split betweenbsdandopenbsddepending on the architecture)win32andwin64into one (not sure which name it should have, but having thesystemvariable carry the same information as thearchitecturevariable doesn't seem right to me)mingwandmingw64(cc @dra27 who probably has ideas about windows)See
ocaml/configure.ac
Lines 1044 to 1132 in 1252351
system