~ubuntu-branches/ubuntu/natty/diffutils/natty

« back to all changes in this revision

Viewing changes to m4/st_mtim.m4

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2010-05-04 20:38:00 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100504203800-f67xd9rsa9xl9qqj
Tags: 1:3.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#serial 5
2
 
 
3
 
dnl From Paul Eggert.
4
 
 
5
 
# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
6
 
# if it exists.
7
 
 
8
 
AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
9
 
 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
10
 
   ac_cv_struct_st_mtim_nsec,
11
 
   [ac_save_CPPFLAGS="$CPPFLAGS"
12
 
    ac_cv_struct_st_mtim_nsec=no
13
 
    # tv_nsec -- the usual case
14
 
    # _tv_nsec -- Solaris 2.6, if
15
 
    #   (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
16
 
    #    && !defined __EXTENSIONS__)
17
 
    # st__tim.tv_nsec -- UnixWare 2.1.2
18
 
    for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
19
 
      CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
20
 
      AC_TRY_COMPILE([#include <sys/types.h>
21
 
#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
22
 
        [ac_cv_struct_st_mtim_nsec=$ac_val; break])
23
 
    done
24
 
    CPPFLAGS="$ac_save_CPPFLAGS"])
25
 
 
26
 
  if test $ac_cv_struct_st_mtim_nsec != no; then
27
 
    AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
28
 
      [Define to be the nanoseconds member of struct stat's st_mtim,
29
 
   if it exists.])
30
 
  fi
31
 
 ]
32
 
)