~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to m4/iconv.m4

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Evan Broder, Mario Limonciello
  • Date: 2010-11-24 13:59:55 UTC
  • mfrom: (1.17.6 upstream) (17.6.15 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124135955-r6ii5sepayr7jt53
Tags: 1.99~20101124-1ubuntu1
[ Colin Watson ]
* Resynchronise with Debian experimental.  Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu.  Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed.  If it is, show the
    menu, otherwise boot immediately.  If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt.  Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - Suppress progress messages as the kernel and initrd load for
    non-recovery kernel menu entries.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Don't generate /boot/grub/device.map during grub-install or
    grub-mkconfig by default.
  - Adjust upgrade version checks for Ubuntu.
  - Don't display "GRUB loading" unless Shift is held down.
  - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
    our backport of the grub-doc split.
  - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
  - Look for .mo files in /usr/share/locale-langpack as well, in
    preference.
  - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
  - Probe all devices in 'grub-probe --target=drive' if
    /boot/grub/device.map is missing.
  - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
  - Use qemu rather than qemu-system-i386.
  - Program vesafb on BIOS systems rather than efifb.
  - Add a grub-rescue-efi-amd64 package containing a rescue CD-ROM image
    for EFI-AMD64.
  - On Wubi, don't ask for an install device, but just update wubildr
    using the diverted grub-install.
  - When embedding the core image in a post-MBR gap, check for and avoid
    sectors matching any of a list of known signatures.
  - Disable video_bochs and video_cirrus on PC BIOS systems, as probing
    PCI space seems to break on some systems.
* Downgrade "ACPI shutdown failed" error to a debug message, since it can
  cause spurious test failures.

[ Evan Broder ]
* Enable lua from grub-extras.
* Incorporate the bitop library into lua.
* Add enum_pci function to grub module in lua.
* Switch back to gfxpayload=keep by default, unless the video hardware
  is known to not support it.

[ Mario Limonciello ]
* Built part_msdos and vfat into bootx64.efi (LP: #677758)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# iconv.m4 serial 15 (gettext-0.18.2)
 
2
dnl Copyright (C) 2000-2002, 2007-2010 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([AM_ICONV_LINKFLAGS_BODY],
 
10
[
 
11
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
12
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
13
  AC_REQUIRE([AC_LIB_RPATH])
 
14
 
 
15
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
16
  dnl accordingly.
 
17
  AC_LIB_LINKFLAGS_BODY([iconv])
 
18
])
 
19
 
 
20
AC_DEFUN([AM_ICONV_LINK],
 
21
[
 
22
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
 
23
  dnl those with the standalone portable GNU libiconv installed).
 
24
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
25
 
 
26
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
27
  dnl accordingly.
 
28
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
29
 
 
30
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
 
31
  dnl because if the user has installed libiconv and not disabled its use
 
32
  dnl via --without-libiconv-prefix, he wants to use it. The first
 
33
  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
 
34
  am_save_CPPFLAGS="$CPPFLAGS"
 
35
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
36
 
 
37
  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
 
38
    am_cv_func_iconv="no, consider installing GNU libiconv"
 
39
    am_cv_lib_iconv=no
 
40
    AC_LINK_IFELSE(
 
41
      [AC_LANG_PROGRAM(
 
42
         [[
 
43
#include <stdlib.h>
 
44
#include <iconv.h>
 
45
         ]],
 
46
         [[iconv_t cd = iconv_open("","");
 
47
           iconv(cd,NULL,NULL,NULL,NULL);
 
48
           iconv_close(cd);]])],
 
49
      [am_cv_func_iconv=yes])
 
50
    if test "$am_cv_func_iconv" != yes; then
 
51
      am_save_LIBS="$LIBS"
 
52
      LIBS="$LIBS $LIBICONV"
 
53
      AC_LINK_IFELSE(
 
54
        [AC_LANG_PROGRAM(
 
55
           [[
 
56
#include <stdlib.h>
 
57
#include <iconv.h>
 
58
           ]],
 
59
           [[iconv_t cd = iconv_open("","");
 
60
             iconv(cd,NULL,NULL,NULL,NULL);
 
61
             iconv_close(cd);]])],
 
62
        [am_cv_lib_iconv=yes]
 
63
        [am_cv_func_iconv=yes])
 
64
      LIBS="$am_save_LIBS"
 
65
    fi
 
66
  ])
 
67
  if test "$am_cv_func_iconv" = yes; then
 
68
    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
 
69
      dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
 
70
      dnl Solaris 10.
 
71
      am_save_LIBS="$LIBS"
 
72
      if test $am_cv_lib_iconv = yes; then
 
73
        LIBS="$LIBS $LIBICONV"
 
74
      fi
 
75
      AC_RUN_IFELSE(
 
76
        [AC_LANG_SOURCE([[
 
77
#include <iconv.h>
 
78
#include <string.h>
 
79
int main ()
 
80
{
 
81
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
 
82
     returns.  */
 
83
  {
 
84
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
 
85
    if (cd_utf8_to_88591 != (iconv_t)(-1))
 
86
      {
 
87
        static const char input[] = "\342\202\254"; /* EURO SIGN */
 
88
        char buf[10];
 
89
        const char *inptr = input;
 
90
        size_t inbytesleft = strlen (input);
 
91
        char *outptr = buf;
 
92
        size_t outbytesleft = sizeof (buf);
 
93
        size_t res = iconv (cd_utf8_to_88591,
 
94
                            (char **) &inptr, &inbytesleft,
 
95
                            &outptr, &outbytesleft);
 
96
        if (res == 0)
 
97
          return 1;
 
98
      }
 
99
  }
 
100
  /* Test against Solaris 10 bug: Failures are not distinguishable from
 
101
     successful returns.  */
 
102
  {
 
103
    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
 
104
    if (cd_ascii_to_88591 != (iconv_t)(-1))
 
105
      {
 
106
        static const char input[] = "\263";
 
107
        char buf[10];
 
108
        const char *inptr = input;
 
109
        size_t inbytesleft = strlen (input);
 
110
        char *outptr = buf;
 
111
        size_t outbytesleft = sizeof (buf);
 
112
        size_t res = iconv (cd_ascii_to_88591,
 
113
                            (char **) &inptr, &inbytesleft,
 
114
                            &outptr, &outbytesleft);
 
115
        if (res == 0)
 
116
          return 1;
 
117
      }
 
118
  }
 
119
  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
 
120
  {
 
121
    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
 
122
    if (cd_88591_to_utf8 != (iconv_t)(-1))
 
123
      {
 
124
        static const char input[] = "\304";
 
125
        static char buf[2] = { (char)0xDE, (char)0xAD };
 
126
        const char *inptr = input;
 
127
        size_t inbytesleft = 1;
 
128
        char *outptr = buf;
 
129
        size_t outbytesleft = 1;
 
130
        size_t res = iconv (cd_88591_to_utf8,
 
131
                            (char **) &inptr, &inbytesleft,
 
132
                            &outptr, &outbytesleft);
 
133
        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
 
134
          return 1;
 
135
      }
 
136
  }
 
137
#if 0 /* This bug could be worked around by the caller.  */
 
138
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
 
139
  {
 
140
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
 
141
    if (cd_88591_to_utf8 != (iconv_t)(-1))
 
142
      {
 
143
        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
 
144
        char buf[50];
 
145
        const char *inptr = input;
 
146
        size_t inbytesleft = strlen (input);
 
147
        char *outptr = buf;
 
148
        size_t outbytesleft = sizeof (buf);
 
149
        size_t res = iconv (cd_88591_to_utf8,
 
150
                            (char **) &inptr, &inbytesleft,
 
151
                            &outptr, &outbytesleft);
 
152
        if ((int)res > 0)
 
153
          return 1;
 
154
      }
 
155
  }
 
156
#endif
 
157
  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
 
158
     provided.  */
 
159
  if (/* Try standardized names.  */
 
160
      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
 
161
      /* Try IRIX, OSF/1 names.  */
 
162
      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
 
163
      /* Try AIX names.  */
 
164
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
 
165
      /* Try HP-UX names.  */
 
166
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
 
167
    return 1;
 
168
  return 0;
 
169
}]])],
 
170
        [am_cv_func_iconv_works=yes],
 
171
        [am_cv_func_iconv_works=no],
 
172
        [
 
173
changequote(,)dnl
 
174
         case "$host_os" in
 
175
           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
 
176
           *)            am_cv_func_iconv_works="guessing yes" ;;
 
177
         esac
 
178
changequote([,])dnl
 
179
        ])
 
180
      LIBS="$am_save_LIBS"
 
181
    ])
 
182
    case "$am_cv_func_iconv_works" in
 
183
      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
 
184
      *)   am_func_iconv=yes ;;
 
185
    esac
 
186
  else
 
187
    am_func_iconv=no am_cv_lib_iconv=no
 
188
  fi
 
189
  if test "$am_func_iconv" = yes; then
 
190
    AC_DEFINE([HAVE_ICONV], [1],
 
191
      [Define if you have the iconv() function and it works.])
 
192
  fi
 
193
  if test "$am_cv_lib_iconv" = yes; then
 
194
    AC_MSG_CHECKING([how to link with libiconv])
 
195
    AC_MSG_RESULT([$LIBICONV])
 
196
  else
 
197
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
 
198
    dnl either.
 
199
    CPPFLAGS="$am_save_CPPFLAGS"
 
200
    LIBICONV=
 
201
    LTLIBICONV=
 
202
  fi
 
203
  AC_SUBST([LIBICONV])
 
204
  AC_SUBST([LTLIBICONV])
 
205
])
 
206
 
 
207
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
 
208
dnl avoid warnings like
 
209
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
 
210
dnl This is tricky because of the way 'aclocal' is implemented:
 
211
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
 
212
dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
 
213
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
 
214
dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
 
215
dnl   warnings.
 
216
m4_define([gl_iconv_AC_DEFUN],
 
217
  m4_version_prereq([2.64],
 
218
    [[AC_DEFUN_ONCE(
 
219
        [$1], [$2])]],
 
220
    [m4_ifdef([gl_00GNULIB],
 
221
       [[AC_DEFUN_ONCE(
 
222
           [$1], [$2])]],
 
223
       [[AC_DEFUN(
 
224
           [$1], [$2])]])]))
 
225
gl_iconv_AC_DEFUN([AM_ICONV],
 
226
[
 
227
  AM_ICONV_LINK
 
228
  if test "$am_cv_func_iconv" = yes; then
 
229
    AC_MSG_CHECKING([for iconv declaration])
 
230
    AC_CACHE_VAL([am_cv_proto_iconv], [
 
231
      AC_COMPILE_IFELSE(
 
232
        [AC_LANG_PROGRAM(
 
233
           [[
 
234
#include <stdlib.h>
 
235
#include <iconv.h>
 
236
extern
 
237
#ifdef __cplusplus
 
238
"C"
 
239
#endif
 
240
#if defined(__STDC__) || defined(__cplusplus)
 
241
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 
242
#else
 
243
size_t iconv();
 
244
#endif
 
245
           ]],
 
246
           [[]])],
 
247
        [am_cv_proto_iconv_arg1=""],
 
248
        [am_cv_proto_iconv_arg1="const"])
 
249
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
 
250
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
 
251
    AC_MSG_RESULT([
 
252
         $am_cv_proto_iconv])
 
253
    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
 
254
      [Define as const if the declaration of iconv() needs const.])
 
255
  fi
 
256
])