s/KNetBSD/kNetBSD/g and s/KFreeBSD/kFreeBSD/g
[gnulib.git] / m4 / host-os.m4
1 #serial 4
2
3 # Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18
19 # Written by Paul Eggert.
20
21 dnl From Paul Eggert.
22
23 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
24 AC_DEFUN([gl_HOST_OS],
25 [
26   AC_CACHE_CHECK([host operating system],
27     gl_cv_host_operating_system,
28
29     [[case $host_os in
30
31        # These operating system names do not use the default heuristic below.
32        # They are in reverse order, so that more-specific prefixes come first.
33        winnt*)          os='Windows NT';;
34        vos*)            os='VOS';;
35        sysv*)           os='Unix System V';;
36        superux*)        os='SUPER-UX';;
37        sunos*)          os='SunOS';;
38        stop*)           os='STOP';;
39        sco*)            os='SCO Unix';;
40        riscos*)         os='RISC OS';;
41        riscix*)         os='RISCiX';;
42        qnx*)            os='QNX';;
43        pw32*)           os='PW32';;
44        ptx*)            os='ptx';;
45        plan9*)          os='Plan 9';;
46        osf*)            os='Tru64';;
47        os2*)            os='OS/2';;
48        openbsd*)        os='OpenBSD';;
49        nsk*)            os='NonStop Kernel';;
50        nonstopux*)      os='NonStop-UX';;
51        netbsd*-gnu*)    os='GNU/NetBSD';; # NetBSD kernel+libc, GNU userland
52        netbsd*)         os='NetBSD';;
53        knetbsd*-gnu)    os='GNU/kNetBSD';; # NetBSD kernel, GNU libc+userland
54        kfreebsd*-gnu)   os='GNU/kFreeBSD';; # FreeBSD kernel, GNU libc+userland
55        msdosdjgpp*)     os='DJGPP';;
56        mpeix*)          os='MPE/iX';;
57        mint*)           os='MiNT';;
58        mingw*)          os='MinGW';;
59        lynxos*)         os='LynxOS';;
60        linux*)          os='GNU/Linux';;
61        hpux*)           os='HP-UX';;
62        hiux*)           os='HI-UX';;
63        gnu*)            os='GNU';;
64        freebsd*)        os='FreeBSD';;
65        dgux*)           os='DG/UX';;
66        bsdi*)           os='BSD/OS';;
67        bsd*)            os='BSD';;
68        beos*)           os='BeOS';;
69        aux*)            os='A/UX';;
70        atheos*)         os='AtheOS';;
71        amigaos*)        os='Amiga OS';;
72        aix*)            os='AIX';;
73
74        # The default heuristic takes the initial alphabetic string
75        # from $host_os, but capitalizes its first letter.
76        [A-Za-z]*)
77          os=`
78            expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
79          ``
80            expr "X$host_os" : 'X.\([A-Za-z]*\)'
81          `
82          ;;
83
84        # If $host_os does not start with an alphabetic string, use it unchanged.
85        *)
86          os=$host_os;;
87      esac
88      gl_cv_host_operating_system=$os]])
89   AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
90     "$gl_cv_host_operating_system",
91     [The host operating system.])
92 ])