3 # Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
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)
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.
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. */
19 # Written by Paul Eggert.
23 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
24 AC_DEFUN([gl_HOST_OS],
26 AC_CACHE_CHECK([host operating system],
27 gl_cv_host_operating_system,
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';;
35 sysv*) os='Unix System V';;
36 superux*) os='SUPER-UX';;
40 riscos*) os='RISC OS';;
41 riscix*) os='RISCiX';;
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';;
59 lynxos*) os='LynxOS';;
60 linux*) os='GNU/Linux';;
64 freebsd*) os='FreeBSD';;
70 atheos*) os='AtheOS';;
71 amigaos*) os='Amiga OS';;
74 # The default heuristic takes the initial alphabetic string
75 # from $host_os, but capitalizes its first letter.
78 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
80 expr "X$host_os" : 'X.\([A-Za-z]*\)'
84 # If $host_os does not start with an alphabetic string, use it unchanged.
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.])