1 # sys_utsname_h.m4 serial 8
2 dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl Written by Bruno Haible.
9 AC_DEFUN([gl_SYS_UTSNAME_H],
11 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12 dnl once only, before all statements that occur in other macros.
13 AC_REQUIRE([gl_SYS_UTSNAME_H_DEFAULTS])
15 dnl <sys/utsname.h> is always overridden, because of GNULIB_POSIXCHECK.
16 gl_CHECK_NEXT_HEADERS([sys/utsname.h])
17 if test $ac_cv_header_sys_utsname_h != yes; then
22 AC_CHECK_TYPES([struct utsname], [], [HAVE_STRUCT_UTSNAME=0], [[
23 /* Minix 3.1.8 has a bug: <stddef.h> must be included before
26 #include <sys/utsname.h>
29 AC_SUBST([HAVE_SYS_UTSNAME_H])
31 dnl Check for declarations of anything we want to poison if the
32 dnl corresponding gnulib module is not in use.
33 gl_WARN_ON_USE_PREPARE([[
34 /* Minix 3.1.8 has a bug: <stddef.h> must be included before
37 #include <sys/utsname.h>
41 AC_DEFUN([gl_SYS_UTSNAME_MODULE_INDICATOR],
43 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
44 AC_REQUIRE([gl_SYS_UTSNAME_H_DEFAULTS])
45 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
48 AC_DEFUN([gl_SYS_UTSNAME_H_DEFAULTS],
50 GNULIB_UNAME=0; AC_SUBST([GNULIB_UNAME])
51 dnl Assume proper GNU behavior unless another module says otherwise.
52 HAVE_UNAME=1; AC_SUBST([HAVE_UNAME])
53 HAVE_STRUCT_UTSNAME=1; AC_SUBST([HAVE_STRUCT_UTSNAME])