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

« back to all changes in this revision

Viewing changes to m4/ftruncate.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 19
 
2
 
 
3
# See if we need to emulate a missing ftruncate function using chsize.
 
4
 
 
5
# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
 
6
# This file is free software; the Free Software Foundation
 
7
# gives unlimited permission to copy and/or distribute it,
 
8
# with or without modifications, as long as this notice is preserved.
 
9
 
 
10
AC_DEFUN([gl_FUNC_FTRUNCATE],
 
11
[
 
12
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
 
13
  AC_CHECK_FUNCS_ONCE([ftruncate])
 
14
  if test $ac_cv_func_ftruncate = yes; then
 
15
    m4_ifdef([gl_LARGEFILE], [
 
16
      AC_REQUIRE([AC_CANONICAL_HOST])
 
17
      case "$host_os" in
 
18
        mingw*)
 
19
          dnl Native Windows, and Large File Support is requested.
 
20
          dnl The MSVCRT _chsize() function only accepts a 32-bit file size,
 
21
          dnl and the mingw64 ftruncate64() function is unreliable (it may
 
22
          dnl delete the file, see
 
23
          dnl <http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>).
 
24
          dnl Use gnulib's ftruncate() implementation instead.
 
25
          REPLACE_FTRUNCATE=1
 
26
          ;;
 
27
      esac
 
28
    ], [
 
29
      :
 
30
    ])
 
31
  else
 
32
    HAVE_FTRUNCATE=0
 
33
  fi
 
34
])
 
35
 
 
36
# Prerequisites of lib/ftruncate.c.
 
37
AC_DEFUN([gl_PREREQ_FTRUNCATE],
 
38
[
 
39
  AC_REQUIRE([AC_C_INLINE])
 
40
  AC_CHECK_FUNCS([chsize])
 
41
])