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
8 AC_TRY_RUN([#include <sys/types.h>
12 exit(!(stat ("conftestdata", &s) == 0 && utimes("conftestdata", (long *)0) == 0
13 && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
14 && t.st_mtime - s.st_mtime < 120));
15 }], ac_cv_func_utimes_null=yes, ac_cv_func_utimes_null=no,
16 ac_cv_func_utimes_null=no)
17 rm -f core core.* *.core])
19 if test $ac_cv_func_utimes_null = yes; then
21 # This code is deliberately never run via ./configure.
22 # FIXME: this is a hack to make autoheader put the corresponding
23 # HAVE_* undef for this symbol in config.h.in. This saves me the
24 # trouble of having to maintain the #undef in acconfig.h manually.
25 AC_CHECK_FUNCS(UTIMES_NULL)
27 # Defining it this way (rather than via AC_DEFINE) short-circuits the
28 # autoheader check -- autoheader doesn't know it's already been taken
29 # care of by the hack above.
30 ac_kludge=HAVE_UTIMES_NULL
31 AC_DEFINE_UNQUOTED($ac_kludge)