Debian Codegraph @

m4/utime_h.m4

raw
1 # utime_h.m4
2 # serial 8
3 dnl Copyright (C) 2017-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl This file is offered as-is, without any warranty.
8
9 dnl From Bruno Haible.
10
11 AC_DEFUN_ONCE([gl_UTIME_H],
12 [
13 AC_REQUIRE([gl_UTIME_H_DEFAULTS])
14 AC_REQUIRE([AC_CANONICAL_HOST])
15 m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
16 AC_CHECK_HEADERS_ONCE([utime.h])
17 gl_CHECK_NEXT_HEADERS([utime.h])
18
19 if test $ac_cv_header_utime_h = yes; then
20 HAVE_UTIME_H=1
21 else
22 HAVE_UTIME_H=0
23 fi
24 AC_SUBST([HAVE_UTIME_H])
25
26 dnl Check for declarations of anything we want to poison if the
27 dnl corresponding gnulib module is not in use.
28 gl_WARN_ON_USE_PREPARE([[#include <utime.h>
29 ]],
30 [utime])
31 ])
32
33 # gl_UTIME_MODULE_INDICATOR([modulename])
34 # sets the shell variable that indicates the presence of the given module
35 # to a C preprocessor expression that will evaluate to 1.
36 # This macro invocation must not occur in macros that are AC_REQUIREd.
37 AC_DEFUN([gl_UTIME_MODULE_INDICATOR],
38 [
39 dnl Ensure to expand the default settings once only.
40 gl_UTIME_H_REQUIRE_DEFAULTS
41 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
42 dnl Define it also as a C macro, for the benefit of the unit tests.
43 gl_MODULE_INDICATOR_FOR_TESTS([$1])
44 ])
45
46 # Initializes the default values for AC_SUBSTed shell variables.
47 # This macro must not be AC_REQUIREd. It must only be invoked, and only
48 # outside of macros or in macros that are not AC_REQUIREd.
49 AC_DEFUN([gl_UTIME_H_REQUIRE_DEFAULTS],
50 [
51 m4_defun(GL_MODULE_INDICATOR_PREFIX[_UTIME_H_MODULE_INDICATOR_DEFAULTS], [
52 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIME])
53 dnl Support Microsoft deprecated alias function names by default.
54 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UTIME], [1])
55 ])
56 m4_require(GL_MODULE_INDICATOR_PREFIX[_UTIME_H_MODULE_INDICATOR_DEFAULTS])
57 AC_REQUIRE([gl_UTIME_H_DEFAULTS])
58 ])
59
60 AC_DEFUN([gl_UTIME_H_DEFAULTS],
61 [
62 dnl Assume POSIX behavior unless another module says otherwise.
63 HAVE_UTIME=1; AC_SUBST([HAVE_UTIME])
64 REPLACE_UTIME=0; AC_SUBST([REPLACE_UTIME])
65 ])