immutable: Add tests.
[gnulib.git] / m4 / utime_h.m4
blob6543db4c0a3097604a76fb44faf6f62673bfc42f
1 # utime_h.m4 serial 5
2 dnl Copyright (C) 2017-2021 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 From Bruno Haible.
9 AC_DEFUN([gl_UTIME_H],
11   AC_REQUIRE([AC_CANONICAL_HOST])
12   AC_REQUIRE([gl_UTIME_H_DEFAULTS])
13   m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
14   AC_CHECK_HEADERS_ONCE([utime.h])
15   gl_CHECK_NEXT_HEADERS([utime.h])
17   if test $ac_cv_header_utime_h = yes; then
18     HAVE_UTIME_H=1
19   else
20     HAVE_UTIME_H=0
21   fi
22   AC_SUBST([HAVE_UTIME_H])
24   dnl Check for declarations of anything we want to poison if the
25   dnl corresponding gnulib module is not in use.
26   gl_WARN_ON_USE_PREPARE([[#include <utime.h>
27     ]],
28     [utime])
31 AC_DEFUN([gl_UTIME_MODULE_INDICATOR],
33   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
34   AC_REQUIRE([gl_UTIME_H_DEFAULTS])
35   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
36   dnl Define it also as a C macro, for the benefit of the unit tests.
37   gl_MODULE_INDICATOR_FOR_TESTS([$1])
40 AC_DEFUN([gl_UTIME_H_DEFAULTS],
42   GNULIB_UTIME=0;            AC_SUBST([GNULIB_UTIME])
43   dnl Support Microsoft deprecated alias function names by default.
44   GNULIB_MDA_UTIME=1;        AC_SUBST([GNULIB_MDA_UTIME])
45   dnl Assume POSIX behavior unless another module says otherwise.
46   HAVE_UTIME=1;              AC_SUBST([HAVE_UTIME])
47   REPLACE_UTIME=0;           AC_SUBST([REPLACE_UTIME])