1#
2#  Copyright 2021 Northern.tech AS
3#
4#  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5#
6#  This program is free software; you can redistribute it and/or modify it
7#  under the terms of the GNU General Public License as published by the
8#  Free Software Foundation; version 3.
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
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
18#
19# To the extent this program is licensed as part of the Enterprise
20# versions of CFEngine, the applicable Commercial Open Source License
21# (COSL) may apply to this file if you as a licensee so wish it. See
22# included file COSL.txt.
23#
24#
25# OS kernels conditionals. Don't use those unless it is really needed (if code
26# depends on the *kernel* feature, and even then -- some kernel features are
27# shared by different kernels).
28#
29# Good example: use LINUX to select code which uses inotify and netlink sockets.
30# Bad example: use LINUX to select code which parses output of coreutils' ps(1).
31#
32AM_CONDITIONAL([LINUX], [test -n "`echo ${target_os} | grep linux`"])
33AM_CONDITIONAL([MACOSX], [test -n "`echo ${target_os} | grep darwin`"])
34AM_CONDITIONAL([SOLARIS], [test -n "`(echo ${target_os} | egrep 'solaris|sunos')`"])
35AM_CONDITIONAL([NT], [test -n "`(echo ${target_os} | egrep 'mingw|cygwin')`"])
36AM_CONDITIONAL([CYGWIN], [test -n "`(echo ${target_os} | egrep 'cygwin')`"])
37AM_CONDITIONAL([AIX], [test -n "`(echo ${target_os} | grep aix)`"])
38AM_CONDITIONAL([HPUX], [test -n "`(echo ${target_os} | egrep 'hpux|hp-ux')`"])
39AM_CONDITIONAL([FREEBSD], [test -n "`(echo ${target_os} | grep freebsd)`"])
40AM_CONDITIONAL([NETBSD], [test -n "`(echo ${target_os} | grep netbsd)`"])
41AM_CONDITIONAL([XNU], [test -n "`(echo ${target_os} | grep darwin)`"])
42