2 dnl Copyright (C) 2017-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.
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
22 AC_SUBST([HAVE_UTIME_H])
24 m4_ifdef([gl_POSIXCHECK],
27 if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
28 dnl Override <utime.h> always, to support the C++ GNULIB_NAMESPACE.
31 if test $ac_cv_header_utime_h != yes; then
32 dnl Provide a substitute <utime.h> file.
36 mingw*) dnl Need special handling of 'struct utimbuf'.
44 AM_CONDITIONAL([GL_GENERATE_UTIME_H], [test -n "$UTIME_H"])
46 dnl Check for declarations of anything we want to poison if the
47 dnl corresponding gnulib module is not in use.
48 gl_WARN_ON_USE_PREPARE([[#include <utime.h>
53 AC_DEFUN([gl_UTIME_MODULE_INDICATOR],
55 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
56 AC_REQUIRE([gl_UTIME_H_DEFAULTS])
57 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
58 dnl Define it also as a C macro, for the benefit of the unit tests.
59 gl_MODULE_INDICATOR_FOR_TESTS([$1])
62 AC_DEFUN([gl_UTIME_H_DEFAULTS],
64 GNULIB_UTIME=0; AC_SUBST([GNULIB_UTIME])
65 dnl Assume POSIX behavior unless another module says otherwise.
66 HAVE_UTIME=1; AC_SUBST([HAVE_UTIME])
67 REPLACE_UTIME=0; AC_SUBST([REPLACE_UTIME])