a53692d557a11c00714678e6d813ed9fe3dfa6e6
[gnulib.git] / m4 / host-os.m4
1 #serial 1
2
3 dnl From Paul Eggert.
4
5 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
6 AC_DEFUN([UTILS_HOST_OS],
7 [
8   AC_CACHE_CHECK([host operating system],
9     utils_cv_host_operating_system,
10
11     [[case $host_os in
12
13        # These operating system names do not use the default heuristic below.
14        # They are in reverse order, so that more-specific prefixes come first.
15        winnt*)          os='Windows NT';;
16        vos*)            os='VOS';;
17        sysv*)           os='Unix System V';;
18        superux*)        os='SUPER-UX';;
19        sunos*)          os='SunOS';;
20        stop*)           os='STOP';;
21        sco*)            os='SCO Unix';;
22        riscos*)         os='RISC OS';;
23        riscix*)         os='RISCiX';;
24        qnx*)            os='QNX';;
25        pw32*)           os='PW32';;
26        ptx*)            os='ptx';;
27        plan9*)          os='Plan 9';;
28        osf*)            os='Tru64';;
29        os2*)            os='OS/2';;
30        openbsd*)        os='OpenBSD';;
31        nsk*)            os='NonStop Kernel';;
32        nonstopux*)      os='NonStop-UX';;
33        netbsd*)         os='NetBSD';;
34        msdosdjgpp*)     os='DJGPP';;
35        mpeix*)          os='MPE/iX';;
36        mint*)           os='MiNT';;
37        mingw*)          os='MinGW';;
38        lynxos*)         os='LynxOS';;
39        linux*)          os='GNU/Linux';;
40        hpux*)           os='HP-UX';;
41        hiux*)           os='HI-UX';;
42        gnu*)            os='GNU';;
43        freebsd*)        os='FreeBSD';;
44        dgux*)           os='DG/UX';;
45        bsdi*)           os='BSD/OS';;
46        bsd*)            os='BSD';;
47        beos*)           os='BeOS';;
48        aux*)            os='A/UX';;
49        atheos*)         os='AtheOS';;
50        amigaos*)        os='Amiga OS';;
51        aix*)            os='AIX';;
52
53        # The default heuristic takes the initial alphabetic string
54        # from $host_os, but capitalizes its first letter.
55        [A-Za-z]*)
56          os=`
57            expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
58          ``
59            expr "X$host_os" : 'X.\([A-Za-z]*\)'
60          `
61          ;;
62
63        # If $host_os does not start with an alphabetic string, use it unchanged.
64        *)
65          os=$host_os;;
66      esac
67      utils_cv_host_operating_system=$os]])
68   AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
69     "$utils_cv_host_operating_system",
70     [The host operating system.])
71 ])