Tizen 2.0 Release
[external/tizen-coreutils.git] / m4 / host-os.m4
1 #serial 6
2
3 # Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
7
8 # Written by Paul Eggert.
9
10 dnl From Paul Eggert.
11
12 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
13 AC_DEFUN([gl_HOST_OS],
14 [
15   AC_REQUIRE([AC_CANONICAL_HOST])dnl
16   AC_CACHE_CHECK([host operating system],
17     gl_cv_host_operating_system,
18
19     [[case $host_os in
20
21        # These operating system names do not use the default heuristic below.
22        # They are in reverse order, so that more-specific prefixes come first.
23        winnt*)          os='Windows NT';;
24        vos*)            os='VOS';;
25        sysv*)           os='Unix System V';;
26        superux*)        os='SUPER-UX';;
27        sunos*)          os='SunOS';;
28        stop*)           os='STOP';;
29        sco*)            os='SCO Unix';;
30        riscos*)         os='RISC OS';;
31        riscix*)         os='RISCiX';;
32        qnx*)            os='QNX';;
33        pw32*)           os='PW32';;
34        ptx*)            os='ptx';;
35        plan9*)          os='Plan 9';;
36        osf*)            os='Tru64';;
37        os2*)            os='OS/2';;
38        openbsd*)        os='OpenBSD';;
39        nsk*)            os='NonStop Kernel';;
40        nonstopux*)      os='NonStop-UX';;
41        netbsd*-gnu*)    os='GNU/NetBSD';; # NetBSD kernel+libc, GNU userland
42        netbsd*)         os='NetBSD';;
43        knetbsd*-gnu)    os='GNU/kNetBSD';; # NetBSD kernel, GNU libc+userland
44        kfreebsd*-gnu)   os='GNU/kFreeBSD';; # FreeBSD kernel, GNU libc+userland
45        msdosdjgpp*)     os='DJGPP';;
46        mpeix*)          os='MPE/iX';;
47        mint*)           os='MiNT';;
48        mingw*)          os='MinGW';;
49        lynxos*)         os='LynxOS';;
50        linux*)          os='GNU/Linux';;
51        hpux*)           os='HP-UX';;
52        hiux*)           os='HI-UX';;
53        gnu*)            os='GNU';;
54        freebsd*)        os='FreeBSD';;
55        dgux*)           os='DG/UX';;
56        bsdi*)           os='BSD/OS';;
57        bsd*)            os='BSD';;
58        beos*)           os='BeOS';;
59        aux*)            os='A/UX';;
60        atheos*)         os='AtheOS';;
61        amigaos*)        os='Amiga OS';;
62        aix*)            os='AIX';;
63
64        # The default heuristic takes the initial alphabetic string
65        # from $host_os, but capitalizes its first letter.
66        [A-Za-z]*)
67          os=`
68            expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
69          ``
70            expr "X$host_os" : 'X.\([A-Za-z]*\)'
71          `
72          ;;
73
74        # If $host_os does not start with an alphabetic string, use it unchanged.
75        *)
76          os=$host_os;;
77      esac
78      gl_cv_host_operating_system=$os]])
79   AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
80     "$gl_cv_host_operating_system",
81     [The host operating system.])
82 ])