~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to m4/gettimeofday.m4

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# serial 17
 
1
# serial 20
2
2
 
3
 
# Copyright (C) 2001-2003, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
 
3
# Copyright (C) 2001-2003, 2005, 2007, 2009-2012 Free Software Foundation, Inc.
4
4
# This file is free software; the Free Software Foundation
5
5
# gives unlimited permission to copy and/or distribute it,
6
6
# with or without modifications, as long as this notice is preserved.
50
50
    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
51
51
      REPLACE_GETTIMEOFDAY=1
52
52
    fi
 
53
    dnl If we override 'struct timeval', we also have to override gettimeofday.
 
54
    if test $REPLACE_STRUCT_TIMEVAL = 1; then
 
55
      REPLACE_GETTIMEOFDAY=1
 
56
    fi
53
57
    m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
54
58
      gl_FUNC_TZSET_CLOBBER
55
 
      if test $gl_cv_func_tzset_clobber = yes; then
56
 
        REPLACE_GETTIMEOFDAY=1
57
 
        gl_GETTIMEOFDAY_REPLACE_LOCALTIME
58
 
        AC_DEFINE([tzset], [rpl_tzset],
59
 
          [Define to rpl_tzset if the wrapper function should be used.])
60
 
        AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
61
 
          [Define if tzset clobbers localtime's static buffer.])
62
 
      fi
 
59
      case "$gl_cv_func_tzset_clobber" in
 
60
        *yes)
 
61
          REPLACE_GETTIMEOFDAY=1
 
62
          gl_GETTIMEOFDAY_REPLACE_LOCALTIME
 
63
          AC_DEFINE([tzset], [rpl_tzset],
 
64
            [Define to rpl_tzset if the wrapper function should be used.])
 
65
          AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
 
66
            [Define if tzset clobbers localtime's static buffer.])
 
67
          ;;
 
68
      esac
63
69
    ])
64
70
  fi
65
71
  AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
78
84
AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
79
85
[
80
86
 AC_REQUIRE([gl_HEADER_SYS_TIME_H])
 
87
 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
81
88
 
82
89
 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
83
90
  [gl_cv_func_gettimeofday_clobber],
100
107
        ]])],
101
108
     [gl_cv_func_gettimeofday_clobber=no],
102
109
     [gl_cv_func_gettimeofday_clobber=yes],
103
 
     dnl When crosscompiling, assume it is broken.
104
 
     [gl_cv_func_gettimeofday_clobber=yes])])
 
110
     [# When cross-compiling:
 
111
      case "$host_os" in
 
112
                # Guess all is fine on glibc systems.
 
113
        *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
 
114
                # If we don't know, assume the worst.
 
115
        *)      gl_cv_func_gettimeofday_clobber="guessing yes" ;;
 
116
      esac
 
117
     ])])
105
118
 
106
 
 if test $gl_cv_func_gettimeofday_clobber = yes; then
107
 
   REPLACE_GETTIMEOFDAY=1
108
 
   gl_GETTIMEOFDAY_REPLACE_LOCALTIME
109
 
   AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
110
 
     [Define if gettimeofday clobbers the localtime buffer.])
111
 
 fi
 
119
 case "$gl_cv_func_gettimeofday_clobber" in
 
120
   *yes)
 
121
     REPLACE_GETTIMEOFDAY=1
 
122
     gl_GETTIMEOFDAY_REPLACE_LOCALTIME
 
123
     AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
 
124
       [Define if gettimeofday clobbers the localtime buffer.])
 
125
     ;;
 
126
 esac
112
127
])
113
128
 
114
129
AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [