tweak indentation
[gnulib.git] / m4 / utimes.m4
1 #serial 2
2
3 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL.
4
5 AC_DEFUN(jm_FUNC_UTIMES_NULL,
6 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
7 [rm -f conftestdata; > conftestdata
8 AC_TRY_RUN([
9 /* In case stat has been defined to rpl_stat, undef it here.  */
10 #undef stat
11 #include <sys/types.h>
12 #include <sys/stat.h>
13 main() {
14 struct stat s, t;
15 exit(!(stat ("conftestdata", &s) == 0 && utimes("conftestdata", (long *)0) == 0
16 && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
17 && t.st_mtime - s.st_mtime < 120));
18 }],
19   ac_cv_func_utimes_null=yes,
20   ac_cv_func_utimes_null=no,
21   ac_cv_func_utimes_null=no)
22 rm -f core core.* *.core])
23
24     if test $ac_cv_func_utimes_null = yes; then
25       if test x = y; then
26         # This code is deliberately never run via ./configure.
27         # FIXME: this is a hack to make autoheader put the corresponding
28         # HAVE_* undef for this symbol in config.h.in.  This saves me the
29         # trouble of having to maintain the #undef in acconfig.h manually.
30         AC_CHECK_FUNCS(UTIMES_NULL)
31       fi
32       # Defining it this way (rather than via AC_DEFINE) short-circuits the
33       # autoheader check -- autoheader doesn't know it's already been taken
34       # care of by the hack above.
35       ac_kludge=HAVE_UTIMES_NULL
36       AC_DEFINE_UNQUOTED($ac_kludge)
37     fi
38   ]
39 )