~ubuntu-branches/ubuntu/vivid/diffutils/vivid

« back to all changes in this revision

Viewing changes to m4/mkstemp.m4

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2010-02-13 11:49:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100213114900-09lz8jx6wct52qp8
Tags: 1:2.9-1
* New upstream release, now under GPL version 3 or later.
* There is now a --tab-size option. Closes: #82923.
* Manpage for cmp describes exit status. Closes: #200614.
* Manpage for diff describes exit status. Closes: #228441, #473233.
* The file de.po is now more recent. Closes: #313686.
* Fixed bad sdiff behaviour. Closes: #320222.
* Added wdiff to Suggests. Closes: #324627.
* Fixed cmp behaviour regarding stdout and stderr. Closes: #356083.
* The file ru.po is now more recent. Closes: #409274.
* The file es.po is now more recent. Closes: #418005, #481708.
* The file nl.po is now more recent. Closes: #427370.
* Modified watch file to use http instead of ftp.
* Removed .comment section from executables.
* Added Homepage field to control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#serial 17
 
2
 
 
3
# Copyright (C) 2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
 
4
# This file is free software; the Free Software Foundation
 
5
# gives unlimited permission to copy and/or distribute it,
 
6
# with or without modifications, as long as this notice is preserved.
 
7
 
 
8
# On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
 
9
# silly limit that it can create no more than 26 files from a given template.
 
10
# Other systems lack mkstemp altogether.
 
11
# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create
 
12
# only 32 files per process.
 
13
# On systems like the above, arrange to use the replacement function.
 
14
AC_DEFUN([gl_FUNC_MKSTEMP],
 
15
[
 
16
  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
 
17
  AC_REQUIRE([AC_SYS_LARGEFILE])
 
18
 
 
19
  AC_CACHE_CHECK([for working mkstemp],
 
20
    [gl_cv_func_working_mkstemp],
 
21
    [
 
22
      mkdir conftest.mkstemp
 
23
      AC_RUN_IFELSE(
 
24
        [AC_LANG_PROGRAM(
 
25
          [AC_INCLUDES_DEFAULT],
 
26
          [[int i;
 
27
            off_t large = (off_t) 4294967295u;
 
28
            if (large < 0)
 
29
              large = 2147483647;
 
30
            for (i = 0; i < 70; i++)
 
31
              {
 
32
                char templ[] = "conftest.mkstemp/coXXXXXX";
 
33
                int (*mkstemp_function) (char *) = mkstemp;
 
34
                int fd = mkstemp_function (templ);
 
35
                if (fd < 0 || lseek (fd, large, SEEK_SET) != large)
 
36
                  return 1;
 
37
                close (fd);
 
38
              }
 
39
            return 0;]])],
 
40
        [gl_cv_func_working_mkstemp=yes],
 
41
        [gl_cv_func_working_mkstemp=no],
 
42
        [gl_cv_func_working_mkstemp=no])
 
43
      rm -rf conftest.mkstemp
 
44
    ])
 
45
 
 
46
  if test $gl_cv_func_working_mkstemp != yes; then
 
47
    REPLACE_MKSTEMP=1
 
48
    AC_LIBOBJ([mkstemp])
 
49
    gl_PREREQ_MKSTEMP
 
50
  fi
 
51
])
 
52
 
 
53
# Prerequisites of lib/mkstemp.c.
 
54
AC_DEFUN([gl_PREREQ_MKSTEMP],
 
55
[
 
56
])