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

« back to all changes in this revision

Viewing changes to m4/calloc.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
 
# calloc.m4 serial 13
 
1
# calloc.m4 serial 15
2
2
 
3
 
# Copyright (C) 2004-2011 Free Software Foundation, Inc.
 
3
# Copyright (C) 2004-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.
14
14
 
15
15
# _AC_FUNC_CALLOC_IF([IF-WORKS], [IF-NOT])
16
16
# -------------------------------------
17
 
# If `calloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT.
 
17
# If 'calloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT.
18
18
AC_DEFUN([_AC_FUNC_CALLOC_IF],
19
19
[
20
20
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
21
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
21
22
  AC_CACHE_CHECK([for GNU libc compatible calloc],
22
23
    [ac_cv_func_calloc_0_nonnull],
23
24
    [AC_RUN_IFELSE(
32
33
          ]])],
33
34
       [ac_cv_func_calloc_0_nonnull=yes],
34
35
       [ac_cv_func_calloc_0_nonnull=no],
35
 
       [ac_cv_func_calloc_0_nonnull=no])])
36
 
  AS_IF([test $ac_cv_func_calloc_0_nonnull = yes], [$1], [$2])
 
36
       [case "$host_os" in
 
37
                  # Guess yes on glibc systems.
 
38
          *-gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
 
39
                  # If we don't know, assume the worst.
 
40
          *)      ac_cv_func_calloc_0_nonnull="guessing no" ;;
 
41
        esac
 
42
       ])])
 
43
  case "$ac_cv_func_calloc_0_nonnull" in
 
44
    *yes)
 
45
      $1
 
46
      ;;
 
47
    *)
 
48
      $2
 
49
      ;;
 
50
  esac
37
51
])# AC_FUNC_CALLOC
38
52
 
39
53
 
40
54
# gl_FUNC_CALLOC_GNU
41
55
# ------------------
42
 
# Report whether `calloc (0, 0)' is properly handled, and replace calloc if
 
56
# Report whether 'calloc (0, 0)' is properly handled, and replace calloc if
43
57
# needed.
44
58
AC_DEFUN([gl_FUNC_CALLOC_GNU],
45
59
[
46
60
  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
47
61
  _AC_FUNC_CALLOC_IF(
48
62
    [AC_DEFINE([HAVE_CALLOC_GNU], [1],
49
 
               [Define to 1 if your system has a GNU libc compatible `calloc'
 
63
               [Define to 1 if your system has a GNU libc compatible 'calloc'
50
64
                function, and to 0 otherwise.])],
51
65
    [AC_DEFINE([HAVE_CALLOC_GNU], [0])
52
66
     REPLACE_CALLOC=1