3 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL.
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
9 /* In case stat has been defined to rpl_stat, undef it here. */
11 #include <sys/types.h>
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));
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])
24 if test $ac_cv_func_utimes_null = yes; 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)
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)