Fix formula.
[gnulib.git] / m4 / stat-time.m4
index 89a7aa4..353de21 100644 (file)
@@ -1,6 +1,8 @@
 # Checks for stat-related time functions.
 
-# Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2001, 2003, 2005, 2006, 2007 Free Software
+# Foundation, Inc.
+
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,10 +17,9 @@ dnl From Paul Eggert.
 
 AC_DEFUN([gl_STAT_TIME],
 [
-  AC_LIBSOURCES([stat-time.h])
-
   AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_HEADERS_ONCE([sys/time.h])
 
   AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
     [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
@@ -26,17 +27,11 @@ AC_DEFUN([gl_STAT_TIME],
        [AC_TRY_COMPILE(
          [
            #include <sys/types.h>
-           #if TIME_WITH_SYS_TIME
+           #include <sys/stat.h>
+           #if HAVE_SYS_TIME_H
            # include <sys/time.h>
-           # include <time.h>
-           #else
-           # if HAVE_SYS_TIME_H
-           #  include <sys/time.h>
-           # else
-           #  include <time.h>
-           # endif
            #endif
-           #include <sys/stat.h>
+           #include <time.h>
            struct timespec ts;
            struct stat st;
          ],