~ubuntu-branches/ubuntu/trusty/alsa-utils/trusty

« back to all changes in this revision

Viewing changes to m4/size_max.m4

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich
  • Date: 2013-07-26 10:56:44 UTC
  • mfrom: (1.2.17) (93.1.1 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130726105644-kim9enke2jnozg73
Tags: 1.0.27.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Move init script volume settings to new alsactl database:
    + Set sane level for 'Speaker' and 'Headphone', needed for Dell Mini 9
      and Dell E series
    + ute PC Beep on hda cards that support it during initial volume setup
    + Mute *Analog/Digital Control for Creative cards by default
    + Default Digital Input Source to be Digital Mic 1 so that users
      with digital mic will be able to use it out of the box
    + Mute "IEC958 Optical Raw" by default
    + Set sane level for headphone 1 for Dell Studio XPS with 2.6.30
    + Prefer built-in digital mics on newer Dells
    + Unmute 'Line HP Swap' for Dove boards
    + Set reasonable volume levels for VMWare guests using snd.ens1371
  - debian/README.init.cs4236: Include in /usr/share/doc/alsa-utils so that
    users of snd-cs4236 (e.g., ThinkPad 600) can have audible sound
  - debian/patches/unset_pulse_internal.patch: We don't want alsamixer to
    show the pulse mixer by default, since it can be controlled from
    pulseaudio itself
  - Use upstart jobs for storing/restoring card settings
  - Add udev rule to apply UCM profiles for panda and equivalent hardware
  - Add Vcs-Bzr field
* Create a new upstart job for the alsa state daemon, and adjust the
  other upstart jobs accordingly
* Put the daemon file in /var/lib/alsa

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# size_max.m4 serial 4
2
 
dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
3
 
dnl This file is free software; the Free Software Foundation
4
 
dnl gives unlimited permission to copy and/or distribute it,
5
 
dnl with or without modifications, as long as this notice is preserved.
6
 
 
7
 
dnl From Bruno Haible.
8
 
 
9
 
AC_DEFUN([gl_SIZE_MAX],
10
 
[
11
 
  AC_CHECK_HEADERS(stdint.h)
12
 
  dnl First test whether the system already has SIZE_MAX.
13
 
  AC_MSG_CHECKING([for SIZE_MAX])
14
 
  result=
15
 
  AC_EGREP_CPP([Found it], [
16
 
#include <limits.h>
17
 
#if HAVE_STDINT_H
18
 
#include <stdint.h>
19
 
#endif
20
 
#ifdef SIZE_MAX
21
 
Found it
22
 
#endif
23
 
], result=yes)
24
 
  if test -z "$result"; then
25
 
    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
26
 
    dnl than the type 'unsigned long'. Try hard to find a definition that can
27
 
    dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
28
 
    _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
29
 
      [#include <stddef.h>
30
 
#include <limits.h>], size_t_bits_minus_1=)
31
 
    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
32
 
      [#include <stddef.h>], fits_in_uint=)
33
 
    if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
34
 
      if test $fits_in_uint = 1; then
35
 
        dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
36
 
        dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
37
 
        AC_TRY_COMPILE([#include <stddef.h>
38
 
          extern size_t foo;
39
 
          extern unsigned long foo;
40
 
          ], [], fits_in_uint=0)
41
 
      fi
42
 
      dnl We cannot use 'expr' to simplify this expression, because 'expr'
43
 
      dnl works only with 'long' integers in the host environment, while we
44
 
      dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
45
 
      if test $fits_in_uint = 1; then
46
 
        result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
47
 
      else
48
 
        result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
49
 
      fi
50
 
    else
51
 
      dnl Shouldn't happen, but who knows...
52
 
      result='((size_t)~(size_t)0)'
53
 
    fi
54
 
  fi
55
 
  AC_MSG_RESULT([$result])
56
 
  if test "$result" != yes; then
57
 
    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
58
 
      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
59
 
  fi
60
 
])