3 # Copyright (C) 2001, 2003, 2004 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.
8 # Written by Paul Eggert.
12 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
13 AC_DEFUN([gl_HOST_OS],
15 AC_CACHE_CHECK([host operating system],
16 gl_cv_host_operating_system,
20 # These operating system names do not use the default heuristic below.
21 # They are in reverse order, so that more-specific prefixes come first.
22 winnt*) os='Windows NT';;
24 sysv*) os='Unix System V';;
25 superux*) os='SUPER-UX';;
29 riscos*) os='RISC OS';;
30 riscix*) os='RISCiX';;
37 openbsd*) os='OpenBSD';;
38 nsk*) os='NonStop Kernel';;
39 nonstopux*) os='NonStop-UX';;
40 netbsd*-gnu*) os='GNU/NetBSD';; # NetBSD kernel+libc, GNU userland
41 netbsd*) os='NetBSD';;
42 knetbsd*-gnu) os='GNU/kNetBSD';; # NetBSD kernel, GNU libc+userland
43 kfreebsd*-gnu) os='GNU/kFreeBSD';; # FreeBSD kernel, GNU libc+userland
44 msdosdjgpp*) os='DJGPP';;
48 lynxos*) os='LynxOS';;
49 linux*) os='GNU/Linux';;
53 freebsd*) os='FreeBSD';;
59 atheos*) os='AtheOS';;
60 amigaos*) os='Amiga OS';;
63 # The default heuristic takes the initial alphabetic string
64 # from $host_os, but capitalizes its first letter.
67 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
69 expr "X$host_os" : 'X.\([A-Za-z]*\)'
73 # If $host_os does not start with an alphabetic string, use it unchanged.
77 gl_cv_host_operating_system=$os]])
78 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
79 "$gl_cv_host_operating_system",
80 [The host operating system.])