~ubuntu-branches/ubuntu/raring/exif/raring

« back to all changes in this revision

Viewing changes to m4/size_max.m4

  • Committer: Bazaar Package Importer
  • Author(s): Emmanuel Bouthenot
  • Date: 2008-03-31 19:39:44 UTC
  • mfrom: (4.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080331193944-xndxlofl9m7h7a83
Tags: 0.6.15-5
* Adopt the package within pkg-phototools:
  - Set the Maintainer to the group
  - Add Frederic Peters and myself as Uploaders.
  - Add Vcs-Browser and Vcs-Git fields accordingly.
* debian/control:
  - Add a Homepage field.
  - Update Standards-Version to 3.7.3
  - Fix build dep version for libexif-dev.
  - Add build dep on quilt for patches extracted from package diff.
  - Add build dep on gettext for swedish translation.
* debian/copyright:
  - convert file to utf-8.
  - Point to LGPL-2 rather than just LGPL, which now points to
    LGPL-3.
* debian/rules
  - Fix autotools timestamp issues which causes FTBFS (closes: #445609)
  - Fix lintian 'clean error' warning.
* debian/patches
  - Extract swedish translation patch from package diff (cf. bug 397370).
  - Extract patch related to default ifd from package diff (cf. bug 428255).
  - Extract patch related to manpage improvements from package diff (cf.
    bugs 320497 and 321855).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# size_max.m4 serial 2
2
 
dnl Copyright (C) 2003 Free Software Foundation, Inc.
3
 
dnl This file is free software, distributed under the terms of the GNU
4
 
dnl General Public License.  As a special exception to the GNU General
5
 
dnl Public License, this file may be distributed as part of a program
6
 
dnl that contains a configuration script generated by Autoconf, under
7
 
dnl the same distribution terms as the rest of that program.
8
 
 
9
 
dnl From Bruno Haible.
10
 
 
11
 
AC_DEFUN([gl_SIZE_MAX],
12
 
[
13
 
  AC_CHECK_HEADERS(stdint.h)
14
 
  dnl First test whether the system already has SIZE_MAX.
15
 
  AC_MSG_CHECKING([for SIZE_MAX])
16
 
  result=
17
 
  AC_EGREP_CPP([Found it], [
18
 
#include <limits.h>
19
 
#if HAVE_STDINT_H
20
 
#include <stdint.h>
21
 
#endif
22
 
#ifdef SIZE_MAX
23
 
Found it
24
 
#endif
25
 
], result=yes)
26
 
  if test -z "$result"; then
27
 
    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
28
 
    dnl than the type 'unsigned long'.
29
 
    dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
30
 
    dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
31
 
    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
32
 
      [#include <stddef.h>], result=?)
33
 
    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
34
 
      [#include <stddef.h>], result=?)
35
 
    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
36
 
      [#include <stddef.h>], result=?)
37
 
    if test "$fits_in_uint" = 1; then
38
 
      dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
39
 
      dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
40
 
      AC_TRY_COMPILE([#include <stddef.h>
41
 
        extern size_t foo;
42
 
        extern unsigned long foo;
43
 
        ], [], fits_in_uint=0)
44
 
    fi
45
 
    if test -z "$result"; then
46
 
      if test "$fits_in_uint" = 1; then
47
 
        result="$res_hi$res_lo"U
48
 
      else
49
 
        result="$res_hi$res_lo"UL
50
 
      fi
51
 
    else
52
 
      dnl Shouldn't happen, but who knows...
53
 
      result='~(size_t)0'
54
 
    fi
55
 
  fi
56
 
  AC_MSG_RESULT([$result])
57
 
  if test "$result" != yes; then
58
 
    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
59
 
      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
60
 
  fi
61
 
])