Debian Codegraph @

m4/utime_h.m4

raw
1 # utime_h.m4 serial 8
2 dnl Copyright (C) 2017-2023 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.
6
7 dnl From Bruno Haible.
8
9 AC_DEFUN_ONCE([gl_UTIME_H],
10 [
11 AC_REQUIRE([gl_UTIME_H_DEFAULTS])
12 AC_REQUIRE([AC_CANONICAL_HOST])
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])
16
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])
23
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])
29 ])
30
31 # gl_UTIME_MODULE_INDICATOR([modulename])
32 # sets the shell variable that indicates the presence of the given module
33 # to a C preprocessor expression that will evaluate to 1.
34 # This macro invocation must not occur in macros that are AC_REQUIREd.
35 AC_DEFUN([gl_UTIME_MODULE_INDICATOR],
36 [
37 dnl Ensure to expand the default settings once only.
38 gl_UTIME_H_REQUIRE_DEFAULTS
39 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
40 dnl Define it also as a C macro, for the benefit of the unit tests.
41 gl_MODULE_INDICATOR_FOR_TESTS([$1])
42 ])
43
44 # Initializes the default values for AC_SUBSTed shell variables.
45 # This macro must not be AC_REQUIREd. It must only be invoked, and only
46 # outside of macros or in macros that are not AC_REQUIREd.
47 AC_DEFUN([gl_UTIME_H_REQUIRE_DEFAULTS],
48 [
49 m4_defun(GL_MODULE_INDICATOR_PREFIX[_UTIME_H_MODULE_INDICATOR_DEFAULTS], [
50 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIME])
51 dnl Support Microsoft deprecated alias function names by default.
52 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UTIME], [1])
53 ])
54 m4_require(GL_MODULE_INDICATOR_PREFIX[_UTIME_H_MODULE_INDICATOR_DEFAULTS])
55 AC_REQUIRE([gl_UTIME_H_DEFAULTS])
56 ])
57
58 AC_DEFUN([gl_UTIME_H_DEFAULTS],
59 [
60 dnl Assume POSIX behavior unless another module says otherwise.
61 HAVE_UTIME=1; AC_SUBST([HAVE_UTIME])
62 REPLACE_UTIME=0; AC_SUBST([REPLACE_UTIME])
63 ])