xref: /freebsd/contrib/kyua/m4/uname.m4 (revision 2e3f49888ec8851bafb22011533217487764fdb0)
1dnl Copyright 2010 The Kyua Authors.
2dnl All rights reserved.
3dnl
4dnl Redistribution and use in source and binary forms, with or without
5dnl modification, are permitted provided that the following conditions are
6dnl met:
7dnl
8dnl * Redistributions of source code must retain the above copyright
9dnl   notice, this list of conditions and the following disclaimer.
10dnl * Redistributions in binary form must reproduce the above copyright
11dnl   notice, this list of conditions and the following disclaimer in the
12dnl   documentation and/or other materials provided with the distribution.
13dnl * Neither the name of Google Inc. nor the names of its contributors
14dnl   may be used to endorse or promote products derived from this software
15dnl   without specific prior written permission.
16dnl
17dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29dnl
30dnl KYUA_UNAME_ARCHITECTURE
31dnl
32dnl Checks for the current architecture name (aka processor type) and defines
33dnl the KYUA_ARCHITECTURE macro to its value.
34dnl
35AC_DEFUN([KYUA_UNAME_ARCHITECTURE], [
36    AC_MSG_CHECKING([for architecture name])
37    AC_ARG_VAR([KYUA_ARCHITECTURE],
38               [Name of the system architecture (aka processor type)])
39    if test x"${KYUA_ARCHITECTURE-unset}" = x"unset"; then
40        KYUA_ARCHITECTURE="$(uname -p)"
41    fi
42    AC_DEFINE_UNQUOTED([KYUA_ARCHITECTURE], "${KYUA_ARCHITECTURE}",
43                       [Name of the system architecture (aka processor type)])
44    AC_MSG_RESULT([${KYUA_ARCHITECTURE}])
45])
46
47dnl
48dnl KYUA_UNAME_PLATFORM
49dnl
50dnl Checks for the current platform name (aka machine name) and defines
51dnl the KYUA_PLATFORM macro to its value.
52dnl
53AC_DEFUN([KYUA_UNAME_PLATFORM], [
54    AC_MSG_CHECKING([for platform name])
55    AC_ARG_VAR([KYUA_PLATFORM],
56               [Name of the system platform (aka machine name)])
57    if test x"${KYUA_PLATFORM-unset}" = x"unset"; then
58        KYUA_PLATFORM="$(uname -m)"
59    fi
60    AC_DEFINE_UNQUOTED([KYUA_PLATFORM], "${KYUA_PLATFORM}",
61                       [Name of the system platform (aka machine name)])
62    AC_MSG_RESULT([${KYUA_PLATFORM}])
63])
64