summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-02 12:04:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-07 20:05:31 +0000
commit2345af9b4829ed3eed5abf60f2483055649f8af7 (patch)
tree96a9a31e4b1957b93c4fe3eb669117d2752caf0d /meta/recipes-core
parentc4901328fe5cf912c0965e5b011b64a95a9bcb9d (diff)
downloadpoky-2345af9b4829ed3eed5abf60f2483055649f8af7.tar.gz
recipes: Move out stale GPLv2 versions to a seperate layeruninative-1.5
These are recipes where the upstream has moved to GPLv3 and these old versions are the last ones under the GPLv2 license. There are several reasons for making this move. There is a different quality of service with these recipes in that they don't get security fixes and upstream no longer care about them, in fact they're actively hostile against people using old versions. The recipes tend to need a different kind of maintenance to work with changes in the wider ecosystem and there needs to be isolation between changes made in the v3 versions and those in the v2 versions. There are probably better ways to handle a "non-GPLv3" system but right now having these in OE-Core makes them look like a first class citizen when I believe they have potential for a variety of undesireable issues. Moving them into a separate layer makes their different needs clearer, it also makes it clear how many of these there are. Some are probably not needed (e.g. mc), I also wonder whether some are useful (e.g. gmp) since most things that use them are GPLv3 only already. Someone could now more clearly see how to streamline the list of recipes here. I'm proposing we mmove to this separate layer for 2.3 with its future maintinership and testing to be determined in 2.4 and beyond. (From OE-Core rev: 19b7e950346fb1dde6505c45236eba6cd9b33b4b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch120
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch101
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch375
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch4051
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch117
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch19
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch32
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch85
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/futimens.patch63
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch21
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch18
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch24
-rw-r--r--meta/recipes-core/coreutils/coreutils_6.9.bb107
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch39
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch110
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch348
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch19
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch20
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch51
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch720
-rw-r--r--meta/recipes-core/gettext/gettext_0.16.1.bb124
-rw-r--r--meta/recipes-core/readline/readline-5.2/configure-fix.patch26
-rw-r--r--meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch21
-rw-r--r--meta/recipes-core/readline/readline_5.2.bb84
24 files changed, 0 insertions, 6695 deletions
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
deleted file mode 100644
index 5452b46bbc..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
+++ /dev/null
@@ -1,120 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9----
10
11When "cp -i --update old new" would do nothing because "new" is
12newer than "old", cp would nonetheless prompt for whether it is
13ok to overwrite "new". Then, regardless of the response (because
14of the --update option), cp would do nothing.
15
16The following patch eliminates the unnecessary prompt in that case.
17
18diff --git a/src/copy.c b/src/copy.c
19index b7bf73b..0e549d2 100644
20--- a/src/copy.c
21+++ b/src/copy.c
22@@ -1210,6 +1210,30 @@ copy_internal (char const *src_name, char const *dst_name,
23 return false;
24 }
25
26+ if (!S_ISDIR (src_mode) && x->update)
27+ {
28+ /* When preserving time stamps (but not moving within a file
29+ system), don't worry if the destination time stamp is
30+ less than the source merely because of time stamp
31+ truncation. */
32+ int options = ((x->preserve_timestamps
33+ && ! (x->move_mode
34+ && dst_sb.st_dev == src_sb.st_dev))
35+ ? UTIMECMP_TRUNCATE_SOURCE
36+ : 0);
37+
38+ if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
39+ {
40+ /* We're using --update and the destination is not older
41+ than the source, so do not copy or move. Pretend the
42+ rename succeeded, so the caller (if it's mv) doesn't
43+ end up removing the source file. */
44+ if (rename_succeeded)
45+ *rename_succeeded = true;
46+ return true;
47+ }
48+ }
49+
50 /* When there is an existing destination file, we may end up
51 returning early, and hence not copying/moving the file.
52 This may be due to an interactive `negative' reply to the
53@@ -1302,30 +1326,6 @@ copy_internal (char const *src_name, char const *dst_name,
54 return false;
55 }
56 }
57-
58- if (x->update)
59- {
60- /* When preserving time stamps (but not moving within a file
61- system), don't worry if the destination time stamp is
62- less than the source merely because of time stamp
63- truncation. */
64- int options = ((x->preserve_timestamps
65- && ! (x->move_mode
66- && dst_sb.st_dev == src_sb.st_dev))
67- ? UTIMECMP_TRUNCATE_SOURCE
68- : 0);
69-
70- if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
71- {
72- /* We're using --update and the destination is not older
73- than the source, so do not copy or move. Pretend the
74- rename succeeded, so the caller (if it's mv) doesn't
75- end up removing the source file. */
76- if (rename_succeeded)
77- *rename_succeeded = true;
78- return true;
79- }
80- }
81 }
82
83 if (x->move_mode)
84diff --git a/tests/mv/update b/tests/mv/update
85index 0c06024..6c3d149 100755
86--- a/tests/mv/update
87+++ b/tests/mv/update
88@@ -1,7 +1,7 @@
89 #!/bin/sh
90 # make sure --update works as advertised
91
92-# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
93+# Copyright (C) 2001, 2004, 2006-2007 Free Software Foundation, Inc.
94
95 # This program is free software; you can redistribute it and/or modify
96 # it under the terms of the GNU General Public License as published by
97@@ -46,11 +46,16 @@ fi
98
99 fail=0
100
101-for cp_or_mv in cp mv; do
102- # This is a no-op.
103- $cp_or_mv --update old new || fail=1
104- case "`cat new`" in new) ;; *) fail=1 ;; esac
105- case "`cat old`" in old) ;; *) fail=1 ;; esac
106+for interactive in '' -i; do
107+ for cp_or_mv in cp mv; do
108+ # This is a no-op, with no prompt.
109+ # With coreutils-6.9 and earlier, using --update with -i would
110+ # mistakenly elicit a prompt.
111+ $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1
112+ test -s out && fail=1
113+ case "`cat new`" in new) ;; *) fail=1 ;; esac
114+ case "`cat old`" in old) ;; *) fail=1 ;; esac
115+ done
116 done
117
118 # This will actually perform the rename.
119--
1201.5.3.rc1.16.g9d6f
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
deleted file mode 100644
index 88f61fa108..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
+++ /dev/null
@@ -1,101 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3The install command doesn't over write the dangling symlink, for
4example:
5
6$ install fileA /tmp/fileA
7
8If /tmp/fileA is a dangling symlink, there would be an error:
9
10install: cannot create regular file '/tmp/fileA': File exists
11
12This is because of the following code in copy.c:
13
14 if (!new_dst)
15 {
16 if (XSTAT (x, dst_name, &dst_sb) != 0)
17 {
18 if (errno != ENOENT)
19 {
20 error (0, errno, _("cannot stat %s"), quote (dst_name));
21 return false;
22 }
23 else
24 {
25 new_dst = true;
26 }
27 }
28
29XSTAT() use stat() for dst_name(the dangling symlink /tmp/fileA) when
30install.c invokes it, and stat will set errno to ENOENT, and then
31new_dst will be set to true which means that /tmp/fileA doesn't exist,
32then we will create /tmp/fileA without remove it first, so the error
33comes.
34
35This is fixed in a way which adds the member cmd_install in
36struct cp_options to make sure my change only affected to the install
37command and use lstat to fix the problem.
38
39Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
40Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
41
42---
43 src/copy.c | 10 +++++++++-
44 src/copy.h | 3 +++
45 src/install.c | 1 +
46 3 files changed, 13 insertions(+), 1 deletions(-)
47
48diff --git a/src/copy.c b/src/copy.c
49--- a/src/copy.c
50+++ b/src/copy.c
51@@ -1029,6 +1029,7 @@ copy_internal (char const *src_name, char const *dst_name,
52 bool delayed_ok;
53 bool copied_as_regular = false;
54 bool preserve_metadata;
55+ int dst_stat_result;
56
57 if (x->move_mode && rename_succeeded)
58 *rename_succeeded = false;
59@@ -1069,7 +1070,14 @@ copy_internal (char const *src_name, char const *dst_name,
60
61 if (!new_dst)
62 {
63- if (XSTAT (x, dst_name, &dst_sb) != 0)
64+ if ( x->cmd_install && ( x->backup_type == no_backups))
65+ dst_stat_result = lstat (dst_name, &dst_sb);
66+ else
67+ {
68+ dst_stat_result = XSTAT (x, dst_name, &dst_sb);
69+ }
70+
71+ if (dst_stat_result != 0)
72 {
73 if (errno != ENOENT)
74 {
75diff --git a/src/copy.h b/src/copy.h
76--- a/src/copy.h
77+++ b/src/copy.h
78@@ -114,6 +114,9 @@ struct cp_options
79 If that fails, then resort to copying. */
80 bool move_mode;
81
82+ /* For the install command */
83+ bool cmd_install;
84+
85 /* Whether this process has appropriate privileges to chown a file
86 whose owner is not the effective user ID. */
87 bool chown_privileges;
88diff --git a/src/install.c b/src/install.c
89--- a/src/install.c
90+++ b/src/install.c
91@@ -149,6 +149,7 @@ cp_option_init (struct cp_options *x)
92 x->hard_link = false;
93 x->interactive = I_UNSPECIFIED;
94 x->move_mode = false;
95+ x->cmd_install = true;
96 x->chown_privileges = chown_privileges ();
97 x->one_file_system = false;
98 x->preserve_ownership = false;
99--
1001.7.0.1
101
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
deleted file mode 100644
index 3ae5a2faeb..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
+++ /dev/null
@@ -1,375 +0,0 @@
1From 170be4023bbf9e9698a709e03265945588ac8e01 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 26 Nov 2013 00:21:50 +0800
4Subject: [PATCH] doc/coreutils.texi: Use '@item' instead of '@itemx'
5
6Use '@item' instead of '@itemx' in several places, as Texinfo 5 refuses
7to process an '@itemx' that is not preceded by an '@item'. Ensure that
8node extended names in menus and sectioning are consistent, and that
9ordering and presence of nodes in menus and in the actual text are
10consistent as well.
11
12Upstream-Status: Backport [From: coreutils.7620.n7.nabble.com, bug#11828]
13
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15---
16 doc/coreutils.texi | 82 +++++++++++++++++++++++++++---------------------------
17 1 file changed, 41 insertions(+), 41 deletions(-)
18
19diff --git a/doc/coreutils.texi b/doc/coreutils.texi
20index 588147f..2dae3fe 100644
21--- a/doc/coreutils.texi
22+++ b/doc/coreutils.texi
23@@ -555,7 +555,7 @@ symbolic link to a directory. @xref{Target directory}.
24 @end macro
25
26 @macro optSi
27-@itemx --si
28+@item --si
29 @opindex --si
30 @cindex SI output
31 Append an SI-style abbreviation to each size, such as @samp{M} for
32@@ -578,7 +578,7 @@ Use the @option{--si} option if you prefer powers of 1000.
33 @end macro
34
35 @macro optStripTrailingSlashes
36-@itemx @w{@kbd{--strip-trailing-slashes}}
37+@item @w{@kbd{--strip-trailing-slashes}}
38 @opindex --strip-trailing-slashes
39 @cindex stripping trailing slashes
40 Remove any trailing slashes from each @var{source} argument.
41@@ -2496,7 +2496,7 @@ by 1048576.
42 However, if @var{n} starts with a @samp{-},
43 print all but the last @var{n} bytes of each file.
44
45-@itemx -n @var{n}
46+@item -n @var{n}
47 @itemx --lines=@var{n}
48 @opindex -n
49 @opindex --lines
50@@ -2633,7 +2633,7 @@ This option is the same as @option{--follow=name --retry}. That is, tail
51 will attempt to reopen a file when it is removed. Should this fail, tail
52 will keep trying until it becomes accessible again.
53
54-@itemx --retry
55+@item --retry
56 @opindex --retry
57 This option is useful mainly when following by name (i.e., with
58 @option{--follow=name}).
59@@ -2641,7 +2641,7 @@ Without this option, when tail encounters a file that doesn't
60 exist or is otherwise inaccessible, it reports that fact and
61 never checks it again.
62
63-@itemx --sleep-interval=@var{number}
64+@item --sleep-interval=@var{number}
65 @opindex --sleep-interval
66 Change the number of seconds to wait between iterations (the default is 1.0).
67 During one iteration, every specified file is checked to see if it has
68@@ -2651,7 +2651,7 @@ Historical implementations of @command{tail} have required that
69 an arbitrary floating point number (using a period before any
70 fractional digits).
71
72-@itemx --pid=@var{pid}
73+@item --pid=@var{pid}
74 @opindex --pid
75 When following by name or by descriptor, you may specify the process ID,
76 @var{pid}, of the sole writer of all @var{file} arguments. Then, shortly
77@@ -2674,7 +2674,7 @@ terminate until long after the real writer has terminated.
78 Note that @option{--pid} cannot be supported on some systems; @command{tail}
79 will print a warning if this is the case.
80
81-@itemx --max-unchanged-stats=@var{n}
82+@item --max-unchanged-stats=@var{n}
83 @opindex --max-unchanged-stats
84 When tailing a file by name, if there have been @var{n} (default
85 n=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive
86@@ -2686,7 +2686,7 @@ number of seconds between when tail prints the last pre-rotation lines
87 and when it prints the lines that have accumulated in the new log file.
88 This option is meaningful only when following by name.
89
90-@itemx -n @var{n}
91+@item -n @var{n}
92 @itemx --lines=@var{n}
93 @opindex -n
94 @opindex --lines
95@@ -2817,7 +2817,7 @@ option.
96 @opindex --numeric-suffixes
97 Use digits in suffixes rather than lower-case letters.
98
99-@itemx --verbose
100+@item --verbose
101 @opindex --verbose
102 Write a diagnostic to standard error just before each output file is opened.
103
104@@ -3055,7 +3055,7 @@ Print only the newline counts.
105 @opindex --max-line-length
106 Print only the maximum line lengths.
107
108-@itemx --files0-from=@var{FILE}
109+@item --files0-from=@var{FILE}
110 @opindex --files0-from=@var{FILE}
111 @cindex including files from @command{du}
112 Rather than processing files named on the command line, process those
113@@ -3250,7 +3250,7 @@ an MD5 checksum inconsistent with the associated file, or if no valid
114 line is found, @command{md5sum} exits with nonzero status. Otherwise,
115 it exits successfully.
116
117-@itemx --status
118+@item --status
119 @opindex --status
120 @cindex verifying MD5 checksums
121 This option is useful only when verifying checksums.
122@@ -5837,7 +5837,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}),
123 If a command line argument specifies a symbolic link, show information
124 for the file the link references rather than for the link itself.
125
126-@itemx --dereference-command-line-symlink-to-dir
127+@item --dereference-command-line-symlink-to-dir
128 @opindex --dereference-command-line-symlink-to-dir
129 @cindex symbolic links, dereferencing
130 Do not dereference symbolic links, with one exception:
131@@ -7015,15 +7015,15 @@ If specified, the @var{attribute_list} must be a comma-separated list
132 of one or more of the following strings:
133
134 @table @samp
135-@itemx mode
136+@item mode
137 Preserve the file mode bits and access control lists.
138-@itemx ownership
139+@item ownership
140 Preserve the owner and group. On most modern systems,
141 only users with appropriate privileges may change the owner of a file,
142 and ordinary users
143 may preserve the group ownership of a file only if they happen to be
144 a member of the desired group.
145-@itemx timestamps
146+@item timestamps
147 Preserve the times of last access and last modification, when possible.
148 In general, it is not possible to preserve these attributes
149 when the affected file is a symbolic link.
150@@ -7031,12 +7031,12 @@ However, FreeBSD now provides the @code{lutimes} function, which makes
151 it possibile even for symbolic links. However, this implementation does
152 not yet take advantage of that.
153 @c FIXME: once we provide lutimes support, update the above.
154-@itemx links
155+@item links
156 Preserve in the destination files
157 any links between corresponding source files.
158 @c Give examples illustrating how hard links are preserved.
159 @c Also, show how soft links map to hard links with -L and -H.
160-@itemx all
161+@item all
162 Preserve all file attributes.
163 Equivalent to specifying all of the above.
164 @end table
165@@ -7049,12 +7049,12 @@ mode bits of the corresponding source file, minus the bits set in the
166 umask and minus the set-user-ID and set-group-ID bits.
167 @xref{File permissions}.
168
169-@itemx @w{@kbd{--no-preserve}=@var{attribute_list}}
170+@item @w{@kbd{--no-preserve}=@var{attribute_list}}
171 @cindex file information, preserving
172 Do not preserve the specified attributes. The @var{attribute_list}
173 has the same form as for @option{--preserve}.
174
175-@itemx --parents
176+@item --parents
177 @opindex --parents
178 @cindex parent directories and @command{cp}
179 Form the name of each destination file by appending to the target
180@@ -7070,7 +7070,7 @@ cp --parents a/b/c existing_dir
181 copies the file @file{a/b/c} to @file{existing_dir/a/b/c}, creating
182 any missing intermediate directories.
183
184-@itemx @w{@kbd{--reply}=@var{how}}
185+@item @w{@kbd{--reply}=@var{how}}
186 @opindex --reply
187 @cindex interactivity
188 @c FIXME: remove in 2008
189@@ -7742,7 +7742,7 @@ Prompt whether to overwrite each existing destination file, regardless
190 of its permissions.
191 If the response is not affirmative, the file is skipped.
192
193-@itemx @w{@kbd{--reply}=@var{how}}
194+@item @w{@kbd{--reply}=@var{how}}
195 @opindex --reply
196 @cindex interactivity
197 @c FIXME: remove in 2008
198@@ -7847,7 +7847,7 @@ files are named or if a recursive removal is requested. Ignore any
199 previous @option{--force} (@option{-f}) option. Equivalent to
200 @option{--interactive=once}.
201
202-@itemx --interactive [=@var{when}]
203+@item --interactive [=@var{when}]
204 @opindex --interactive
205 Specify when to issue an interactive prompt. @var{when} may be
206 omitted, or one of:
207@@ -7866,7 +7866,7 @@ removal is requested. Equivalent to @option{-I}.
208 Specifying @option{--interactive} and no @var{when} is equivalent to
209 @option{--interactive=always}.
210
211-@itemx --one-file-system
212+@item --one-file-system
213 @opindex --one-file-system
214 @cindex one file system, restricting @command{rm} to
215 When removing a hierarchy recursively, skip any directory that is on a
216@@ -7884,7 +7884,7 @@ warn about and skip directories on other file systems.
217 Of course, this will not save your @file{/home} if it and your
218 chroot happen to be on the same file system.
219
220-@itemx --preserve-root
221+@item --preserve-root
222 @opindex --preserve-root
223 @cindex root directory, disallow recursive destruction
224 Fail upon any attempt to remove the root directory, @file{/},
225@@ -7892,7 +7892,7 @@ when used with the @option{--recursive} option.
226 This is the default behavior.
227 @xref{Treating / specially}.
228
229-@itemx --no-preserve-root
230+@item --no-preserve-root
231 @opindex --no-preserve-root
232 @cindex root directory, allow recursive destruction
233 Do not treat @file{/} specially when removing recursively.
234@@ -8874,7 +8874,7 @@ actually changes.
235 Do not print error messages about files whose ownership cannot be
236 changed.
237
238-@itemx @w{@kbd{--from}=@var{old-owner}}
239+@item @w{@kbd{--from}=@var{old-owner}}
240 @opindex --from
241 @cindex symbolic links, changing owner
242 Change a @var{file}'s ownership only if it has current attributes specified
243@@ -8928,14 +8928,14 @@ is a symbolic link.
244 By default, no diagnostic is issued for symbolic links encountered
245 during a recursive traversal, but see @option{--verbose}.
246
247-@itemx --preserve-root
248+@item --preserve-root
249 @opindex --preserve-root
250 @cindex root directory, disallow recursive modification
251 Fail upon any attempt to recursively change the root directory, @file{/}.
252 Without @option{--recursive}, this option has no effect.
253 @xref{Treating / specially}.
254
255-@itemx --no-preserve-root
256+@item --no-preserve-root
257 @opindex --no-preserve-root
258 @cindex root directory, allow recursive modification
259 Cancel the effect of any preceding @option{--preserve-root} option.
260@@ -9054,14 +9054,14 @@ is a symbolic link.
261 By default, no diagnostic is issued for symbolic links encountered
262 during a recursive traversal, but see @option{--verbose}.
263
264-@itemx --preserve-root
265+@item --preserve-root
266 @opindex --preserve-root
267 @cindex root directory, disallow recursive modification
268 Fail upon any attempt to recursively change the root directory, @file{/}.
269 Without @option{--recursive}, this option has no effect.
270 @xref{Treating / specially}.
271
272-@itemx --no-preserve-root
273+@item --no-preserve-root
274 @opindex --no-preserve-root
275 @cindex root directory, allow recursive modification
276 Cancel the effect of any preceding @option{--preserve-root} option.
277@@ -9175,14 +9175,14 @@ actually changes.
278 Do not print error messages about files whose permissions cannot be
279 changed.
280
281-@itemx --preserve-root
282+@item --preserve-root
283 @opindex --preserve-root
284 @cindex root directory, disallow recursive modification
285 Fail upon any attempt to recursively change the root directory, @file{/}.
286 Without @option{--recursive}, this option has no effect.
287 @xref{Treating / specially}.
288
289-@itemx --no-preserve-root
290+@item --no-preserve-root
291 @opindex --no-preserve-root
292 @cindex root directory, allow recursive modification
293 Cancel the effect of any preceding @option{--preserve-root} option.
294@@ -9603,7 +9603,7 @@ The program accepts the following options. Also see @ref{Common options}.
295 @opindex --all
296 Show counts for all files, not just directories.
297
298-@itemx --apparent-size
299+@item --apparent-size
300 @opindex --apparent-size
301 Print apparent sizes, rather than disk usage. The apparent size of a
302 file is the number of bytes reported by @code{wc -c} on regular files,
303@@ -9654,7 +9654,7 @@ Does not affect other symbolic links. This is helpful for finding
304 out the disk usage of directories, such as @file{/usr/tmp}, which
305 are often symbolic links.
306
307-@itemx --files0-from=@var{FILE}
308+@item --files0-from=@var{FILE}
309 @opindex --files0-from=@var{FILE}
310 @cindex including files from @command{du}
311 Rather than processing files named on the command line, process those
312@@ -9733,7 +9733,7 @@ Output a null byte at the end of each line, rather than a newline.
313 This option enables other programs to parse the output of @command{du}
314 even when that output would contain file names with embedded newlines.
315
316-@itemx --si
317+@item --si
318 @opindex --si
319 @cindex SI output
320 Append an SI-style abbreviation to each size, such as @samp{MB} for
321@@ -9754,13 +9754,13 @@ Display only a total for each argument.
322 Report the size of each directory separately, not including the sizes
323 of subdirectories.
324
325-@itemx --time
326+@item --time
327 @opindex --time
328 @cindex last modified dates, displaying in @command{du}
329 Show time of the most recent modification of any file in the directory,
330 or any of its subdirectories.
331
332-@itemx --time=ctime
333+@item --time=ctime
334 @itemx --time=status
335 @itemx --time=use
336 @opindex --time
337@@ -9770,7 +9770,7 @@ or any of its subdirectories.
338 Show the most recent status change time (the @samp{ctime} in the inode) of
339 any file in the directory, instead of the modification time.
340
341-@itemx --time=atime
342+@item --time=atime
343 @itemx --time=access
344 @opindex --time
345 @opindex atime@r{, show the most recent}
346@@ -9911,7 +9911,7 @@ $ stat --format=%d:%i / /usr
347 2057:2
348 @end example
349
350-@itemx --printf=@var{format}
351+@item --printf=@var{format}
352 @opindex --printf=@var{format}
353 @cindex output format
354 Use @var{format} rather than the default format.
355@@ -12240,7 +12240,7 @@ Overrides all other options.
356 @opindex -s
357 Ignored; for compatibility with other versions of @command{who}.
358
359-@itemx -u
360+@item -u
361 @opindex -u
362 @cindex idle time
363 After the login time, print the number of hours and minutes that the
364@@ -12254,7 +12254,7 @@ user has been idle. @samp{.} means the user was active in the last minute.
365 List only the entries that correspond to processes via which the
366 system is waiting for a user to login. The user name is always @samp{LOGIN}.
367
368-@itemx --lookup
369+@item --lookup
370 @opindex --lookup
371 Attempt to canonicalize hostnames found in utmp through a DNS lookup. This
372 is not the default because it can cause significant delays on systems with
373--
3741.8.3.1
375
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
deleted file mode 100644
index 653722348a..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
+++ /dev/null
@@ -1,4051 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7The comment indicates that the purpose is lin18nux/lsb compliance.
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11--- /dev/null 2007-03-01 09:16:39.219409909 +0000
12+++ coreutils-6.8+/tests/sort/sort-mb-tests 2007-03-01 15:08:24.000000000 +0000
13@@ -0,0 +1,58 @@
14+#! /bin/sh
15+case $# in
16+ 0) xx='../../src/sort';;
17+ *) xx="$1";;
18+esac
19+test "$VERBOSE" && echo=echo || echo=:
20+$echo testing program: $xx
21+errors=0
22+test "$srcdir" || srcdir=.
23+test "$VERBOSE" && $xx --version 2> /dev/null
24+
25+export LC_ALL=en_US.UTF-8
26+locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77
27+errors=0
28+
29+$xx -t ï¼  -k2 -n mb1.I > mb1.O
30+code=$?
31+if test $code != 0; then
32+ $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2
33+ errors=`expr $errors + 1`
34+else
35+ cmp mb1.O $srcdir/mb1.X > /dev/null 2>&1
36+ case $? in
37+ 0) if test "$VERBOSE"; then $echo "passed mb1"; fi;;
38+ 1) $echo "Test mb1 failed: files mb1.O and $srcdir/mb1.X differ" 1>&2
39+ (diff -c mb1.O $srcdir/mb1.X) 2> /dev/null
40+ errors=`expr $errors + 1`;;
41+ 2) $echo "Test mb1 may have failed." 1>&2
42+ $echo The command "cmp mb1.O $srcdir/mb1.X" failed. 1>&2
43+ errors=`expr $errors + 1`;;
44+ esac
45+fi
46+
47+$xx -t ï¼  -k4 -n mb2.I > mb2.O
48+code=$?
49+if test $code != 0; then
50+ $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2
51+ errors=`expr $errors + 1`
52+else
53+ cmp mb2.O $srcdir/mb2.X > /dev/null 2>&1
54+ case $? in
55+ 0) if test "$VERBOSE"; then $echo "passed mb2"; fi;;
56+ 1) $echo "Test mb2 failed: files mb2.O and $srcdir/mb2.X differ" 1>&2
57+ (diff -c mb2.O $srcdir/mb2.X) 2> /dev/null
58+ errors=`expr $errors + 1`;;
59+ 2) $echo "Test mb2 may have failed." 1>&2
60+ $echo The command "cmp mb2.O $srcdir/mb2.X" failed. 1>&2
61+ errors=`expr $errors + 1`;;
62+ esac
63+fi
64+
65+if test $errors = 0; then
66+ $echo Passed all 113 tests. 1>&2
67+else
68+ $echo Failed $errors tests. 1>&2
69+fi
70+test $errors = 0 || errors=1
71+exit $errors
72--- /dev/null 2007-03-01 09:16:39.219409909 +0000
73+++ coreutils-6.8+/tests/sort/mb2.I 2007-03-01 15:08:24.000000000 +0000
74@@ -0,0 +1,4 @@
75+Apple@AA10@@20
76+Banana@AA5@@30
77+Citrus@AA20@@5
78+Cherry@AA30@@10
79--- /dev/null 2007-03-01 09:16:39.219409909 +0000
80+++ coreutils-6.8+/tests/sort/mb2.X 2007-03-01 15:08:24.000000000 +0000
81@@ -0,0 +1,4 @@
82+Citrus@AA20@@5
83+Cherry@AA30@@10
84+Apple@AA10@@20
85+Banana@AA5@@30
86--- /dev/null 2007-03-01 09:16:39.219409909 +0000
87+++ coreutils-6.8+/tests/sort/mb1.I 2007-03-01 15:08:24.000000000 +0000
88@@ -0,0 +1,4 @@
89+Appleï¼ 10
90+Bananaï¼ 5
91+Citrusï¼ 20
92+Cherryï¼ 30
93--- /dev/null 2007-03-01 09:16:39.219409909 +0000
94+++ coreutils-6.8+/tests/sort/mb1.X 2007-03-01 15:08:24.000000000 +0000
95@@ -0,0 +1,4 @@
96+Bananaï¼ 5
97+Appleï¼ 10
98+Citrusï¼ 20
99+Cherryï¼ 30
100--- coreutils-6.8+/tests/sort/Makefile.am.i18n 2007-01-24 07:47:37.000000000 +0000
101+++ coreutils-6.8+/tests/sort/Makefile.am 2007-03-01 15:09:59.000000000 +0000
102@@ -66,15 +66,17 @@
103 bigfield.O bigfield.E
104 ##test-files-end
105
106-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
107-noinst_SCRIPTS = $x-tests
108+run_gen += mb1.0 mb2.0
109+
110+EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X
111+noinst_SCRIPTS = $x-tests # $x-mb-tests
112 TESTS_ENVIRONMENT = \
113 CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
114 PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
115
116 editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
117
118-TESTS = $x-tests
119+TESTS = $x-tests $x-mb-tests
120
121 mk_script = $(srcdir)/../mk-script
122 $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
123--- coreutils-6.8+/lib/linebuffer.h.i18n 2005-05-14 07:44:24.000000000 +0100
124+++ coreutils-6.8+/lib/linebuffer.h 2007-03-01 15:08:24.000000000 +0000
125@@ -22,6 +22,11 @@
126
127 # include <stdio.h>
128
129+/* Get mbstate_t. */
130+# if HAVE_WCHAR_H
131+# include <wchar.h>
132+# endif
133+
134 /* A `struct linebuffer' holds a line of text. */
135
136 struct linebuffer
137@@ -29,6 +34,9 @@
138 size_t size; /* Allocated. */
139 size_t length; /* Used. */
140 char *buffer;
141+# if HAVE_WCHAR_H
142+ mbstate_t state;
143+# endif
144 };
145
146 /* Initialize linebuffer LINEBUFFER for use. */
147--- coreutils-6.8+/src/expand.c.i18n 2007-01-14 15:41:28.000000000 +0000
148+++ coreutils-6.8+/src/expand.c 2007-03-01 15:08:24.000000000 +0000
149@@ -38,11 +38,28 @@
150 #include <stdio.h>
151 #include <getopt.h>
152 #include <sys/types.h>
153+
154+/* Get mbstate_t, mbrtowc(), wcwidth(). */
155+#if HAVE_WCHAR_H
156+# include <wchar.h>
157+#endif
158+
159 #include "system.h"
160 #include "error.h"
161 #include "quote.h"
162 #include "xstrndup.h"
163
164+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
165+ installation; work around this configuration error. */
166+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
167+# define MB_LEN_MAX 16
168+#endif
169+
170+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
171+#if HAVE_MBRTOWC && defined mbstate_t
172+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
173+#endif
174+
175 /* The official name of this program (e.g., no `g' prefix). */
176 #define PROGRAM_NAME "expand"
177
178@@ -183,6 +200,7 @@
179 stops = num_start + len - 1;
180 }
181 }
182+
183 else
184 {
185 error (0, 0, _("tab size contains invalid character(s): %s"),
186@@ -365,6 +383,142 @@
187 }
188 }
189
190+#if HAVE_MBRTOWC
191+static void
192+expand_multibyte (void)
193+{
194+ FILE *fp; /* Input strem. */
195+ mbstate_t i_state; /* Current shift state of the input stream. */
196+ mbstate_t i_state_bak; /* Back up the I_STATE. */
197+ mbstate_t o_state; /* Current shift state of the output stream. */
198+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
199+ char *bufpos; /* Next read position of BUF. */
200+ size_t buflen = 0; /* The length of the byte sequence in buf. */
201+ wchar_t wc; /* A gotten wide character. */
202+ size_t mblength; /* The byte size of a multibyte character
203+ which shows as same character as WC. */
204+ int tab_index = 0; /* Index in `tab_list' of next tabstop. */
205+ int column = 0; /* Column on screen of the next char. */
206+ int next_tab_column; /* Column the next tab stop is on. */
207+ int convert = 1; /* If nonzero, perform translations. */
208+
209+ fp = next_file ((FILE *) NULL);
210+ if (fp == NULL)
211+ return;
212+
213+ memset (&o_state, '\0', sizeof(mbstate_t));
214+ memset (&i_state, '\0', sizeof(mbstate_t));
215+
216+ for (;;)
217+ {
218+ /* Refill the buffer BUF. */
219+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
220+ {
221+ memmove (buf, bufpos, buflen);
222+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
223+ bufpos = buf;
224+ }
225+
226+ /* No character is left in BUF. */
227+ if (buflen < 1)
228+ {
229+ fp = next_file (fp);
230+
231+ if (fp == NULL)
232+ break; /* No more files. */
233+ else
234+ {
235+ memset (&i_state, '\0', sizeof(mbstate_t));
236+ continue;
237+ }
238+ }
239+
240+ /* Get a wide character. */
241+ i_state_bak = i_state;
242+ mblength = mbrtowc (&wc, bufpos, buflen, &i_state);
243+
244+ switch (mblength)
245+ {
246+ case (size_t)-1: /* illegal byte sequence. */
247+ case (size_t)-2:
248+ mblength = 1;
249+ i_state = i_state_bak;
250+ if (convert)
251+ {
252+ ++column;
253+ if (convert_entire_line == 0)
254+ convert = 0;
255+ }
256+ putchar (*bufpos);
257+ break;
258+
259+ case 0: /* null. */
260+ mblength = 1;
261+ if (convert && convert_entire_line == 0)
262+ convert = 0;
263+ putchar ('\0');
264+ break;
265+
266+ default:
267+ if (wc == L'\n') /* LF. */
268+ {
269+ tab_index = 0;
270+ column = 0;
271+ convert = 1;
272+ putchar ('\n');
273+ }
274+ else if (wc == L'\t' && convert) /* Tab. */
275+ {
276+ if (tab_size == 0)
277+ {
278+ /* Do not let tab_index == first_free_tab;
279+ stop when it is 1 less. */
280+ while (tab_index < first_free_tab - 1
281+ && column >= tab_list[tab_index])
282+ tab_index++;
283+ next_tab_column = tab_list[tab_index];
284+ if (tab_index < first_free_tab - 1)
285+ tab_index++;
286+ if (column >= next_tab_column)
287+ next_tab_column = column + 1;
288+ }
289+ else
290+ next_tab_column = column + tab_size - column % tab_size;
291+
292+ while (column < next_tab_column)
293+ {
294+ putchar (' ');
295+ ++column;
296+ }
297+ }
298+ else /* Others. */
299+ {
300+ if (convert)
301+ {
302+ if (wc == L'\b')
303+ {
304+ if (column > 0)
305+ --column;
306+ }
307+ else
308+ {
309+ int width; /* The width of WC. */
310+
311+ width = wcwidth (wc);
312+ column += (width > 0) ? width : 0;
313+ if (convert_entire_line == 0)
314+ convert = 0;
315+ }
316+ }
317+ fwrite (bufpos, sizeof(char), mblength, stdout);
318+ }
319+ }
320+ buflen -= mblength;
321+ bufpos += mblength;
322+ }
323+}
324+#endif
325+
326 int
327 main (int argc, char **argv)
328 {
329@@ -429,7 +583,12 @@
330
331 file_list = (optind < argc ? &argv[optind] : stdin_argv);
332
333- expand ();
334+#if HAVE_MBRTOWC
335+ if (MB_CUR_MAX > 1)
336+ expand_multibyte ();
337+ else
338+#endif
339+ expand ();
340
341 if (have_read_stdin && fclose (stdin) != 0)
342 error (EXIT_FAILURE, errno, "-");
343--- coreutils-6.8+/src/join.c.i18n 2007-01-14 15:41:28.000000000 +0000
344+++ coreutils-6.8+/src/join.c 2007-03-01 15:08:24.000000000 +0000
345@@ -23,16 +23,30 @@
346 #include <sys/types.h>
347 #include <getopt.h>
348
349+/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */
350+#if HAVE_WCHAR_H
351+# include <wchar.h>
352+#endif
353+
354+/* Get iswblank(), towupper. */
355+#if HAVE_WCTYPE_H
356+# include <wctype.h>
357+#endif
358+
359 #include "system.h"
360 #include "error.h"
361 #include "hard-locale.h"
362 #include "linebuffer.h"
363-#include "memcasecmp.h"
364 #include "quote.h"
365 #include "stdio--.h"
366 #include "xmemcoll.h"
367 #include "xstrtol.h"
368
369+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
370+#if HAVE_MBRTOWC && defined mbstate_t
371+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
372+#endif
373+
374 /* The official name of this program (e.g., no `g' prefix). */
375 #define PROGRAM_NAME "join"
376
377@@ -104,10 +118,12 @@
378 /* Last element in `outlist', where a new element can be added. */
379 static struct outlist *outlist_end = &outlist_head;
380
381-/* Tab character separating fields. If negative, fields are separated
382- by any nonempty string of blanks, otherwise by exactly one
383- tab character whose value (when cast to unsigned char) equals TAB. */
384-static int tab = -1;
385+/* Tab character separating fields. If NULL, fields are separated
386+ by any nonempty string of blanks. */
387+static char *tab = NULL;
388+
389+/* The number of bytes used for tab. */
390+static size_t tablen = 0;
391
392 static struct option const longopts[] =
393 {
394@@ -190,6 +206,8 @@
395
396 /* Fill in the `fields' structure in LINE. */
397
398+/* Fill in the `fields' structure in LINE. */
399+
400 static void
401 xfields (struct line *line)
402 {
403@@ -199,10 +217,11 @@
404 if (ptr == lim)
405 return;
406
407- if (0 <= tab)
408+ if (tab != NULL)
409 {
410+ unsigned char t = tab[0];
411 char *sep;
412- for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1)
413+ for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1)
414 extract_field (line, ptr, sep - ptr);
415 }
416 else
417@@ -229,6 +248,148 @@
418 extract_field (line, ptr, lim - ptr);
419 }
420
421+#if HAVE_MBRTOWC
422+static void
423+xfields_multibyte (struct line *line)
424+{
425+ char *ptr = line->buf.buffer;
426+ char const *lim = ptr + line->buf.length - 1;
427+ wchar_t wc = 0;
428+ size_t mblength = 1;
429+ mbstate_t state, state_bak;
430+
431+ memset (&state, 0, sizeof (mbstate_t));
432+
433+ if (ptr == lim)
434+ return;
435+
436+ if (tab != NULL)
437+ {
438+ unsigned char t = tab[0];
439+ char *sep = ptr;
440+ for (; ptr < lim; ptr = sep + mblength)
441+ {
442+ sep = ptr;
443+ while (sep < lim)
444+ {
445+ state_bak = state;
446+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
447+
448+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
449+ {
450+ mblength = 1;
451+ state = state_bak;
452+ }
453+ mblength = (mblength < 1) ? 1 : mblength;
454+
455+ if (mblength == tablen && !memcmp (sep, tab, mblength))
456+ break;
457+ else
458+ {
459+ sep += mblength;
460+ continue;
461+ }
462+ }
463+
464+ if (sep == lim)
465+ break;
466+
467+ extract_field (line, ptr, sep - ptr);
468+ }
469+ }
470+ else
471+ {
472+ /* Skip leading blanks before the first field. */
473+ while(ptr < lim)
474+ {
475+ state_bak = state;
476+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
477+
478+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
479+ {
480+ mblength = 1;
481+ state = state_bak;
482+ break;
483+ }
484+ mblength = (mblength < 1) ? 1 : mblength;
485+
486+ if (!iswblank(wc))
487+ break;
488+ ptr += mblength;
489+ }
490+
491+ do
492+ {
493+ char *sep;
494+ state_bak = state;
495+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
496+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
497+ {
498+ mblength = 1;
499+ state = state_bak;
500+ break;
501+ }
502+ mblength = (mblength < 1) ? 1 : mblength;
503+
504+ sep = ptr + mblength;
505+ while (sep != lim)
506+ {
507+ state_bak = state;
508+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
509+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
510+ {
511+ mblength = 1;
512+ state = state_bak;
513+ break;
514+ }
515+ mblength = (mblength < 1) ? 1 : mblength;
516+
517+ if (iswblank (wc))
518+ break;
519+
520+ sep += mblength;
521+ }
522+
523+ extract_field (line, ptr, sep - ptr);
524+ if (sep == lim)
525+ return;
526+
527+ state_bak = state;
528+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
529+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
530+ {
531+ mblength = 1;
532+ state = state_bak;
533+ break;
534+ }
535+ mblength = (mblength < 1) ? 1 : mblength;
536+
537+ ptr = sep + mblength;
538+ while (ptr != lim)
539+ {
540+ state_bak = state;
541+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
542+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
543+ {
544+ mblength = 1;
545+ state = state_bak;
546+ break;
547+ }
548+ mblength = (mblength < 1) ? 1 : mblength;
549+
550+ if (!iswblank (wc))
551+ break;
552+
553+ ptr += mblength;
554+ }
555+ }
556+ while (ptr != lim);
557+ }
558+
559+ extract_field (line, ptr, lim - ptr);
560+}
561+#endif
562+
563 /* Read a line from FP into LINE and split it into fields.
564 Return true if successful. */
565
566@@ -249,6 +410,11 @@
567 line->nfields_allocated = 0;
568 line->nfields = 0;
569 line->fields = NULL;
570+#if HAVE_MBRTOWC
571+ if (MB_CUR_MAX > 1)
572+ xfields_multibyte (line);
573+ else
574+#endif
575 xfields (line);
576 return true;
577 }
578@@ -303,56 +469,114 @@
579 keycmp (struct line const *line1, struct line const *line2)
580 {
581 /* Start of field to compare in each file. */
582- char *beg1;
583- char *beg2;
584-
585- size_t len1;
586- size_t len2; /* Length of fields to compare. */
587+ char *beg[2];
588+ char *copy[2];
589+ size_t len[2]; /* Length of fields to compare. */
590 int diff;
591+ int i, j;
592
593 if (join_field_1 < line1->nfields)
594 {
595- beg1 = line1->fields[join_field_1].beg;
596- len1 = line1->fields[join_field_1].len;
597+ beg[0] = line1->fields[join_field_1].beg;
598+ len[0] = line1->fields[join_field_1].len;
599 }
600 else
601 {
602- beg1 = NULL;
603- len1 = 0;
604+ beg[0] = NULL;
605+ len[0] = 0;
606 }
607
608 if (join_field_2 < line2->nfields)
609 {
610- beg2 = line2->fields[join_field_2].beg;
611- len2 = line2->fields[join_field_2].len;
612+ beg[1] = line2->fields[join_field_2].beg;
613+ len[1] = line2->fields[join_field_2].len;
614 }
615 else
616 {
617- beg2 = NULL;
618- len2 = 0;
619+ beg[1] = NULL;
620+ len[1] = 0;
621 }
622
623- if (len1 == 0)
624- return len2 == 0 ? 0 : -1;
625- if (len2 == 0)
626+ if (len[0] == 0)
627+ return len[1] == 0 ? 0 : -1;
628+ if (len[1] == 0)
629 return 1;
630
631 if (ignore_case)
632 {
633- /* FIXME: ignore_case does not work with NLS (in particular,
634- with multibyte chars). */
635- diff = memcasecmp (beg1, beg2, MIN (len1, len2));
636+#ifdef HAVE_MBRTOWC
637+ if (MB_CUR_MAX > 1)
638+ {
639+ size_t mblength;
640+ wchar_t wc, uwc;
641+ mbstate_t state, state_bak;
642+
643+ memset (&state, '\0', sizeof (mbstate_t));
644+
645+ for (i = 0; i < 2; i++)
646+ {
647+ copy[i] = alloca (len[i] + 1);
648+
649+ for (j = 0; j < MIN (len[0], len[1]);)
650+ {
651+ state_bak = state;
652+ mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state);
653+
654+ switch (mblength)
655+ {
656+ case (size_t) -1:
657+ case (size_t) -2:
658+ state = state_bak;
659+ /* Fall through */
660+ case 0:
661+ mblength = 1;
662+ break;
663+
664+ default:
665+ uwc = towupper (wc);
666+
667+ if (uwc != wc)
668+ {
669+ mbstate_t state_wc;
670+
671+ memset (&state_wc, '\0', sizeof (mbstate_t));
672+ wcrtomb (copy[i] + j, uwc, &state_wc);
673+ }
674+ else
675+ memcpy (copy[i] + j, beg[i] + j, mblength);
676+ }
677+ j += mblength;
678+ }
679+ copy[i][j] = '\0';
680+ }
681+ }
682+ else
683+#endif
684+ {
685+ for (i = 0; i < 2; i++)
686+ {
687+ copy[i] = alloca (len[i] + 1);
688+
689+ for (j = 0; j < MIN (len[0], len[1]); j++)
690+ copy[i][j] = toupper (beg[i][j]);
691+
692+ copy[i][j] = '\0';
693+ }
694+ }
695 }
696 else
697 {
698- if (hard_LC_COLLATE)
699- return xmemcoll (beg1, len1, beg2, len2);
700- diff = memcmp (beg1, beg2, MIN (len1, len2));
701+ copy[0] = (unsigned char *) beg[0];
702+ copy[1] = (unsigned char *) beg[1];
703 }
704
705+ if (hard_LC_COLLATE)
706+ return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]);
707+ diff = memcmp (copy[0], copy[1], MIN (len[0], len[1]));
708+
709 if (diff)
710 return diff;
711- return len1 < len2 ? -1 : len1 != len2;
712+ return len[0] - len[1];
713 }
714
715 /* Print field N of LINE if it exists and is nonempty, otherwise
716@@ -377,11 +601,18 @@
717
718 /* Print the join of LINE1 and LINE2. */
719
720+#define PUT_TAB_CHAR \
721+ do \
722+ { \
723+ (tab != NULL) ? \
724+ fwrite(tab, sizeof(char), tablen, stdout) : putchar (' '); \
725+ } \
726+ while (0)
727+
728 static void
729 prjoin (struct line const *line1, struct line const *line2)
730 {
731 const struct outlist *outlist;
732- char output_separator = tab < 0 ? ' ' : tab;
733
734 outlist = outlist_head.next;
735 if (outlist)
736@@ -397,12 +628,12 @@
737 if (o->file == 0)
738 {
739 if (line1 == &uni_blank)
740- {
741+ {
742 line = line2;
743 field = join_field_2;
744 }
745 else
746- {
747+ {
748 line = line1;
749 field = join_field_1;
750 }
751@@ -416,7 +647,7 @@
752 o = o->next;
753 if (o == NULL)
754 break;
755- putchar (output_separator);
756+ PUT_TAB_CHAR;
757 }
758 putchar ('\n');
759 }
760@@ -434,23 +665,23 @@
761 prfield (join_field_1, line1);
762 for (i = 0; i < join_field_1 && i < line1->nfields; ++i)
763 {
764- putchar (output_separator);
765+ PUT_TAB_CHAR;
766 prfield (i, line1);
767 }
768 for (i = join_field_1 + 1; i < line1->nfields; ++i)
769 {
770- putchar (output_separator);
771+ PUT_TAB_CHAR;
772 prfield (i, line1);
773 }
774
775 for (i = 0; i < join_field_2 && i < line2->nfields; ++i)
776 {
777- putchar (output_separator);
778+ PUT_TAB_CHAR;
779 prfield (i, line2);
780 }
781 for (i = join_field_2 + 1; i < line2->nfields; ++i)
782 {
783- putchar (output_separator);
784+ PUT_TAB_CHAR;
785 prfield (i, line2);
786 }
787 putchar ('\n');
788@@ -859,20 +1090,41 @@
789
790 case 't':
791 {
792- unsigned char newtab = optarg[0];
793- if (! newtab)
794+ char *newtab;
795+ size_t newtablen;
796+ if (! optarg[0])
797 error (EXIT_FAILURE, 0, _("empty tab"));
798- if (optarg[1])
799+ newtab = xstrdup (optarg);
800+#if HAVE_MBRTOWC
801+ if (MB_CUR_MAX > 1)
802+ {
803+ mbstate_t state;
804+
805+ memset (&state, 0, sizeof (mbstate_t));
806+ newtablen = mbrtowc (NULL, newtab,
807+ strnlen (newtab, MB_LEN_MAX),
808+ &state);
809+ if (newtablen == (size_t) 0
810+ || newtablen == (size_t) -1
811+ || newtablen == (size_t) -2)
812+ newtablen = 1;
813+ }
814+ else
815+#endif
816+ newtablen = 1;
817+
818+ if (newtablen == 1 && newtab[1])
819+ {
820+ if (STREQ (newtab, "\\0"))
821+ newtab[0] = '\0';
822+ }
823+ if (tab != NULL && strcmp (tab, newtab))
824 {
825- if (STREQ (optarg, "\\0"))
826- newtab = '\0';
827- else
828- error (EXIT_FAILURE, 0, _("multi-character tab %s"),
829- quote (optarg));
830+ free (newtab);
831+ error (EXIT_FAILURE, 0, _("incompatible tabs"));
832 }
833- if (0 <= tab && tab != newtab)
834- error (EXIT_FAILURE, 0, _("incompatible tabs"));
835 tab = newtab;
836+ tablen = newtablen;
837 }
838 break;
839
840--- coreutils-6.8+/src/uniq.c.i18n 2007-01-14 15:41:28.000000000 +0000
841+++ coreutils-6.8+/src/uniq.c 2007-03-01 15:08:24.000000000 +0000
842@@ -23,6 +23,16 @@
843 #include <getopt.h>
844 #include <sys/types.h>
845
846+/* Get mbstate_t, mbrtowc(). */
847+#if HAVE_WCHAR_H
848+# include <wchar.h>
849+#endif
850+
851+/* Get isw* functions. */
852+#if HAVE_WCTYPE_H
853+# include <wctype.h>
854+#endif
855+
856 #include "system.h"
857 #include "argmatch.h"
858 #include "linebuffer.h"
859@@ -32,7 +42,19 @@
860 #include "quote.h"
861 #include "xmemcoll.h"
862 #include "xstrtol.h"
863-#include "memcasecmp.h"
864+#include "xmemcoll.h"
865+
866+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
867+ installation; work around this configuration error. */
868+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
869+# define MB_LEN_MAX 16
870+#endif
871+
872+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
873+#if HAVE_MBRTOWC && defined mbstate_t
874+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
875+#endif
876+
877
878 /* The official name of this program (e.g., no `g' prefix). */
879 #define PROGRAM_NAME "uniq"
880@@ -109,6 +131,10 @@
881 /* Select whether/how to delimit groups of duplicate lines. */
882 static enum delimit_method delimit_groups;
883
884+/* Function pointers. */
885+static char *
886+(*find_field) (struct linebuffer *line);
887+
888 static struct option const longopts[] =
889 {
890 {"count", no_argument, NULL, 'c'},
891@@ -198,7 +224,7 @@
892 return a pointer to the beginning of the line's field to be compared. */
893
894 static char *
895-find_field (const struct linebuffer *line)
896+find_field_uni (struct linebuffer *line)
897 {
898 size_t count;
899 char *lp = line->buffer;
900@@ -219,6 +245,83 @@
901 return lp + i;
902 }
903
904+#if HAVE_MBRTOWC
905+
906+# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \
907+ do \
908+ { \
909+ mbstate_t state_bak; \
910+ \
911+ CONVFAIL = 0; \
912+ state_bak = *STATEP; \
913+ \
914+ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \
915+ \
916+ switch (MBLENGTH) \
917+ { \
918+ case (size_t)-2: \
919+ case (size_t)-1: \
920+ *STATEP = state_bak; \
921+ CONVFAIL++; \
922+ /* Fall through */ \
923+ case 0: \
924+ MBLENGTH = 1; \
925+ } \
926+ } \
927+ while (0)
928+
929+static char *
930+find_field_multi (struct linebuffer *line)
931+{
932+ size_t count;
933+ char *lp = line->buffer;
934+ size_t size = line->length - 1;
935+ size_t pos;
936+ size_t mblength;
937+ wchar_t wc;
938+ mbstate_t *statep;
939+ int convfail;
940+
941+ pos = 0;
942+ statep = &(line->state);
943+
944+ /* skip fields. */
945+ for (count = 0; count < skip_fields && pos < size; count++)
946+ {
947+ while (pos < size)
948+ {
949+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
950+
951+ if (convfail || !iswblank (wc))
952+ {
953+ pos += mblength;
954+ break;
955+ }
956+ pos += mblength;
957+ }
958+
959+ while (pos < size)
960+ {
961+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
962+
963+ if (!convfail && iswblank (wc))
964+ break;
965+
966+ pos += mblength;
967+ }
968+ }
969+
970+ /* skip fields. */
971+ for (count = 0; count < skip_chars && pos < size; count++)
972+ {
973+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
974+ pos += mblength;
975+ }
976+
977+ return lp + pos;
978+}
979+#endif
980+
981 /* Return false if two strings OLD and NEW match, true if not.
982 OLD and NEW point not to the beginnings of the lines
983 but rather to the beginnings of the fields to compare.
984@@ -227,6 +330,8 @@
985 static bool
986 different (char *old, char *new, size_t oldlen, size_t newlen)
987 {
988+ char *copy_old, *copy_new;
989+
990 if (check_chars < oldlen)
991 oldlen = check_chars;
992 if (check_chars < newlen)
993@@ -234,14 +339,92 @@
994
995 if (ignore_case)
996 {
997- /* FIXME: This should invoke strcoll somehow. */
998- return oldlen != newlen || memcasecmp (old, new, oldlen);
999+ size_t i;
1000+
1001+ copy_old = alloca (oldlen + 1);
1002+ copy_new = alloca (oldlen + 1);
1003+
1004+ for (i = 0; i < oldlen; i++)
1005+ {
1006+ copy_old[i] = toupper (old[i]);
1007+ copy_new[i] = toupper (new[i]);
1008+ }
1009 }
1010- else if (hard_LC_COLLATE)
1011- return xmemcoll (old, oldlen, new, newlen) != 0;
1012 else
1013- return oldlen != newlen || memcmp (old, new, oldlen);
1014+ {
1015+ copy_old = (char *)old;
1016+ copy_new = (char *)new;
1017+ }
1018+
1019+ return xmemcoll (copy_old, oldlen, copy_new, newlen);
1020+}
1021+
1022+#if HAVE_MBRTOWC
1023+static int
1024+different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
1025+{
1026+ size_t i, j, chars;
1027+ const char *str[2];
1028+ char *copy[2];
1029+ size_t len[2];
1030+ mbstate_t state[2];
1031+ size_t mblength;
1032+ wchar_t wc, uwc;
1033+ mbstate_t state_bak;
1034+
1035+ str[0] = old;
1036+ str[1] = new;
1037+ len[0] = oldlen;
1038+ len[1] = newlen;
1039+ state[0] = oldstate;
1040+ state[1] = newstate;
1041+
1042+ for (i = 0; i < 2; i++)
1043+ {
1044+ copy[i] = alloca (len[i] + 1);
1045+
1046+ for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++)
1047+ {
1048+ state_bak = state[i];
1049+ mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i]));
1050+
1051+ switch (mblength)
1052+ {
1053+ case (size_t)-1:
1054+ case (size_t)-2:
1055+ state[i] = state_bak;
1056+ /* Fall through */
1057+ case 0:
1058+ mblength = 1;
1059+ break;
1060+
1061+ default:
1062+ if (ignore_case)
1063+ {
1064+ uwc = towupper (wc);
1065+
1066+ if (uwc != wc)
1067+ {
1068+ mbstate_t state_wc;
1069+
1070+ memset (&state_wc, '\0', sizeof(mbstate_t));
1071+ wcrtomb (copy[i] + j, uwc, &state_wc);
1072+ }
1073+ else
1074+ memcpy (copy[i] + j, str[i] + j, mblength);
1075+ }
1076+ else
1077+ memcpy (copy[i] + j, str[i] + j, mblength);
1078+ }
1079+ j += mblength;
1080+ }
1081+ copy[i][j] = '\0';
1082+ len[i] = j;
1083+ }
1084+
1085+ return xmemcoll (copy[0], len[0], copy[1], len[1]);
1086 }
1087+#endif
1088
1089 /* Output the line in linebuffer LINE to standard output
1090 provided that the switches say it should be output.
1091@@ -295,15 +478,43 @@
1092 {
1093 char *prevfield IF_LINT (= NULL);
1094 size_t prevlen IF_LINT (= 0);
1095+#if HAVE_MBRTOWC
1096+ mbstate_t prevstate;
1097+
1098+ memset (&prevstate, '\0', sizeof (mbstate_t));
1099+#endif
1100
1101 while (!feof (stdin))
1102 {
1103 char *thisfield;
1104 size_t thislen;
1105+#if HAVE_MBRTOWC
1106+ mbstate_t thisstate;
1107+#endif
1108+
1109 if (readlinebuffer (thisline, stdin) == 0)
1110 break;
1111 thisfield = find_field (thisline);
1112 thislen = thisline->length - 1 - (thisfield - thisline->buffer);
1113+#if HAVE_MBRTOWC
1114+ if (MB_CUR_MAX > 1)
1115+ {
1116+ thisstate = thisline->state;
1117+
1118+ if (prevline->length == 0 || different_multi
1119+ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate))
1120+ {
1121+ fwrite (thisline->buffer, sizeof (char),
1122+ thisline->length, stdout);
1123+
1124+ SWAP_LINES (prevline, thisline);
1125+ prevfield = thisfield;
1126+ prevlen = thislen;
1127+ prevstate = thisstate;
1128+ }
1129+ }
1130+ else
1131+#endif
1132 if (prevline->length == 0
1133 || different (thisfield, prevfield, thislen, prevlen))
1134 {
1135@@ -322,17 +533,26 @@
1136 size_t prevlen;
1137 uintmax_t match_count = 0;
1138 bool first_delimiter = true;
1139+#if HAVE_MBRTOWC
1140+ mbstate_t prevstate;
1141+#endif
1142
1143 if (readlinebuffer (prevline, stdin) == 0)
1144 goto closefiles;
1145 prevfield = find_field (prevline);
1146 prevlen = prevline->length - 1 - (prevfield - prevline->buffer);
1147+#if HAVE_MBRTOWC
1148+ prevstate = prevline->state;
1149+#endif
1150
1151 while (!feof (stdin))
1152 {
1153 bool match;
1154 char *thisfield;
1155 size_t thislen;
1156+#if HAVE_MBRTOWC
1157+ mbstate_t thisstate;
1158+#endif
1159 if (readlinebuffer (thisline, stdin) == 0)
1160 {
1161 if (ferror (stdin))
1162@@ -341,6 +561,15 @@
1163 }
1164 thisfield = find_field (thisline);
1165 thislen = thisline->length - 1 - (thisfield - thisline->buffer);
1166+#if HAVE_MBRTOWC
1167+ if (MB_CUR_MAX > 1)
1168+ {
1169+ thisstate = thisline->state;
1170+ match = !different_multi (thisfield, prevfield,
1171+ thislen, prevlen, thisstate, prevstate);
1172+ }
1173+ else
1174+#endif
1175 match = !different (thisfield, prevfield, thislen, prevlen);
1176 match_count += match;
1177
1178@@ -373,6 +602,9 @@
1179 SWAP_LINES (prevline, thisline);
1180 prevfield = thisfield;
1181 prevlen = thislen;
1182+#if HAVE_MBRTOWC
1183+ prevstate = thisstate;
1184+#endif
1185 if (!match)
1186 match_count = 0;
1187 }
1188@@ -417,6 +649,19 @@
1189
1190 atexit (close_stdout);
1191
1192+#if HAVE_MBRTOWC
1193+ if (MB_CUR_MAX > 1)
1194+ {
1195+ find_field = find_field_multi;
1196+ }
1197+ else
1198+#endif
1199+ {
1200+ find_field = find_field_uni;
1201+ }
1202+
1203+
1204+
1205 skip_chars = 0;
1206 skip_fields = 0;
1207 check_chars = SIZE_MAX;
1208--- coreutils-6.8+/src/fold.c.i18n 2007-02-23 12:01:47.000000000 +0000
1209+++ coreutils-6.8+/src/fold.c 2007-03-01 15:08:24.000000000 +0000
1210@@ -23,11 +23,33 @@
1211 #include <getopt.h>
1212 #include <sys/types.h>
1213
1214+/* Get mbstate_t, mbrtowc(), wcwidth(). */
1215+#if HAVE_WCHAR_H
1216+# include <wchar.h>
1217+#endif
1218+
1219+/* Get iswprint(), iswblank(), wcwidth(). */
1220+#if HAVE_WCTYPE_H
1221+# include <wctype.h>
1222+#endif
1223+
1224 #include "system.h"
1225 #include "error.h"
1226 #include "quote.h"
1227 #include "xstrtol.h"
1228
1229+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
1230+ installation; work around this configuration error. */
1231+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
1232+# undef MB_LEN_MAX
1233+# define MB_LEN_MAX 16
1234+#endif
1235+
1236+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
1237+#if HAVE_MBRTOWC && defined mbstate_t
1238+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
1239+#endif
1240+
1241 #define TAB_WIDTH 8
1242
1243 /* The official name of this program (e.g., no `g' prefix). */
1244@@ -35,23 +57,44 @@
1245
1246 #define AUTHORS "David MacKenzie"
1247
1248+#define FATAL_ERROR(Message) \
1249+ do \
1250+ { \
1251+ error (0, 0, (Message)); \
1252+ usage (2); \
1253+ } \
1254+ while (0)
1255+
1256+enum operating_mode
1257+{
1258+ /* Fold texts by columns that are at the given positions. */
1259+ column_mode,
1260+
1261+ /* Fold texts by bytes that are at the given positions. */
1262+ byte_mode,
1263+
1264+ /* Fold texts by characters that are at the given positions. */
1265+ character_mode,
1266+};
1267+
1268 /* The name this program was run with. */
1269 char *program_name;
1270
1271+/* The argument shows current mode. (Default: column_mode) */
1272+static enum operating_mode operating_mode;
1273+
1274 /* If nonzero, try to break on whitespace. */
1275 static bool break_spaces;
1276
1277-/* If nonzero, count bytes, not column positions. */
1278-static bool count_bytes;
1279-
1280 /* If nonzero, at least one of the files we read was standard input. */
1281 static bool have_read_stdin;
1282
1283-static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::";
1284+static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::";
1285
1286 static struct option const longopts[] =
1287 {
1288 {"bytes", no_argument, NULL, 'b'},
1289+ {"characters", no_argument, NULL, 'c'},
1290 {"spaces", no_argument, NULL, 's'},
1291 {"width", required_argument, NULL, 'w'},
1292 {GETOPT_HELP_OPTION_DECL},
1293@@ -81,6 +124,7 @@
1294 "), stdout);
1295 fputs (_("\
1296 -b, --bytes count bytes rather than columns\n\
1297+ -c, --characters count characters rather than columns\n\
1298 -s, --spaces break at spaces\n\
1299 -w, --width=WIDTH use WIDTH columns instead of 80\n\
1300 "), stdout);
1301@@ -98,7 +142,7 @@
1302 static size_t
1303 adjust_column (size_t column, char c)
1304 {
1305- if (!count_bytes)
1306+ if (operating_mode != byte_mode)
1307 {
1308 if (c == '\b')
1309 {
1310@@ -121,30 +165,14 @@
1311 to stdout, with maximum line length WIDTH.
1312 Return true if successful. */
1313
1314-static bool
1315-fold_file (char const *filename, size_t width)
1316+static void
1317+fold_text (FILE *istream, size_t width, int *saved_errno)
1318 {
1319- FILE *istream;
1320 int c;
1321 size_t column = 0; /* Screen column where next char will go. */
1322 size_t offset_out = 0; /* Index in `line_out' for next char. */
1323 static char *line_out = NULL;
1324 static size_t allocated_out = 0;
1325- int saved_errno;
1326-
1327- if (STREQ (filename, "-"))
1328- {
1329- istream = stdin;
1330- have_read_stdin = true;
1331- }
1332- else
1333- istream = fopen (filename, "r");
1334-
1335- if (istream == NULL)
1336- {
1337- error (0, errno, "%s", filename);
1338- return false;
1339- }
1340
1341 while ((c = getc (istream)) != EOF)
1342 {
1343@@ -172,6 +200,15 @@
1344 bool found_blank = false;
1345 size_t logical_end = offset_out;
1346
1347+ /* If LINE_OUT has no wide character,
1348+ put a new wide character in LINE_OUT
1349+ if column is bigger than width. */
1350+ if (offset_out == 0)
1351+ {
1352+ line_out[offset_out++] = c;
1353+ continue;
1354+ }
1355+
1356 /* Look for the last blank. */
1357 while (logical_end)
1358 {
1359@@ -218,11 +255,225 @@
1360 line_out[offset_out++] = c;
1361 }
1362
1363- saved_errno = errno;
1364+ *saved_errno = errno;
1365+
1366+ if (offset_out)
1367+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
1368+
1369+ free(line_out);
1370+}
1371+
1372+#if HAVE_MBRTOWC
1373+static void
1374+fold_multibyte_text (FILE *istream, size_t width, int *saved_errno)
1375+{
1376+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
1377+ size_t buflen = 0; /* The length of the byte sequence in buf. */
1378+ char *bufpos; /* Next read position of BUF. */
1379+ wint_t wc; /* A gotten wide character. */
1380+ size_t mblength; /* The byte size of a multibyte character which shows
1381+ as same character as WC. */
1382+ mbstate_t state, state_bak; /* State of the stream. */
1383+ int convfail; /* 1, when conversion is failed. Otherwise 0. */
1384+
1385+ char *line_out = NULL;
1386+ size_t offset_out = 0; /* Index in `line_out' for next char. */
1387+ size_t allocated_out = 0;
1388+
1389+ int increment;
1390+ size_t column = 0;
1391+
1392+ size_t last_blank_pos;
1393+ size_t last_blank_column;
1394+ int is_blank_seen;
1395+ int last_blank_increment;
1396+ int is_bs_following_last_blank;
1397+ size_t bs_following_last_blank_num;
1398+ int is_cr_after_last_blank;
1399+
1400+#define CLEAR_FLAGS \
1401+ do \
1402+ { \
1403+ last_blank_pos = 0; \
1404+ last_blank_column = 0; \
1405+ is_blank_seen = 0; \
1406+ is_bs_following_last_blank = 0; \
1407+ bs_following_last_blank_num = 0; \
1408+ is_cr_after_last_blank = 0; \
1409+ } \
1410+ while (0)
1411+
1412+#define START_NEW_LINE \
1413+ do \
1414+ { \
1415+ putchar ('\n'); \
1416+ column = 0; \
1417+ offset_out = 0; \
1418+ CLEAR_FLAGS; \
1419+ } \
1420+ while (0)
1421+
1422+ CLEAR_FLAGS;
1423+ memset (&state, '\0', sizeof(mbstate_t));
1424+
1425+ for (;; bufpos += mblength, buflen -= mblength)
1426+ {
1427+ if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream))
1428+ {
1429+ memmove (buf, bufpos, buflen);
1430+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream);
1431+ bufpos = buf;
1432+ }
1433+
1434+ if (buflen < 1)
1435+ break;
1436+
1437+ /* Get a wide character. */
1438+ convfail = 0;
1439+ state_bak = state;
1440+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state);
1441+
1442+ switch (mblength)
1443+ {
1444+ case (size_t)-1:
1445+ case (size_t)-2:
1446+ convfail++;
1447+ state = state_bak;
1448+ /* Fall through. */
1449+
1450+ case 0:
1451+ mblength = 1;
1452+ break;
1453+ }
1454+
1455+rescan:
1456+ if (operating_mode == byte_mode) /* byte mode */
1457+ increment = mblength;
1458+ else if (operating_mode == character_mode) /* character mode */
1459+ increment = 1;
1460+ else /* column mode */
1461+ {
1462+ if (convfail)
1463+ increment = 1;
1464+ else
1465+ {
1466+ switch (wc)
1467+ {
1468+ case L'\n':
1469+ fwrite (line_out, sizeof(char), offset_out, stdout);
1470+ START_NEW_LINE;
1471+ continue;
1472+
1473+ case L'\b':
1474+ increment = (column > 0) ? -1 : 0;
1475+ break;
1476+
1477+ case L'\r':
1478+ increment = -1 * column;
1479+ break;
1480+
1481+ case L'\t':
1482+ increment = 8 - column % 8;
1483+ break;
1484+
1485+ default:
1486+ increment = wcwidth (wc);
1487+ increment = (increment < 0) ? 0 : increment;
1488+ }
1489+ }
1490+ }
1491+
1492+ if (column + increment > width && break_spaces && last_blank_pos)
1493+ {
1494+ fwrite (line_out, sizeof(char), last_blank_pos, stdout);
1495+ putchar ('\n');
1496+
1497+ offset_out = offset_out - last_blank_pos;
1498+ column = column - last_blank_column + ((is_cr_after_last_blank)
1499+ ? last_blank_increment : bs_following_last_blank_num);
1500+ memmove (line_out, line_out + last_blank_pos, offset_out);
1501+ CLEAR_FLAGS;
1502+ goto rescan;
1503+ }
1504+
1505+ if (column + increment > width && column != 0)
1506+ {
1507+ fwrite (line_out, sizeof(char), offset_out, stdout);
1508+ START_NEW_LINE;
1509+ goto rescan;
1510+ }
1511+
1512+ if (allocated_out < offset_out + mblength)
1513+ {
1514+ allocated_out += 1024;
1515+ line_out = xrealloc (line_out, allocated_out);
1516+ }
1517+
1518+ memcpy (line_out + offset_out, bufpos, mblength);
1519+ offset_out += mblength;
1520+ column += increment;
1521+
1522+ if (is_blank_seen && !convfail && wc == L'\r')
1523+ is_cr_after_last_blank = 1;
1524+
1525+ if (is_bs_following_last_blank && !convfail && wc == L'\b')
1526+ ++bs_following_last_blank_num;
1527+ else
1528+ is_bs_following_last_blank = 0;
1529+
1530+ if (break_spaces && !convfail && iswblank (wc))
1531+ {
1532+ last_blank_pos = offset_out;
1533+ last_blank_column = column;
1534+ is_blank_seen = 1;
1535+ last_blank_increment = increment;
1536+ is_bs_following_last_blank = 1;
1537+ bs_following_last_blank_num = 0;
1538+ is_cr_after_last_blank = 0;
1539+ }
1540+ }
1541+
1542+ *saved_errno = errno;
1543
1544 if (offset_out)
1545 fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
1546
1547+ free(line_out);
1548+}
1549+#endif
1550+
1551+/* Fold file FILENAME, or standard input if FILENAME is "-",
1552+ to stdout, with maximum line length WIDTH.
1553+ Return 0 if successful, 1 if an error occurs. */
1554+
1555+static bool
1556+fold_file (char *filename, size_t width)
1557+{
1558+ FILE *istream;
1559+ int saved_errno;
1560+
1561+ if (STREQ (filename, "-"))
1562+ {
1563+ istream = stdin;
1564+ have_read_stdin = 1;
1565+ }
1566+ else
1567+ istream = fopen (filename, "r");
1568+
1569+ if (istream == NULL)
1570+ {
1571+ error (0, errno, "%s", filename);
1572+ return 1;
1573+ }
1574+
1575+ /* Define how ISTREAM is being folded. */
1576+#if HAVE_MBRTOWC
1577+ if (MB_CUR_MAX > 1)
1578+ fold_multibyte_text (istream, width, &saved_errno);
1579+ else
1580+#endif
1581+ fold_text (istream, width, &saved_errno);
1582+
1583 if (ferror (istream))
1584 {
1585 error (0, saved_errno, "%s", filename);
1586@@ -255,7 +506,8 @@
1587
1588 atexit (close_stdout);
1589
1590- break_spaces = count_bytes = have_read_stdin = false;
1591+ operating_mode = column_mode;
1592+ break_spaces = have_read_stdin = false;
1593
1594 while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
1595 {
1596@@ -264,7 +516,15 @@
1597 switch (optc)
1598 {
1599 case 'b': /* Count bytes rather than columns. */
1600- count_bytes = true;
1601+ if (operating_mode != column_mode)
1602+ FATAL_ERROR (_("only one way of folding may be specified"));
1603+ operating_mode = byte_mode;
1604+ break;
1605+
1606+ case 'c':
1607+ if (operating_mode != column_mode)
1608+ FATAL_ERROR (_("only one way of folding may be specified"));
1609+ operating_mode = character_mode;
1610 break;
1611
1612 case 's': /* Break at word boundaries. */
1613--- coreutils-6.8+/src/sort.c.i18n 2007-02-24 11:23:23.000000000 +0000
1614+++ coreutils-6.8+/src/sort.c 2007-03-01 15:10:57.000000000 +0000
1615@@ -23,10 +23,19 @@
1616
1617 #include <config.h>
1618
1619+#include <assert.h>
1620 #include <getopt.h>
1621 #include <sys/types.h>
1622 #include <sys/wait.h>
1623 #include <signal.h>
1624+#if HAVE_WCHAR_H
1625+# include <wchar.h>
1626+#endif
1627+/* Get isw* functions. */
1628+#if HAVE_WCTYPE_H
1629+# include <wctype.h>
1630+#endif
1631+
1632 #include "system.h"
1633 #include "argmatch.h"
1634 #include "error.h"
1635@@ -116,14 +125,38 @@
1636 /* Thousands separator; if -1, then there isn't one. */
1637 static int thousands_sep;
1638
1639+static int force_general_numcompare = 0;
1640+
1641 /* Nonzero if the corresponding locales are hard. */
1642 static bool hard_LC_COLLATE;
1643-#if HAVE_NL_LANGINFO
1644+#if HAVE_LANGINFO_CODESET
1645 static bool hard_LC_TIME;
1646 #endif
1647
1648 #define NONZERO(x) ((x) != 0)
1649
1650+/* get a multibyte character's byte length. */
1651+#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \
1652+ do \
1653+ { \
1654+ wchar_t wc; \
1655+ mbstate_t state_bak; \
1656+ \
1657+ state_bak = STATE; \
1658+ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \
1659+ \
1660+ switch (MBLENGTH) \
1661+ { \
1662+ case (size_t)-1: \
1663+ case (size_t)-2: \
1664+ STATE = state_bak; \
1665+ /* Fall through. */ \
1666+ case 0: \
1667+ MBLENGTH = 1; \
1668+ } \
1669+ } \
1670+ while (0)
1671+
1672 /* The kind of blanks for '-b' to skip in various options. */
1673 enum blanktype { bl_start, bl_end, bl_both };
1674
1675@@ -261,13 +294,11 @@
1676 they were read if all keys compare equal. */
1677 static bool stable;
1678
1679-/* If TAB has this value, blanks separate fields. */
1680-enum { TAB_DEFAULT = CHAR_MAX + 1 };
1681-
1682-/* Tab character separating fields. If TAB_DEFAULT, then fields are
1683+/* Tab character separating fields. If tab_length is 0, then fields are
1684 separated by the empty string between a non-blank character and a blank
1685 character. */
1686-static int tab = TAB_DEFAULT;
1687+static char tab[MB_LEN_MAX + 1];
1688+static size_t tab_length = 0;
1689
1690 /* Flag to remove consecutive duplicate lines from the output.
1691 Only the last of a sequence of equal lines will be output. */
1692@@ -639,6 +670,44 @@
1693 update_proc (pid);
1694 }
1695
1696+/* Function pointers. */
1697+static void
1698+(*inittables) (void);
1699+static char *
1700+(*begfield) (const struct line*, const struct keyfield *);
1701+static char *
1702+(*limfield) (const struct line*, const struct keyfield *);
1703+static int
1704+(*getmonth) (char const *, size_t);
1705+static int
1706+(*keycompare) (const struct line *, const struct line *);
1707+static int
1708+(*numcompare) (const char *, const char *);
1709+
1710+/* Test for white space multibyte character.
1711+ Set LENGTH the byte length of investigated multibyte character. */
1712+#if HAVE_MBRTOWC
1713+static int
1714+ismbblank (const char *str, size_t len, size_t *length)
1715+{
1716+ size_t mblength;
1717+ wchar_t wc;
1718+ mbstate_t state;
1719+
1720+ memset (&state, '\0', sizeof(mbstate_t));
1721+ mblength = mbrtowc (&wc, str, len, &state);
1722+
1723+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
1724+ {
1725+ *length = 1;
1726+ return 0;
1727+ }
1728+
1729+ *length = (mblength < 1) ? 1 : mblength;
1730+ return iswblank (wc);
1731+}
1732+#endif
1733+
1734 /* Clean up any remaining temporary files. */
1735
1736 static void
1737@@ -978,7 +1047,7 @@
1738 free (node);
1739 }
1740
1741-#if HAVE_NL_LANGINFO
1742+#if HAVE_LANGINFO_CODESET
1743
1744 static int
1745 struct_month_cmp (const void *m1, const void *m2)
1746@@ -993,7 +1062,7 @@
1747 /* Initialize the character class tables. */
1748
1749 static void
1750-inittables (void)
1751+inittables_uni (void)
1752 {
1753 size_t i;
1754
1755@@ -1005,7 +1074,7 @@
1756 fold_toupper[i] = toupper (i);
1757 }
1758
1759-#if HAVE_NL_LANGINFO
1760+#if HAVE_LANGINFO_CODESET
1761 /* If we're not in the "C" locale, read different names for months. */
1762 if (hard_LC_TIME)
1763 {
1764@@ -1031,6 +1100,64 @@
1765 #endif
1766 }
1767
1768+#if HAVE_MBRTOWC
1769+static void
1770+inittables_mb (void)
1771+{
1772+ int i, j, k, l;
1773+ char *name, *s;
1774+ size_t s_len, mblength;
1775+ char mbc[MB_LEN_MAX];
1776+ wchar_t wc, pwc;
1777+ mbstate_t state_mb, state_wc;
1778+
1779+ for (i = 0; i < MONTHS_PER_YEAR; i++)
1780+ {
1781+ s = (char *) nl_langinfo (ABMON_1 + i);
1782+ s_len = strlen (s);
1783+ monthtab[i].name = name = (char *) xmalloc (s_len + 1);
1784+ monthtab[i].val = i + 1;
1785+
1786+ memset (&state_mb, '\0', sizeof (mbstate_t));
1787+ memset (&state_wc, '\0', sizeof (mbstate_t));
1788+
1789+ for (j = 0; j < s_len;)
1790+ {
1791+ if (!ismbblank (s + j, s_len - j, &mblength))
1792+ break;
1793+ j += mblength;
1794+ }
1795+
1796+ for (k = 0; j < s_len;)
1797+ {
1798+ mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb);
1799+ assert (mblength != (size_t)-1 && mblength != (size_t)-2);
1800+ if (mblength == 0)
1801+ break;
1802+
1803+ pwc = towupper (wc);
1804+ if (pwc == wc)
1805+ {
1806+ memcpy (mbc, s + j, mblength);
1807+ j += mblength;
1808+ }
1809+ else
1810+ {
1811+ j += mblength;
1812+ mblength = wcrtomb (mbc, pwc, &state_wc);
1813+ assert (mblength != (size_t)0 && mblength != (size_t)-1);
1814+ }
1815+
1816+ for (l = 0; l < mblength; l++)
1817+ name[k++] = mbc[l];
1818+ }
1819+ name[k] = '\0';
1820+ }
1821+ qsort ((void *) monthtab, MONTHS_PER_YEAR,
1822+ sizeof (struct month), struct_month_cmp);
1823+}
1824+#endif
1825+
1826 /* Specify the amount of main memory to use when sorting. */
1827 static void
1828 specify_sort_size (char const *s)
1829@@ -1241,7 +1368,7 @@
1830 by KEY in LINE. */
1831
1832 static char *
1833-begfield (const struct line *line, const struct keyfield *key)
1834+begfield_uni (const struct line *line, const struct keyfield *key)
1835 {
1836 char *ptr = line->text, *lim = ptr + line->length - 1;
1837 size_t sword = key->sword;
1838@@ -1251,10 +1378,10 @@
1839 /* The leading field separator itself is included in a field when -t
1840 is absent. */
1841
1842- if (tab != TAB_DEFAULT)
1843+ if (tab_length)
1844 while (ptr < lim && sword--)
1845 {
1846- while (ptr < lim && *ptr != tab)
1847+ while (ptr < lim && *ptr != tab[0])
1848 ++ptr;
1849 if (ptr < lim)
1850 ++ptr;
1851@@ -1282,11 +1409,70 @@
1852 return ptr;
1853 }
1854
1855+#if HAVE_MBRTOWC
1856+static char *
1857+begfield_mb (const struct line *line, const struct keyfield *key)
1858+{
1859+ int i;
1860+ char *ptr = line->text, *lim = ptr + line->length - 1;
1861+ size_t sword = key->sword;
1862+ size_t schar = key->schar;
1863+ size_t mblength;
1864+ mbstate_t state;
1865+
1866+ memset (&state, '\0', sizeof(mbstate_t));
1867+
1868+ if (tab_length)
1869+ while (ptr < lim && sword--)
1870+ {
1871+ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
1872+ {
1873+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1874+ ptr += mblength;
1875+ }
1876+ if (ptr < lim)
1877+ {
1878+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1879+ ptr += mblength;
1880+ }
1881+ }
1882+ else
1883+ while (ptr < lim && sword--)
1884+ {
1885+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
1886+ ptr += mblength;
1887+ if (ptr < lim)
1888+ {
1889+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1890+ ptr += mblength;
1891+ }
1892+ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
1893+ ptr += mblength;
1894+ }
1895+
1896+ if (key->skipsblanks)
1897+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
1898+ ptr += mblength;
1899+
1900+ for (i = 0; i < schar; i++)
1901+ {
1902+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1903+
1904+ if (ptr + mblength > lim)
1905+ break;
1906+ else
1907+ ptr += mblength;
1908+ }
1909+
1910+ return ptr;
1911+}
1912+#endif
1913+
1914 /* Return the limit of (a pointer to the first character after) the field
1915 in LINE specified by KEY. */
1916
1917 static char *
1918-limfield (const struct line *line, const struct keyfield *key)
1919+limfield_uni (const struct line *line, const struct keyfield *key)
1920 {
1921 char *ptr = line->text, *lim = ptr + line->length - 1;
1922 size_t eword = key->eword, echar = key->echar;
1923@@ -1299,10 +1485,10 @@
1924 `beginning' is the first character following the delimiting TAB.
1925 Otherwise, leave PTR pointing at the first `blank' character after
1926 the preceding field. */
1927- if (tab != TAB_DEFAULT)
1928+ if (tab_length)
1929 while (ptr < lim && eword--)
1930 {
1931- while (ptr < lim && *ptr != tab)
1932+ while (ptr < lim && *ptr != tab[0])
1933 ++ptr;
1934 if (ptr < lim && (eword | echar))
1935 ++ptr;
1936@@ -1348,10 +1534,10 @@
1937 */
1938
1939 /* Make LIM point to the end of (one byte past) the current field. */
1940- if (tab != TAB_DEFAULT)
1941+ if (tab_length)
1942 {
1943 char *newlim;
1944- newlim = memchr (ptr, tab, lim - ptr);
1945+ newlim = memchr (ptr, tab[0], lim - ptr);
1946 if (newlim)
1947 lim = newlim;
1948 }
1949@@ -1384,6 +1570,107 @@
1950 return ptr;
1951 }
1952
1953+#if HAVE_MBRTOWC
1954+static char *
1955+limfield_mb (const struct line *line, const struct keyfield *key)
1956+{
1957+ char *ptr = line->text, *lim = ptr + line->length - 1;
1958+ size_t eword = key->eword, echar = key->echar;
1959+ int i;
1960+ size_t mblength;
1961+ mbstate_t state;
1962+
1963+ memset (&state, '\0', sizeof(mbstate_t));
1964+
1965+ if (tab_length)
1966+ while (ptr < lim && eword--)
1967+ {
1968+ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
1969+ {
1970+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1971+ ptr += mblength;
1972+ }
1973+ if (ptr < lim && (eword | echar))
1974+ {
1975+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1976+ ptr += mblength;
1977+ }
1978+ }
1979+ else
1980+ while (ptr < lim && eword--)
1981+ {
1982+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
1983+ ptr += mblength;
1984+ if (ptr < lim)
1985+ {
1986+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1987+ ptr += mblength;
1988+ }
1989+ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
1990+ ptr += mblength;
1991+ }
1992+
1993+
1994+# ifdef POSIX_UNSPECIFIED
1995+ /* Make LIM point to the end of (one byte past) the current field. */
1996+ if (tab_length)
1997+ {
1998+ char *newlim, *p;
1999+
2000+ newlim = NULL;
2001+ for (p = ptr; p < lim;)
2002+ {
2003+ if (memcmp (p, tab, tab_length) == 0)
2004+ {
2005+ newlim = p;
2006+ break;
2007+ }
2008+
2009+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
2010+ p += mblength;
2011+ }
2012+ }
2013+ else
2014+ {
2015+ char *newlim;
2016+ newlim = ptr;
2017+
2018+ while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength))
2019+ newlim += mblength;
2020+ if (ptr < lim)
2021+ {
2022+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
2023+ ptr += mblength;
2024+ }
2025+ while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength))
2026+ newlim += mblength;
2027+ lim = newlim;
2028+ }
2029+# endif
2030+
2031+ /* If we're skipping leading blanks, don't start counting characters
2032+ * until after skipping past any leading blanks. */
2033+ if (key->skipsblanks)
2034+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
2035+ ptr += mblength;
2036+
2037+ memset (&state, '\0', sizeof(mbstate_t));
2038+
2039+ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
2040+ for (i = 0; i < echar; i++)
2041+ {
2042+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
2043+
2044+ if (ptr + mblength > lim)
2045+ break;
2046+ else
2047+ ptr += mblength;
2048+ }
2049+
2050+ return ptr;
2051+}
2052+#endif
2053+
2054 /* Fill BUF reading from FP, moving buf->left bytes from the end
2055 of buf->buf to the beginning first. If EOF is reached and the
2056 file wasn't terminated by a newline, supply one. Set up BUF's line
2057@@ -1466,8 +1753,24 @@
2058 else
2059 {
2060 if (key->skipsblanks)
2061- while (blanks[to_uchar (*line_start)])
2062- line_start++;
2063+ {
2064+#if HAVE_MBRTOWC
2065+ if (MB_CUR_MAX > 1)
2066+ {
2067+ size_t mblength;
2068+ mbstate_t state;
2069+ memset (&state, '\0', sizeof(mbstate_t));
2070+ while (line_start < line->keylim &&
2071+ ismbblank (line_start,
2072+ line->keylim - line_start,
2073+ &mblength))
2074+ line_start += mblength;
2075+ }
2076+ else
2077+#endif
2078+ while (blanks[to_uchar (*line_start)])
2079+ line_start++;
2080+ }
2081 line->keybeg = line_start;
2082 }
2083 }
2084@@ -1500,7 +1803,7 @@
2085 hideously fast. */
2086
2087 static int
2088-numcompare (const char *a, const char *b)
2089+numcompare_uni (const char *a, const char *b)
2090 {
2091 while (blanks[to_uchar (*a)])
2092 a++;
2093@@ -1510,6 +1813,25 @@
2094 return strnumcmp (a, b, decimal_point, thousands_sep);
2095 }
2096
2097+#if HAVE_MBRTOWC
2098+static int
2099+numcompare_mb (const char *a, const char *b)
2100+{
2101+ size_t mblength, len;
2102+ len = strlen (a); /* okay for UTF-8 */
2103+ while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
2104+ {
2105+ a += mblength;
2106+ len -= mblength;
2107+ }
2108+ len = strlen (b); /* okay for UTF-8 */
2109+ while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
2110+ b += mblength;
2111+
2112+ return strnumcmp (a, b, decimal_point, thousands_sep);
2113+}
2114+#endif /* HAV_EMBRTOWC */
2115+
2116 static int
2117 general_numcompare (const char *sa, const char *sb)
2118 {
2119@@ -1543,7 +1865,7 @@
2120 Return 0 if the name in S is not recognized. */
2121
2122 static int
2123-getmonth (char const *month, size_t len)
2124+getmonth_uni (char const *month, size_t len)
2125 {
2126 size_t lo = 0;
2127 size_t hi = MONTHS_PER_YEAR;
2128@@ -1698,11 +2020,79 @@
2129 return diff;
2130 }
2131
2132+#if HAVE_MBRTOWC
2133+static int
2134+getmonth_mb (const char *s, size_t len)
2135+{
2136+ char *month;
2137+ register size_t i;
2138+ register int lo = 0, hi = MONTHS_PER_YEAR, result;
2139+ char *tmp;
2140+ size_t wclength, mblength;
2141+ const char **pp;
2142+ const wchar_t **wpp;
2143+ wchar_t *month_wcs;
2144+ mbstate_t state;
2145+
2146+ while (len > 0 && ismbblank (s, len, &mblength))
2147+ {
2148+ s += mblength;
2149+ len -= mblength;
2150+ }
2151+
2152+ if (len == 0)
2153+ return 0;
2154+
2155+ month = (char *) alloca (len + 1);
2156+
2157+ tmp = (char *) alloca (len + 1);
2158+ memcpy (tmp, s, len);
2159+ tmp[len] = '\0';
2160+ pp = (const char **)&tmp;
2161+ month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t));
2162+ memset (&state, '\0', sizeof(mbstate_t));
2163+
2164+ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
2165+ assert (wclength != (size_t)-1 && *pp == NULL);
2166+
2167+ for (i = 0; i < wclength; i++)
2168+ {
2169+ month_wcs[i] = towupper(month_wcs[i]);
2170+ if (iswblank (month_wcs[i]))
2171+ {
2172+ month_wcs[i] = L'\0';
2173+ break;
2174+ }
2175+ }
2176+
2177+ wpp = (const wchar_t **)&month_wcs;
2178+
2179+ mblength = wcsrtombs (month, wpp, len + 1, &state);
2180+ assert (mblength != (-1) && *wpp == NULL);
2181+
2182+ do
2183+ {
2184+ int ix = (lo + hi) / 2;
2185+
2186+ if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0)
2187+ hi = ix;
2188+ else
2189+ lo = ix;
2190+ }
2191+ while (hi - lo > 1);
2192+
2193+ result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
2194+ ? monthtab[lo].val : 0);
2195+
2196+ return result;
2197+}
2198+#endif
2199+
2200 /* Compare two lines A and B trying every key in sequence until there
2201 are no more keys or a difference is found. */
2202
2203 static int
2204-keycompare (const struct line *a, const struct line *b)
2205+keycompare_uni (const struct line *a, const struct line *b)
2206 {
2207 struct keyfield const *key = keylist;
2208
2209@@ -1875,6 +2265,179 @@
2210 return key->reverse ? -diff : diff;
2211 }
2212
2213+#if HAVE_MBRTOWC
2214+static int
2215+keycompare_mb (const struct line *a, const struct line *b)
2216+{
2217+ struct keyfield *key = keylist;
2218+
2219+ /* For the first iteration only, the key positions have been
2220+ precomputed for us. */
2221+ char *texta = a->keybeg;
2222+ char *textb = b->keybeg;
2223+ char *lima = a->keylim;
2224+ char *limb = b->keylim;
2225+
2226+ size_t mblength_a, mblength_b;
2227+ wchar_t wc_a, wc_b;
2228+ mbstate_t state_a, state_b;
2229+
2230+ int diff;
2231+
2232+ memset (&state_a, '\0', sizeof(mbstate_t));
2233+ memset (&state_b, '\0', sizeof(mbstate_t));
2234+
2235+ for (;;)
2236+ {
2237+ unsigned char *translate = (unsigned char *) key->translate;
2238+ bool const *ignore = key->ignore;
2239+
2240+ /* Find the lengths. */
2241+ size_t lena = lima <= texta ? 0 : lima - texta;
2242+ size_t lenb = limb <= textb ? 0 : limb - textb;
2243+
2244+ /* Actually compare the fields. */
2245+ if (key->random)
2246+ diff = compare_random (texta, lena, textb, lenb);
2247+ else if (key->numeric | key->general_numeric)
2248+ {
2249+ char savea = *lima, saveb = *limb;
2250+
2251+ *lima = *limb = '\0';
2252+ if (force_general_numcompare)
2253+ diff = general_numcompare (texta, textb);
2254+ else
2255+ diff = ((key->numeric ? numcompare : general_numcompare)
2256+ (texta, textb));
2257+ *lima = savea, *limb = saveb;
2258+ }
2259+ else if (key->month)
2260+ diff = getmonth (texta, lena) - getmonth (textb, lenb);
2261+ else
2262+ {
2263+ if (ignore || translate)
2264+ {
2265+ char *copy_a = (char *) alloca (lena + 1 + lenb + 1);
2266+ char *copy_b = copy_a + lena + 1;
2267+ size_t new_len_a, new_len_b;
2268+ size_t i, j;
2269+
2270+ /* Ignore and/or translate chars before comparing. */
2271+# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \
2272+ do \
2273+ { \
2274+ wchar_t uwc; \
2275+ char mbc[MB_LEN_MAX]; \
2276+ mbstate_t state_wc; \
2277+ \
2278+ for (NEW_LEN = i = 0; i < LEN;) \
2279+ { \
2280+ mbstate_t state_bak; \
2281+ \
2282+ state_bak = STATE; \
2283+ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \
2284+ \
2285+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \
2286+ || MBLENGTH == 0) \
2287+ { \
2288+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \
2289+ STATE = state_bak; \
2290+ if (!ignore) \
2291+ COPY[NEW_LEN++] = TEXT[i++]; \
2292+ continue; \
2293+ } \
2294+ \
2295+ if (ignore) \
2296+ { \
2297+ if ((ignore == nonprinting && !iswprint (WC)) \
2298+ || (ignore == nondictionary \
2299+ && !iswalnum (WC) && !iswblank (WC))) \
2300+ { \
2301+ i += MBLENGTH; \
2302+ continue; \
2303+ } \
2304+ } \
2305+ \
2306+ if (translate) \
2307+ { \
2308+ \
2309+ uwc = towupper(WC); \
2310+ if (WC == uwc) \
2311+ { \
2312+ memcpy (mbc, TEXT + i, MBLENGTH); \
2313+ i += MBLENGTH; \
2314+ } \
2315+ else \
2316+ { \
2317+ i += MBLENGTH; \
2318+ WC = uwc; \
2319+ memset (&state_wc, '\0', sizeof (mbstate_t)); \
2320+ \
2321+ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \
2322+ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \
2323+ } \
2324+ \
2325+ for (j = 0; j < MBLENGTH; j++) \
2326+ COPY[NEW_LEN++] = mbc[j]; \
2327+ } \
2328+ else \
2329+ for (j = 0; j < MBLENGTH; j++) \
2330+ COPY[NEW_LEN++] = TEXT[i++]; \
2331+ } \
2332+ COPY[NEW_LEN] = '\0'; \
2333+ } \
2334+ while (0)
2335+ IGNORE_CHARS (new_len_a, lena, texta, copy_a,
2336+ wc_a, mblength_a, state_a);
2337+ IGNORE_CHARS (new_len_b, lenb, textb, copy_b,
2338+ wc_b, mblength_b, state_b);
2339+ diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b);
2340+ }
2341+ else if (lena == 0)
2342+ diff = - NONZERO (lenb);
2343+ else if (lenb == 0)
2344+ goto greater;
2345+ else
2346+ diff = xmemcoll (texta, lena, textb, lenb);
2347+ }
2348+
2349+ if (diff)
2350+ goto not_equal;
2351+
2352+ key = key->next;
2353+ if (! key)
2354+ break;
2355+
2356+ /* Find the beginning and limit of the next field. */
2357+ if (key->eword != -1)
2358+ lima = limfield (a, key), limb = limfield (b, key);
2359+ else
2360+ lima = a->text + a->length - 1, limb = b->text + b->length - 1;
2361+
2362+ if (key->sword != -1)
2363+ texta = begfield (a, key), textb = begfield (b, key);
2364+ else
2365+ {
2366+ texta = a->text, textb = b->text;
2367+ if (key->skipsblanks)
2368+ {
2369+ while (texta < lima && ismbblank (texta, lima - texta, &mblength_a))
2370+ texta += mblength_a;
2371+ while (textb < limb && ismbblank (textb, limb - textb, &mblength_b))
2372+ textb += mblength_b;
2373+ }
2374+ }
2375+ }
2376+
2377+ return 0;
2378+
2379+greater:
2380+ diff = 1;
2381+not_equal:
2382+ return key->reverse ? -diff : diff;
2383+}
2384+#endif
2385+
2386 /* Compare two lines A and B, returning negative, zero, or positive
2387 depending on whether A compares less than, equal to, or greater than B. */
2388
2389@@ -2744,7 +3305,7 @@
2390 initialize_exit_failure (SORT_FAILURE);
2391
2392 hard_LC_COLLATE = hard_locale (LC_COLLATE);
2393-#if HAVE_NL_LANGINFO
2394+#if HAVE_LANGINFO_CODESET
2395 hard_LC_TIME = hard_locale (LC_TIME);
2396 #endif
2397
2398@@ -2765,6 +3326,27 @@
2399 thousands_sep = -1;
2400 }
2401
2402+#if HAVE_MBRTOWC
2403+ if (MB_CUR_MAX > 1)
2404+ {
2405+ inittables = inittables_mb;
2406+ begfield = begfield_mb;
2407+ limfield = limfield_mb;
2408+ getmonth = getmonth_mb;
2409+ keycompare = keycompare_mb;
2410+ numcompare = numcompare_mb;
2411+ }
2412+ else
2413+#endif
2414+ {
2415+ inittables = inittables_uni;
2416+ begfield = begfield_uni;
2417+ limfield = limfield_uni;
2418+ getmonth = getmonth_uni;
2419+ keycompare = keycompare_uni;
2420+ numcompare = numcompare_uni;
2421+ }
2422+
2423 have_read_stdin = false;
2424 inittables ();
2425
2426@@ -3015,13 +3597,35 @@
2427
2428 case 't':
2429 {
2430- char newtab = optarg[0];
2431- if (! newtab)
2432+ char newtab[MB_LEN_MAX + 1];
2433+ size_t newtab_length = 1;
2434+ strncpy (newtab, optarg, MB_LEN_MAX);
2435+ if (! newtab[0])
2436 error (SORT_FAILURE, 0, _("empty tab"));
2437- if (optarg[1])
2438+#if HAVE_MBRTOWC
2439+ if (MB_CUR_MAX > 1)
2440+ {
2441+ wchar_t wc;
2442+ mbstate_t state;
2443+ size_t i;
2444+
2445+ memset (&state, '\0', sizeof (mbstate_t));
2446+ newtab_length = mbrtowc (&wc, newtab, strnlen (newtab,
2447+ MB_LEN_MAX),
2448+ &state);
2449+ switch (newtab_length)
2450+ {
2451+ case (size_t) -1:
2452+ case (size_t) -2:
2453+ case 0:
2454+ newtab_length = 1;
2455+ }
2456+ }
2457+#endif
2458+ if (newtab_length == 1 && optarg[1])
2459 {
2460 if (STREQ (optarg, "\\0"))
2461- newtab = '\0';
2462+ newtab[0] = '\0';
2463 else
2464 {
2465 /* Provoke with `sort -txx'. Complain about
2466@@ -3032,9 +3636,12 @@
2467 quote (optarg));
2468 }
2469 }
2470- if (tab != TAB_DEFAULT && tab != newtab)
2471+ if (tab_length
2472+ && (tab_length != newtab_length
2473+ || memcmp (tab, newtab, tab_length) != 0))
2474 error (SORT_FAILURE, 0, _("incompatible tabs"));
2475- tab = newtab;
2476+ memcpy (tab, newtab, newtab_length);
2477+ tab_length = newtab_length;
2478 }
2479 break;
2480
2481--- coreutils-6.8+/src/unexpand.c.i18n 2007-01-14 15:41:28.000000000 +0000
2482+++ coreutils-6.8+/src/unexpand.c 2007-03-01 15:08:24.000000000 +0000
2483@@ -39,11 +39,28 @@
2484 #include <stdio.h>
2485 #include <getopt.h>
2486 #include <sys/types.h>
2487+
2488+/* Get mbstate_t, mbrtowc(), wcwidth(). */
2489+#if HAVE_WCHAR_H
2490+# include <wchar.h>
2491+#endif
2492+
2493 #include "system.h"
2494 #include "error.h"
2495 #include "quote.h"
2496 #include "xstrndup.h"
2497
2498+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
2499+ installation; work around this configuration error. */
2500+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
2501+# define MB_LEN_MAX 16
2502+#endif
2503+
2504+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
2505+#if HAVE_MBRTOWC && defined mbstate_t
2506+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
2507+#endif
2508+
2509 /* The official name of this program (e.g., no `g' prefix). */
2510 #define PROGRAM_NAME "unexpand"
2511
2512@@ -110,6 +127,208 @@
2513 {NULL, 0, NULL, 0}
2514 };
2515
2516+static FILE *next_file (FILE *fp);
2517+
2518+#if HAVE_MBRTOWC
2519+static void
2520+unexpand_multibyte (void)
2521+{
2522+ FILE *fp; /* Input stream. */
2523+ mbstate_t i_state; /* Current shift state of the input stream. */
2524+ mbstate_t i_state_bak; /* Back up the I_STATE. */
2525+ mbstate_t o_state; /* Current shift state of the output stream. */
2526+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
2527+ char *bufpos; /* Next read position of BUF. */
2528+ size_t buflen = 0; /* The length of the byte sequence in buf. */
2529+ wint_t wc; /* A gotten wide character. */
2530+ size_t mblength; /* The byte size of a multibyte character
2531+ which shows as same character as WC. */
2532+
2533+ /* Index in `tab_list' of next tabstop: */
2534+ int tab_index = 0; /* For calculating width of pending tabs. */
2535+ int print_tab_index = 0; /* For printing as many tabs as possible. */
2536+ unsigned int column = 0; /* Column on screen of next char. */
2537+ int next_tab_column; /* Column the next tab stop is on. */
2538+ int convert = 1; /* If nonzero, perform translations. */
2539+ unsigned int pending = 0; /* Pending columns of blanks. */
2540+
2541+ fp = next_file ((FILE *) NULL);
2542+ if (fp == NULL)
2543+ return;
2544+
2545+ memset (&o_state, '\0', sizeof(mbstate_t));
2546+ memset (&i_state, '\0', sizeof(mbstate_t));
2547+
2548+ for (;;)
2549+ {
2550+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
2551+ {
2552+ memmove (buf, bufpos, buflen);
2553+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
2554+ bufpos = buf;
2555+ }
2556+
2557+ /* Get a wide character. */
2558+ if (buflen < 1)
2559+ {
2560+ mblength = 1;
2561+ wc = WEOF;
2562+ }
2563+ else
2564+ {
2565+ i_state_bak = i_state;
2566+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state);
2567+ }
2568+
2569+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
2570+ {
2571+ i_state = i_state_bak;
2572+ wc = L'\0';
2573+ }
2574+
2575+ if (wc == L' ' && convert && column < INT_MAX)
2576+ {
2577+ ++pending;
2578+ ++column;
2579+ }
2580+ else if (wc == L'\t' && convert)
2581+ {
2582+ if (tab_size == 0)
2583+ {
2584+ /* Do not let tab_index == first_free_tab;
2585+ stop when it is 1 less. */
2586+ while (tab_index < first_free_tab - 1
2587+ && column >= tab_list[tab_index])
2588+ tab_index++;
2589+ next_tab_column = tab_list[tab_index];
2590+ if (tab_index < first_free_tab - 1)
2591+ tab_index++;
2592+ if (column >= next_tab_column)
2593+ {
2594+ convert = 0; /* Ran out of tab stops. */
2595+ goto flush_pend_mb;
2596+ }
2597+ }
2598+ else
2599+ {
2600+ next_tab_column = column + tab_size - column % tab_size;
2601+ }
2602+ pending += next_tab_column - column;
2603+ column = next_tab_column;
2604+ }
2605+ else
2606+ {
2607+flush_pend_mb:
2608+ /* Flush pending spaces. Print as many tabs as possible,
2609+ then print the rest as spaces. */
2610+ if (pending == 1)
2611+ {
2612+ putchar (' ');
2613+ pending = 0;
2614+ }
2615+ column -= pending;
2616+ while (pending > 0)
2617+ {
2618+ if (tab_size == 0)
2619+ {
2620+ /* Do not let print_tab_index == first_free_tab;
2621+ stop when it is 1 less. */
2622+ while (print_tab_index < first_free_tab - 1
2623+ && column >= tab_list[print_tab_index])
2624+ print_tab_index++;
2625+ next_tab_column = tab_list[print_tab_index];
2626+ if (print_tab_index < first_free_tab - 1)
2627+ print_tab_index++;
2628+ }
2629+ else
2630+ {
2631+ next_tab_column =
2632+ column + tab_size - column % tab_size;
2633+ }
2634+ if (next_tab_column - column <= pending)
2635+ {
2636+ putchar ('\t');
2637+ pending -= next_tab_column - column;
2638+ column = next_tab_column;
2639+ }
2640+ else
2641+ {
2642+ --print_tab_index;
2643+ column += pending;
2644+ while (pending != 0)
2645+ {
2646+ putchar (' ');
2647+ pending--;
2648+ }
2649+ }
2650+ }
2651+
2652+ if (wc == WEOF)
2653+ {
2654+ fp = next_file (fp);
2655+ if (fp == NULL)
2656+ break; /* No more files. */
2657+ else
2658+ {
2659+ memset (&i_state, '\0', sizeof(mbstate_t));
2660+ continue;
2661+ }
2662+ }
2663+
2664+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
2665+ {
2666+ if (convert)
2667+ {
2668+ ++column;
2669+ if (convert_entire_line == 0)
2670+ convert = 0;
2671+ }
2672+ mblength = 1;
2673+ putchar (buf[0]);
2674+ }
2675+ else if (mblength == 0)
2676+ {
2677+ if (convert && convert_entire_line == 0)
2678+ convert = 0;
2679+ mblength = 1;
2680+ putchar ('\0');
2681+ }
2682+ else
2683+ {
2684+ if (convert)
2685+ {
2686+ if (wc == L'\b')
2687+ {
2688+ if (column > 0)
2689+ --column;
2690+ }
2691+ else
2692+ {
2693+ int width; /* The width of WC. */
2694+
2695+ width = wcwidth (wc);
2696+ column += (width > 0) ? width : 0;
2697+ if (convert_entire_line == 0)
2698+ convert = 0;
2699+ }
2700+ }
2701+
2702+ if (wc == L'\n')
2703+ {
2704+ tab_index = print_tab_index = 0;
2705+ column = pending = 0;
2706+ convert = 1;
2707+ }
2708+ fwrite (bufpos, sizeof(char), mblength, stdout);
2709+ }
2710+ }
2711+ buflen -= mblength;
2712+ bufpos += mblength;
2713+ }
2714+}
2715+#endif
2716+
2717+
2718 void
2719 usage (int status)
2720 {
2721@@ -531,7 +750,12 @@
2722
2723 file_list = (optind < argc ? &argv[optind] : stdin_argv);
2724
2725- unexpand ();
2726+#if HAVE_MBRTOWC
2727+ if (MB_CUR_MAX > 1)
2728+ unexpand_multibyte ();
2729+ else
2730+#endif
2731+ unexpand ();
2732
2733 if (have_read_stdin && fclose (stdin) != 0)
2734 error (EXIT_FAILURE, errno, "-");
2735--- coreutils-6.8+/src/pr.c.i18n 2007-01-14 15:41:28.000000000 +0000
2736+++ coreutils-6.8+/src/pr.c 2007-03-01 15:08:24.000000000 +0000
2737@@ -313,6 +313,32 @@
2738
2739 #include <getopt.h>
2740 #include <sys/types.h>
2741+
2742+/* Get MB_LEN_MAX. */
2743+#include <limits.h>
2744+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
2745+ installation; work around this configuration error. */
2746+#if !defined MB_LEN_MAX || MB_LEN_MAX == 1
2747+# define MB_LEN_MAX 16
2748+#endif
2749+
2750+/* Get MB_CUR_MAX. */
2751+#include <stdlib.h>
2752+
2753+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
2754+/* Get mbstate_t, mbrtowc(), wcwidth(). */
2755+#if HAVE_WCHAR_H
2756+# include <wchar.h>
2757+#endif
2758+
2759+/* Get iswprint(). -- for wcwidth(). */
2760+#if HAVE_WCTYPE_H
2761+# include <wctype.h>
2762+#endif
2763+#if !defined iswprint && !HAVE_ISWPRINT
2764+# define iswprint(wc) 1
2765+#endif
2766+
2767 #include "system.h"
2768 #include "error.h"
2769 #include "hard-locale.h"
2770@@ -324,6 +350,18 @@
2771 #include "strftime.h"
2772 #include "xstrtol.h"
2773
2774+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
2775+#if HAVE_MBRTOWC && defined mbstate_t
2776+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
2777+#endif
2778+
2779+#ifndef HAVE_DECL_WCWIDTH
2780+"this configure-time declaration test was not run"
2781+#endif
2782+#if !HAVE_DECL_WCWIDTH
2783+extern int wcwidth ();
2784+#endif
2785+
2786 /* The official name of this program (e.g., no `g' prefix). */
2787 #define PROGRAM_NAME "pr"
2788
2789@@ -416,7 +454,20 @@
2790
2791 #define NULLCOL (COLUMN *)0
2792
2793-static int char_to_clump (char c);
2794+/* Funtion pointers to switch functions for single byte locale or for
2795+ multibyte locale. If multibyte functions do not exist in your sysytem,
2796+ these pointers always point the function for single byte locale. */
2797+static void (*print_char) (char c);
2798+static int (*char_to_clump) (char c);
2799+
2800+/* Functions for single byte locale. */
2801+static void print_char_single (char c);
2802+static int char_to_clump_single (char c);
2803+
2804+/* Functions for multibyte locale. */
2805+static void print_char_multi (char c);
2806+static int char_to_clump_multi (char c);
2807+
2808 static bool read_line (COLUMN *p);
2809 static bool print_page (void);
2810 static bool print_stored (COLUMN *p);
2811@@ -426,6 +477,7 @@
2812 static void pad_across_to (int position);
2813 static void add_line_number (COLUMN *p);
2814 static void getoptarg (char *arg, char switch_char, char *character,
2815+ int *character_length, int *character_width,
2816 int *number);
2817 void usage (int status);
2818 static void print_files (int number_of_files, char **av);
2819@@ -440,7 +492,6 @@
2820 static void pad_down (int lines);
2821 static void read_rest_of_line (COLUMN *p);
2822 static void skip_read (COLUMN *p, int column_number);
2823-static void print_char (char c);
2824 static void cleanup (void);
2825 static void print_sep_string (void);
2826 static void separator_string (const char *optarg_S);
2827@@ -455,7 +506,7 @@
2828 we store the leftmost columns contiguously in buff.
2829 To print a line from buff, get the index of the first character
2830 from line_vector[i], and print up to line_vector[i + 1]. */
2831-static char *buff;
2832+static unsigned char *buff;
2833
2834 /* Index of the position in buff where the next character
2835 will be stored. */
2836@@ -559,7 +610,7 @@
2837 static bool untabify_input = false;
2838
2839 /* (-e) The input tab character. */
2840-static char input_tab_char = '\t';
2841+static char input_tab_char[MB_LEN_MAX] = "\t";
2842
2843 /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
2844 where the leftmost column is 1. */
2845@@ -569,7 +620,10 @@
2846 static bool tabify_output = false;
2847
2848 /* (-i) The output tab character. */
2849-static char output_tab_char = '\t';
2850+static char output_tab_char[MB_LEN_MAX] = "\t";
2851+
2852+/* (-i) The byte length of output tab character. */
2853+static int output_tab_char_length = 1;
2854
2855 /* (-i) The width of the output tab. */
2856 static int chars_per_output_tab = 8;
2857@@ -643,7 +697,13 @@
2858 static bool numbered_lines = false;
2859
2860 /* (-n) Character which follows each line number. */
2861-static char number_separator = '\t';
2862+static char number_separator[MB_LEN_MAX] = "\t";
2863+
2864+/* (-n) The byte length of the character which follows each line number. */
2865+static int number_separator_length = 1;
2866+
2867+/* (-n) The character width of the character which follows each line number. */
2868+static int number_separator_width = 0;
2869
2870 /* (-n) line counting starts with 1st line of input file (not with 1st
2871 line of 1st page printed). */
2872@@ -696,6 +756,7 @@
2873 -a|COLUMN|-m is a `space' and with the -J option a `tab'. */
2874 static char *col_sep_string = "";
2875 static int col_sep_length = 0;
2876+static int col_sep_width = 0;
2877 static char *column_separator = " ";
2878 static char *line_separator = "\t";
2879
2880@@ -852,6 +913,13 @@
2881 col_sep_length = (int) strlen (optarg_S);
2882 col_sep_string = xmalloc (col_sep_length + 1);
2883 strcpy (col_sep_string, optarg_S);
2884+
2885+#if HAVE_MBRTOWC
2886+ if (MB_CUR_MAX > 1)
2887+ col_sep_width = mbswidth (col_sep_string, 0);
2888+ else
2889+#endif
2890+ col_sep_width = col_sep_length;
2891 }
2892
2893 int
2894@@ -877,6 +945,21 @@
2895
2896 atexit (close_stdout);
2897
2898+/* Define which functions are used, the ones for single byte locale or the ones
2899+ for multibyte locale. */
2900+#if HAVE_MBRTOWC
2901+ if (MB_CUR_MAX > 1)
2902+ {
2903+ print_char = print_char_multi;
2904+ char_to_clump = char_to_clump_multi;
2905+ }
2906+ else
2907+#endif
2908+ {
2909+ print_char = print_char_single;
2910+ char_to_clump = char_to_clump_single;
2911+ }
2912+
2913 n_files = 0;
2914 file_names = (argc > 1
2915 ? xmalloc ((argc - 1) * sizeof (char *))
2916@@ -949,8 +1032,12 @@
2917 break;
2918 case 'e':
2919 if (optarg)
2920- getoptarg (optarg, 'e', &input_tab_char,
2921- &chars_per_input_tab);
2922+ {
2923+ int dummy_length, dummy_width;
2924+
2925+ getoptarg (optarg, 'e', input_tab_char, &dummy_length,
2926+ &dummy_width, &chars_per_input_tab);
2927+ }
2928 /* Could check tab width > 0. */
2929 untabify_input = true;
2930 break;
2931@@ -963,8 +1050,12 @@
2932 break;
2933 case 'i':
2934 if (optarg)
2935- getoptarg (optarg, 'i', &output_tab_char,
2936- &chars_per_output_tab);
2937+ {
2938+ int dummy_width;
2939+
2940+ getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length,
2941+ &dummy_width, &chars_per_output_tab);
2942+ }
2943 /* Could check tab width > 0. */
2944 tabify_output = true;
2945 break;
2946@@ -991,8 +1082,8 @@
2947 case 'n':
2948 numbered_lines = true;
2949 if (optarg)
2950- getoptarg (optarg, 'n', &number_separator,
2951- &chars_per_number);
2952+ getoptarg (optarg, 'n', number_separator, &number_separator_length,
2953+ &number_separator_width, &chars_per_number);
2954 break;
2955 case 'N':
2956 skip_count = false;
2957@@ -1031,7 +1122,7 @@
2958 old_s = false;
2959 /* Reset an additional input of -s, -S dominates -s */
2960 col_sep_string = "";
2961- col_sep_length = 0;
2962+ col_sep_length = col_sep_width = 0;
2963 use_col_separator = true;
2964 if (optarg)
2965 separator_string (optarg);
2966@@ -1188,10 +1279,45 @@
2967 a number. */
2968
2969 static void
2970-getoptarg (char *arg, char switch_char, char *character, int *number)
2971+getoptarg (char *arg, char switch_char, char *character, int *character_length,
2972+ int *character_width, int *number)
2973 {
2974 if (!ISDIGIT (*arg))
2975- *character = *arg++;
2976+ {
2977+#ifdef HAVE_MBRTOWC
2978+ if (MB_CUR_MAX > 1) /* for multibyte locale. */
2979+ {
2980+ wchar_t wc;
2981+ size_t mblength;
2982+ int width;
2983+ mbstate_t state = {'\0'};
2984+
2985+ mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state);
2986+
2987+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
2988+ {
2989+ *character_length = 1;
2990+ *character_width = 1;
2991+ }
2992+ else
2993+ {
2994+ *character_length = (mblength < 1) ? 1 : mblength;
2995+ width = wcwidth (wc);
2996+ *character_width = (width < 0) ? 0 : width;
2997+ }
2998+
2999+ strncpy (character, arg, *character_length);
3000+ arg += *character_length;
3001+ }
3002+ else /* for single byte locale. */
3003+#endif
3004+ {
3005+ *character = *arg++;
3006+ *character_length = 1;
3007+ *character_width = 1;
3008+ }
3009+ }
3010+
3011 if (*arg)
3012 {
3013 long int tmp_long;
3014@@ -1256,7 +1382,7 @@
3015 else
3016 col_sep_string = column_separator;
3017
3018- col_sep_length = 1;
3019+ col_sep_length = col_sep_width = 1;
3020 use_col_separator = true;
3021 }
3022 /* It's rather pointless to define a TAB separator with column
3023@@ -1288,11 +1414,11 @@
3024 TAB_WIDTH (chars_per_input_tab, chars_per_number); */
3025
3026 /* Estimate chars_per_text without any margin and keep it constant. */
3027- if (number_separator == '\t')
3028+ if (number_separator[0] == '\t')
3029 number_width = chars_per_number +
3030 TAB_WIDTH (chars_per_default_tab, chars_per_number);
3031 else
3032- number_width = chars_per_number + 1;
3033+ number_width = chars_per_number + number_separator_width;
3034
3035 /* The number is part of the column width unless we are
3036 printing files in parallel. */
3037@@ -1307,7 +1433,7 @@
3038 }
3039
3040 chars_per_column = (chars_per_line - chars_used_by_number -
3041- (columns - 1) * col_sep_length) / columns;
3042+ (columns - 1) * col_sep_width) / columns;
3043
3044 if (chars_per_column < 1)
3045 error (EXIT_FAILURE, 0, _("page width too narrow"));
3046@@ -1432,7 +1558,7 @@
3047
3048 /* Enlarge p->start_position of first column to use the same form of
3049 padding_not_printed with all columns. */
3050- h = h + col_sep_length;
3051+ h = h + col_sep_width;
3052
3053 /* This loop takes care of all but the rightmost column. */
3054
3055@@ -1466,7 +1592,7 @@
3056 }
3057 else
3058 {
3059- h = h_next + col_sep_length;
3060+ h = h_next + col_sep_width;
3061 h_next = h + chars_per_column;
3062 }
3063 }
3064@@ -1756,9 +1882,9 @@
3065 align_column (COLUMN *p)
3066 {
3067 padding_not_printed = p->start_position;
3068- if (padding_not_printed - col_sep_length > 0)
3069+ if (padding_not_printed - col_sep_width > 0)
3070 {
3071- pad_across_to (padding_not_printed - col_sep_length);
3072+ pad_across_to (padding_not_printed - col_sep_width);
3073 padding_not_printed = ANYWHERE;
3074 }
3075
3076@@ -2029,13 +2155,13 @@
3077 /* May be too generous. */
3078 buff = X2REALLOC (buff, &buff_allocated);
3079 }
3080- buff[buff_current++] = c;
3081+ buff[buff_current++] = (unsigned char) c;
3082 }
3083
3084 static void
3085 add_line_number (COLUMN *p)
3086 {
3087- int i;
3088+ int i, j;
3089 char *s;
3090 int left_cut;
3091
3092@@ -2058,22 +2184,24 @@
3093 /* Tabification is assumed for multiple columns, also for n-separators,
3094 but `default n-separator = TAB' hasn't been given priority over
3095 equal column_width also specified by POSIX. */
3096- if (number_separator == '\t')
3097+ if (number_separator[0] == '\t')
3098 {
3099 i = number_width - chars_per_number;
3100 while (i-- > 0)
3101 (p->char_func) (' ');
3102 }
3103 else
3104- (p->char_func) (number_separator);
3105+ for (j = 0; j < number_separator_length; j++)
3106+ (p->char_func) (number_separator[j]);
3107 }
3108 else
3109 /* To comply with POSIX, we avoid any expansion of default TAB
3110 separator with a single column output. No column_width requirement
3111 has to be considered. */
3112 {
3113- (p->char_func) (number_separator);
3114- if (number_separator == '\t')
3115+ for (j = 0; j < number_separator_length; j++)
3116+ (p->char_func) (number_separator[j]);
3117+ if (number_separator[0] == '\t')
3118 output_position = POS_AFTER_TAB (chars_per_output_tab,
3119 output_position);
3120 }
3121@@ -2234,7 +2362,7 @@
3122 while (goal - h_old > 1
3123 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
3124 {
3125- putchar (output_tab_char);
3126+ fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout);
3127 h_old = h_new;
3128 }
3129 while (++h_old <= goal)
3130@@ -2254,6 +2382,7 @@
3131 {
3132 char *s;
3133 int l = col_sep_length;
3134+ int not_space_flag;
3135
3136 s = col_sep_string;
3137
3138@@ -2267,6 +2396,7 @@
3139 {
3140 for (; separators_not_printed > 0; --separators_not_printed)
3141 {
3142+ not_space_flag = 0;
3143 while (l-- > 0)
3144 {
3145 /* 3 types of sep_strings: spaces only, spaces and chars,
3146@@ -2280,12 +2410,15 @@
3147 }
3148 else
3149 {
3150+ not_space_flag = 1;
3151 if (spaces_not_printed > 0)
3152 print_white_space ();
3153 putchar (*s++);
3154- ++output_position;
3155 }
3156 }
3157+ if (not_space_flag)
3158+ output_position += col_sep_width;
3159+
3160 /* sep_string ends with some spaces */
3161 if (spaces_not_printed > 0)
3162 print_white_space ();
3163@@ -2313,7 +2446,7 @@
3164 required number of tabs and spaces. */
3165
3166 static void
3167-print_char (char c)
3168+print_char_single (char c)
3169 {
3170 if (tabify_output)
3171 {
3172@@ -2337,6 +2470,74 @@
3173 putchar (c);
3174 }
3175
3176+#ifdef HAVE_MBRTOWC
3177+static void
3178+print_char_multi (char c)
3179+{
3180+ static size_t mbc_pos = 0;
3181+ static char mbc[MB_LEN_MAX] = {'\0'};
3182+ static mbstate_t state = {'\0'};
3183+ mbstate_t state_bak;
3184+ wchar_t wc;
3185+ size_t mblength;
3186+ int width;
3187+
3188+ if (tabify_output)
3189+ {
3190+ state_bak = state;
3191+ mbc[mbc_pos++] = c;
3192+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
3193+
3194+ while (mbc_pos > 0)
3195+ {
3196+ switch (mblength)
3197+ {
3198+ case (size_t)-2:
3199+ state = state_bak;
3200+ return;
3201+
3202+ case (size_t)-1:
3203+ state = state_bak;
3204+ ++output_position;
3205+ putchar (mbc[0]);
3206+ memmove (mbc, mbc + 1, MB_CUR_MAX - 1);
3207+ --mbc_pos;
3208+ break;
3209+
3210+ case 0:
3211+ mblength = 1;
3212+
3213+ default:
3214+ if (wc == L' ')
3215+ {
3216+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
3217+ --mbc_pos;
3218+ ++spaces_not_printed;
3219+ return;
3220+ }
3221+ else if (spaces_not_printed > 0)
3222+ print_white_space ();
3223+
3224+ /* Nonprintables are assumed to have width 0, except L'\b'. */
3225+ if ((width = wcwidth (wc)) < 1)
3226+ {
3227+ if (wc == L'\b')
3228+ --output_position;
3229+ }
3230+ else
3231+ output_position += width;
3232+
3233+ fwrite (mbc, sizeof(char), mblength, stdout);
3234+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
3235+ mbc_pos -= mblength;
3236+ }
3237+ }
3238+ return;
3239+ }
3240+ putchar (c);
3241+}
3242+#endif
3243+
3244 /* Skip to page PAGE before printing.
3245 PAGE may be larger than total number of pages. */
3246
3247@@ -2517,9 +2718,9 @@
3248 align_empty_cols = false;
3249 }
3250
3251- if (padding_not_printed - col_sep_length > 0)
3252+ if (padding_not_printed - col_sep_width > 0)
3253 {
3254- pad_across_to (padding_not_printed - col_sep_length);
3255+ pad_across_to (padding_not_printed - col_sep_width);
3256 padding_not_printed = ANYWHERE;
3257 }
3258
3259@@ -2620,9 +2821,9 @@
3260 }
3261 }
3262
3263- if (padding_not_printed - col_sep_length > 0)
3264+ if (padding_not_printed - col_sep_width > 0)
3265 {
3266- pad_across_to (padding_not_printed - col_sep_length);
3267+ pad_across_to (padding_not_printed - col_sep_width);
3268 padding_not_printed = ANYWHERE;
3269 }
3270
3271@@ -2635,8 +2836,8 @@
3272 if (spaces_not_printed == 0)
3273 {
3274 output_position = p->start_position + end_vector[line];
3275- if (p->start_position - col_sep_length == chars_per_margin)
3276- output_position -= col_sep_length;
3277+ if (p->start_position - col_sep_width == chars_per_margin)
3278+ output_position -= col_sep_width;
3279 }
3280
3281 return true;
3282@@ -2655,7 +2856,7 @@
3283 number of characters is 1.) */
3284
3285 static int
3286-char_to_clump (char c)
3287+char_to_clump_single (char c)
3288 {
3289 unsigned char uc = c;
3290 char *s = clump_buff;
3291@@ -2665,10 +2866,10 @@
3292 int chars;
3293 int chars_per_c = 8;
3294
3295- if (c == input_tab_char)
3296+ if (c == input_tab_char[0])
3297 chars_per_c = chars_per_input_tab;
3298
3299- if (c == input_tab_char || c == '\t')
3300+ if (c == input_tab_char[0] || c == '\t')
3301 {
3302 width = TAB_WIDTH (chars_per_c, input_position);
3303
3304@@ -2739,6 +2940,154 @@
3305 return chars;
3306 }
3307
3308+#ifdef HAVE_MBRTOWC
3309+static int
3310+char_to_clump_multi (char c)
3311+{
3312+ static size_t mbc_pos = 0;
3313+ static char mbc[MB_LEN_MAX] = {'\0'};
3314+ static mbstate_t state = {'\0'};
3315+ mbstate_t state_bak;
3316+ wchar_t wc;
3317+ size_t mblength;
3318+ int wc_width;
3319+ register char *s = clump_buff;
3320+ register int i, j;
3321+ char esc_buff[4];
3322+ int width;
3323+ int chars;
3324+ int chars_per_c = 8;
3325+
3326+ state_bak = state;
3327+ mbc[mbc_pos++] = c;
3328+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
3329+
3330+ width = 0;
3331+ chars = 0;
3332+ while (mbc_pos > 0)
3333+ {
3334+ switch (mblength)
3335+ {
3336+ case (size_t)-2:
3337+ state = state_bak;
3338+ return 0;
3339+
3340+ case (size_t)-1:
3341+ state = state_bak;
3342+ mblength = 1;
3343+
3344+ if (use_esc_sequence || use_cntrl_prefix)
3345+ {
3346+ width = +4;
3347+ chars = +4;
3348+ *s++ = '\\';
3349+ sprintf (esc_buff, "%03o", mbc[0]);
3350+ for (i = 0; i <= 2; ++i)
3351+ *s++ = (int) esc_buff[i];
3352+ }
3353+ else
3354+ {
3355+ width += 1;
3356+ chars += 1;
3357+ *s++ = mbc[0];
3358+ }
3359+ break;
3360+
3361+ case 0:
3362+ mblength = 1;
3363+ /* Fall through */
3364+
3365+ default:
3366+ if (memcmp (mbc, input_tab_char, mblength) == 0)
3367+ chars_per_c = chars_per_input_tab;
3368+
3369+ if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t')
3370+ {
3371+ int width_inc;
3372+
3373+ width_inc = TAB_WIDTH (chars_per_c, input_position);
3374+ width += width_inc;
3375+
3376+ if (untabify_input)
3377+ {
3378+ for (i = width_inc; i; --i)
3379+ *s++ = ' ';
3380+ chars += width_inc;
3381+ }
3382+ else
3383+ {
3384+ for (i = 0; i < mblength; i++)
3385+ *s++ = mbc[i];
3386+ chars += mblength;
3387+ }
3388+ }
3389+ else if ((wc_width = wcwidth (wc)) < 1)
3390+ {
3391+ if (use_esc_sequence)
3392+ {
3393+ for (i = 0; i < mblength; i++)
3394+ {
3395+ width += 4;
3396+ chars += 4;
3397+ *s++ = '\\';
3398+ sprintf (esc_buff, "%03o", c);
3399+ for (j = 0; j <= 2; ++j)
3400+ *s++ = (int) esc_buff[j];
3401+ }
3402+ }
3403+ else if (use_cntrl_prefix)
3404+ {
3405+ if (wc < 0200)
3406+ {
3407+ width += 2;
3408+ chars += 2;
3409+ *s++ = '^';
3410+ *s++ = wc ^ 0100;
3411+ }
3412+ else
3413+ {
3414+ for (i = 0; i < mblength; i++)
3415+ {
3416+ width += 4;
3417+ chars += 4;
3418+ *s++ = '\\';
3419+ sprintf (esc_buff, "%03o", c);
3420+ for (j = 0; j <= 2; ++j)
3421+ *s++ = (int) esc_buff[j];
3422+ }
3423+ }
3424+ }
3425+ else if (wc == L'\b')
3426+ {
3427+ width += -1;
3428+ chars += 1;
3429+ *s++ = c;
3430+ }
3431+ else
3432+ {
3433+ width += 0;
3434+ chars += mblength;
3435+ for (i = 0; i < mblength; i++)
3436+ *s++ = mbc[i];
3437+ }
3438+ }
3439+ else
3440+ {
3441+ width += wc_width;
3442+ chars += mblength;
3443+ for (i = 0; i < mblength; i++)
3444+ *s++ = mbc[i];
3445+ }
3446+ }
3447+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
3448+ mbc_pos -= mblength;
3449+ }
3450+
3451+ input_position += width;
3452+ return chars;
3453+}
3454+#endif
3455+
3456 /* We've just printed some files and need to clean up things before
3457 looking for more options and printing the next batch of files.
3458
3459--- coreutils-6.8+/src/cut.c.i18n 2007-01-14 15:41:28.000000000 +0000
3460+++ coreutils-6.8+/src/cut.c 2007-03-01 15:08:24.000000000 +0000
3461@@ -29,6 +29,11 @@
3462 #include <assert.h>
3463 #include <getopt.h>
3464 #include <sys/types.h>
3465+
3466+/* Get mbstate_t, mbrtowc(). */
3467+#if HAVE_WCHAR_H
3468+# include <wchar.h>
3469+#endif
3470 #include "system.h"
3471
3472 #include "error.h"
3473@@ -37,6 +42,18 @@
3474 #include "quote.h"
3475 #include "xstrndup.h"
3476
3477+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
3478+ installation; work around this configuration error. */
3479+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
3480+# undef MB_LEN_MAX
3481+# define MB_LEN_MAX 16
3482+#endif
3483+
3484+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
3485+#if HAVE_MBRTOWC && defined mbstate_t
3486+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
3487+#endif
3488+
3489 /* The official name of this program (e.g., no `g' prefix). */
3490 #define PROGRAM_NAME "cut"
3491
3492@@ -67,6 +84,52 @@
3493 } \
3494 while (0)
3495
3496+/* Refill the buffer BUF to get a multibyte character. */
3497+#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \
3498+ do \
3499+ { \
3500+ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \
3501+ { \
3502+ memmove (BUF, BUFPOS, BUFLEN); \
3503+ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \
3504+ BUFPOS = BUF; \
3505+ } \
3506+ } \
3507+ while (0)
3508+
3509+/* Get wide character on BUFPOS. BUFPOS is not included after that.
3510+ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */
3511+#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \
3512+ do \
3513+ { \
3514+ mbstate_t state_bak; \
3515+ \
3516+ if (BUFLEN < 1) \
3517+ { \
3518+ WC = WEOF; \
3519+ break; \
3520+ } \
3521+ \
3522+ /* Get a wide character. */ \
3523+ CONVFAIL = 0; \
3524+ state_bak = STATE; \
3525+ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \
3526+ \
3527+ switch (MBLENGTH) \
3528+ { \
3529+ case (size_t)-1: \
3530+ case (size_t)-2: \
3531+ CONVFAIL++; \
3532+ STATE = state_bak; \
3533+ /* Fall througn. */ \
3534+ \
3535+ case 0: \
3536+ MBLENGTH = 1; \
3537+ break; \
3538+ } \
3539+ } \
3540+ while (0)
3541+
3542 struct range_pair
3543 {
3544 size_t lo;
3545@@ -85,7 +148,7 @@
3546 /* The number of bytes allocated for FIELD_1_BUFFER. */
3547 static size_t field_1_bufsize;
3548
3549-/* The largest field or byte index used as an endpoint of a closed
3550+/* The largest byte, character or field index used as an endpoint of a closed
3551 or degenerate range specification; this doesn't include the starting
3552 index of right-open-ended ranges. For example, with either range spec
3553 `2-5,9-', `2-3,5,9-' this variable would be set to 5. */
3554@@ -97,10 +160,11 @@
3555
3556 /* This is a bit vector.
3557 In byte mode, which bytes to output.
3558+ In character mode, which characters to output.
3559 In field mode, which DELIM-separated fields to output.
3560- Both bytes and fields are numbered starting with 1,
3561+ Bytes, characters and fields are numbered starting with 1,
3562 so the zeroth bit of this array is unused.
3563- A field or byte K has been selected if
3564+ A byte, character or field K has been selected if
3565 (K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
3566 || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */
3567 static unsigned char *printable_field;
3568@@ -109,9 +173,12 @@
3569 {
3570 undefined_mode,
3571
3572- /* Output characters that are in the given bytes. */
3573+ /* Output bytes that are at the given positions. */
3574 byte_mode,
3575
3576+ /* Output characters that are at the given positions. */
3577+ character_mode,
3578+
3579 /* Output the given delimeter-separated fields. */
3580 field_mode
3581 };
3582@@ -121,6 +188,13 @@
3583
3584 static enum operating_mode operating_mode;
3585
3586+/* If nonzero, when in byte mode, don't split multibyte characters. */
3587+static int byte_mode_character_aware;
3588+
3589+/* If nonzero, the function for single byte locale is work
3590+ if this program runs on multibyte locale. */
3591+static int force_singlebyte_mode;
3592+
3593 /* If true do not output lines containing no delimeter characters.
3594 Otherwise, all such lines are printed. This option is valid only
3595 with field mode. */
3596@@ -132,6 +206,9 @@
3597
3598 /* The delimeter character for field mode. */
3599 static unsigned char delim;
3600+#if HAVE_WCHAR_H
3601+static wchar_t wcdelim;
3602+#endif
3603
3604 /* True if the --output-delimiter=STRING option was specified. */
3605 static bool output_delimiter_specified;
3606@@ -205,7 +282,7 @@
3607 -f, --fields=LIST select only these fields; also print any line\n\
3608 that contains no delimiter character, unless\n\
3609 the -s option is specified\n\
3610- -n (ignored)\n\
3611+ -n with -b: don't split multibyte characters\n\
3612 "), stdout);
3613 fputs (_("\
3614 --complement complement the set of selected bytes, characters\n\
3615@@ -362,7 +439,7 @@
3616 in_digits = false;
3617 /* Starting a range. */
3618 if (dash_found)
3619- FATAL_ERROR (_("invalid byte or field list"));
3620+ FATAL_ERROR (_("invalid byte, character or field list"));
3621 dash_found = true;
3622 fieldstr++;
3623
3624@@ -387,14 +464,16 @@
3625 if (value == 0)
3626 {
3627 /* `n-'. From `initial' to end of line. */
3628- eol_range_start = initial;
3629+ if (eol_range_start == 0 ||
3630+ (eol_range_start != 0 && eol_range_start > initial))
3631+ eol_range_start = initial;
3632 field_found = true;
3633 }
3634 else
3635 {
3636 /* `m-n' or `-n' (1-n). */
3637 if (value < initial)
3638- FATAL_ERROR (_("invalid byte or field list"));
3639+ FATAL_ERROR (_("invalid byte, character or field list"));
3640
3641 /* Is there already a range going to end of line? */
3642 if (eol_range_start != 0)
3643@@ -467,6 +546,9 @@
3644 if (operating_mode == byte_mode)
3645 error (0, 0,
3646 _("byte offset %s is too large"), quote (bad_num));
3647+ else if (operating_mode == character_mode)
3648+ error (0, 0,
3649+ _("character offset %s is too large"), quote (bad_num));
3650 else
3651 error (0, 0,
3652 _("field number %s is too large"), quote (bad_num));
3653@@ -477,7 +559,7 @@
3654 fieldstr++;
3655 }
3656 else
3657- FATAL_ERROR (_("invalid byte or field list"));
3658+ FATAL_ERROR (_("invalid byte, character or field list"));
3659 }
3660
3661 max_range_endpoint = 0;
3662@@ -570,6 +652,63 @@
3663 }
3664 }
3665
3666+#if HAVE_MBRTOWC
3667+/* This function is in use for the following case.
3668+
3669+ 1. Read from the stream STREAM, printing to standard output any selected
3670+ characters.
3671+
3672+ 2. Read from stream STREAM, printing to standard output any selected bytes,
3673+ without splitting multibyte characters. */
3674+
3675+static void
3676+cut_characters_or_cut_bytes_no_split (FILE *stream)
3677+{
3678+ int idx; /* number of bytes or characters in the line so far. */
3679+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
3680+ char *bufpos; /* Next read position of BUF. */
3681+ size_t buflen; /* The length of the byte sequence in buf. */
3682+ wint_t wc; /* A gotten wide character. */
3683+ size_t mblength; /* The byte size of a multibyte character which shows
3684+ as same character as WC. */
3685+ mbstate_t state; /* State of the stream. */
3686+ int convfail; /* 1, when conversion is failed. Otherwise 0. */
3687+
3688+ idx = 0;
3689+ buflen = 0;
3690+ bufpos = buf;
3691+ memset (&state, '\0', sizeof(mbstate_t));
3692+
3693+ while (1)
3694+ {
3695+ REFILL_BUFFER (buf, bufpos, buflen, stream);
3696+
3697+ GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail);
3698+
3699+ if (wc == WEOF)
3700+ {
3701+ if (idx > 0)
3702+ putchar ('\n');
3703+ break;
3704+ }
3705+ else if (wc == L'\n')
3706+ {
3707+ putchar ('\n');
3708+ idx = 0;
3709+ }
3710+ else
3711+ {
3712+ idx += (operating_mode == byte_mode) ? mblength : 1;
3713+ if (print_kth (idx, NULL))
3714+ fwrite (bufpos, mblength, sizeof(char), stdout);
3715+ }
3716+
3717+ buflen -= mblength;
3718+ bufpos += mblength;
3719+ }
3720+}
3721+#endif
3722+
3723 /* Read from stream STREAM, printing to standard output any selected fields. */
3724
3725 static void
3726@@ -692,13 +831,192 @@
3727 }
3728 }
3729
3730+#if HAVE_MBRTOWC
3731+static void
3732+cut_fields_mb (FILE *stream)
3733+{
3734+ int c;
3735+ unsigned int field_idx;
3736+ int found_any_selected_field;
3737+ int buffer_first_field;
3738+ int empty_input;
3739+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
3740+ char *bufpos; /* Next read position of BUF. */
3741+ size_t buflen; /* The length of the byte sequence in buf. */
3742+ wint_t wc = 0; /* A gotten wide character. */
3743+ size_t mblength; /* The byte size of a multibyte character which shows
3744+ as same character as WC. */
3745+ mbstate_t state; /* State of the stream. */
3746+ int convfail; /* 1, when conversion is failed. Otherwise 0. */
3747+
3748+ found_any_selected_field = 0;
3749+ field_idx = 1;
3750+ bufpos = buf;
3751+ buflen = 0;
3752+ memset (&state, '\0', sizeof(mbstate_t));
3753+
3754+ c = getc (stream);
3755+ empty_input = (c == EOF);
3756+ if (c != EOF)
3757+ ungetc (c, stream);
3758+ else
3759+ wc = WEOF;
3760+
3761+ /* To support the semantics of the -s flag, we may have to buffer
3762+ all of the first field to determine whether it is `delimited.'
3763+ But that is unnecessary if all non-delimited lines must be printed
3764+ and the first field has been selected, or if non-delimited lines
3765+ must be suppressed and the first field has *not* been selected.
3766+ That is because a non-delimited line has exactly one field. */
3767+ buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL));
3768+
3769+ while (1)
3770+ {
3771+ if (field_idx == 1 && buffer_first_field)
3772+ {
3773+ int len = 0;
3774+
3775+ while (1)
3776+ {
3777+ REFILL_BUFFER (buf, bufpos, buflen, stream);
3778+
3779+ GET_NEXT_WC_FROM_BUFFER
3780+ (wc, bufpos, buflen, mblength, state, convfail);
3781+
3782+ if (wc == WEOF)
3783+ break;
3784+
3785+ field_1_buffer = xrealloc (field_1_buffer, len + mblength);
3786+ memcpy (field_1_buffer + len, bufpos, mblength);
3787+ len += mblength;
3788+ buflen -= mblength;
3789+ bufpos += mblength;
3790+
3791+ if (!convfail && (wc == L'\n' || wc == wcdelim))
3792+ break;
3793+ }
3794+
3795+ if (wc == WEOF)
3796+ break;
3797+
3798+ /* If the first field extends to the end of line (it is not
3799+ delimited) and we are printing all non-delimited lines,
3800+ print this one. */
3801+ if (convfail || (!convfail && wc != wcdelim))
3802+ {
3803+ if (suppress_non_delimited)
3804+ {
3805+ /* Empty. */
3806+ }
3807+ else
3808+ {
3809+ fwrite (field_1_buffer, sizeof (char), len, stdout);
3810+ /* Make sure the output line is newline terminated. */
3811+ if (convfail || (!convfail && wc != L'\n'))
3812+ putchar ('\n');
3813+ }
3814+ continue;
3815+ }
3816+
3817+ if (print_kth (1, NULL))
3818+ {
3819+ /* Print the field, but not the trailing delimiter. */
3820+ fwrite (field_1_buffer, sizeof (char), len - 1, stdout);
3821+ found_any_selected_field = 1;
3822+ }
3823+ ++field_idx;
3824+ }
3825+
3826+ if (wc != WEOF)
3827+ {
3828+ if (print_kth (field_idx, NULL))
3829+ {
3830+ if (found_any_selected_field)
3831+ {
3832+ fwrite (output_delimiter_string, sizeof (char),
3833+ output_delimiter_length, stdout);
3834+ }
3835+ found_any_selected_field = 1;
3836+ }
3837+
3838+ while (1)
3839+ {
3840+ REFILL_BUFFER (buf, bufpos, buflen, stream);
3841+
3842+ GET_NEXT_WC_FROM_BUFFER
3843+ (wc, bufpos, buflen, mblength, state, convfail);
3844+
3845+ if (wc == WEOF)
3846+ break;
3847+ else if (!convfail && (wc == wcdelim || wc == L'\n'))
3848+ {
3849+ buflen -= mblength;
3850+ bufpos += mblength;
3851+ break;
3852+ }
3853+
3854+ if (print_kth (field_idx, NULL))
3855+ fwrite (bufpos, mblength, sizeof(char), stdout);
3856+
3857+ buflen -= mblength;
3858+ bufpos += mblength;
3859+ }
3860+ }
3861+
3862+ if ((!convfail || wc == L'\n') && buflen < 1)
3863+ wc = WEOF;
3864+
3865+ if (!convfail && wc == wcdelim)
3866+ ++field_idx;
3867+ else if (wc == WEOF || (!convfail && wc == L'\n'))
3868+ {
3869+ if (found_any_selected_field
3870+ || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
3871+ putchar ('\n');
3872+ if (wc == WEOF)
3873+ break;
3874+ field_idx = 1;
3875+ found_any_selected_field = 0;
3876+ }
3877+ }
3878+}
3879+#endif
3880+
3881 static void
3882 cut_stream (FILE *stream)
3883 {
3884- if (operating_mode == byte_mode)
3885- cut_bytes (stream);
3886+#if HAVE_MBRTOWC
3887+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
3888+ {
3889+ switch (operating_mode)
3890+ {
3891+ case byte_mode:
3892+ if (byte_mode_character_aware)
3893+ cut_characters_or_cut_bytes_no_split (stream);
3894+ else
3895+ cut_bytes (stream);
3896+ break;
3897+
3898+ case character_mode:
3899+ cut_characters_or_cut_bytes_no_split (stream);
3900+ break;
3901+
3902+ case field_mode:
3903+ cut_fields_mb (stream);
3904+ break;
3905+
3906+ default:
3907+ abort ();
3908+ }
3909+ }
3910 else
3911- cut_fields (stream);
3912+#endif
3913+ {
3914+ if (operating_mode == field_mode)
3915+ cut_fields (stream);
3916+ else
3917+ cut_bytes (stream);
3918+ }
3919 }
3920
3921 /* Process file FILE to standard output.
3922@@ -748,6 +1066,8 @@
3923 bool ok;
3924 bool delim_specified = false;
3925 char *spec_list_string IF_LINT(= NULL);
3926+ char mbdelim[MB_LEN_MAX + 1];
3927+ size_t delimlen = 0;
3928
3929 initialize_main (&argc, &argv);
3930 program_name = argv[0];
3931@@ -770,7 +1090,6 @@
3932 switch (optc)
3933 {
3934 case 'b':
3935- case 'c':
3936 /* Build the byte list. */
3937 if (operating_mode != undefined_mode)
3938 FATAL_ERROR (_("only one type of list may be specified"));
3939@@ -778,6 +1097,14 @@
3940 spec_list_string = optarg;
3941 break;
3942
3943+ case 'c':
3944+ /* Build the character list. */
3945+ if (operating_mode != undefined_mode)
3946+ FATAL_ERROR (_("only one type of list may be specified"));
3947+ operating_mode = character_mode;
3948+ spec_list_string = optarg;
3949+ break;
3950+
3951 case 'f':
3952 /* Build the field list. */
3953 if (operating_mode != undefined_mode)
3954@@ -789,10 +1116,35 @@
3955 case 'd':
3956 /* New delimiter. */
3957 /* Interpret -d '' to mean `use the NUL byte as the delimiter.' */
3958- if (optarg[0] != '\0' && optarg[1] != '\0')
3959- FATAL_ERROR (_("the delimiter must be a single character"));
3960- delim = optarg[0];
3961- delim_specified = true;
3962+#if HAVE_MBRTOWC
3963+ {
3964+ if(MB_CUR_MAX > 1)
3965+ {
3966+ mbstate_t state;
3967+
3968+ memset (&state, '\0', sizeof(mbstate_t));
3969+ delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state);
3970+
3971+ if (delimlen == (size_t)-1 || delimlen == (size_t)-2)
3972+ ++force_singlebyte_mode;
3973+ else
3974+ {
3975+ delimlen = (delimlen < 1) ? 1 : delimlen;
3976+ if (wcdelim != L'\0' && *(optarg + delimlen) != '\0')
3977+ FATAL_ERROR (_("the delimiter must be a single character"));
3978+ memcpy (mbdelim, optarg, delimlen);
3979+ }
3980+ }
3981+
3982+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
3983+#endif
3984+ {
3985+ if (optarg[0] != '\0' && optarg[1] != '\0')
3986+ FATAL_ERROR (_("the delimiter must be a single character"));
3987+ delim = (unsigned char) optarg[0];
3988+ }
3989+ delim_specified = true;
3990+ }
3991 break;
3992
3993 case OUTPUT_DELIMITER_OPTION:
3994@@ -805,6 +1157,7 @@
3995 break;
3996
3997 case 'n':
3998+ byte_mode_character_aware = 1;
3999 break;
4000
4001 case 's':
4002@@ -827,7 +1180,7 @@
4003 if (operating_mode == undefined_mode)
4004 FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
4005
4006- if (delim != '\0' && operating_mode != field_mode)
4007+ if (delim_specified && operating_mode != field_mode)
4008 FATAL_ERROR (_("an input delimiter may be specified only\
4009 when operating on fields"));
4010
4011@@ -854,15 +1207,34 @@
4012 }
4013
4014 if (!delim_specified)
4015- delim = '\t';
4016+ {
4017+ delim = '\t';
4018+#ifdef HAVE_MBRTOWC
4019+ wcdelim = L'\t';
4020+ mbdelim[0] = '\t';
4021+ mbdelim[1] = '\0';
4022+ delimlen = 1;
4023+#endif
4024+ }
4025
4026 if (output_delimiter_string == NULL)
4027 {
4028- static char dummy[2];
4029- dummy[0] = delim;
4030- dummy[1] = '\0';
4031- output_delimiter_string = dummy;
4032- output_delimiter_length = 1;
4033+#ifdef HAVE_MBRTOWC
4034+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
4035+ {
4036+ output_delimiter_string = xstrdup(mbdelim);
4037+ output_delimiter_length = delimlen;
4038+ }
4039+
4040+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
4041+#endif
4042+ {
4043+ static char dummy[2];
4044+ dummy[0] = delim;
4045+ dummy[1] = '\0';
4046+ output_delimiter_string = dummy;
4047+ output_delimiter_length = 1;
4048+ }
4049 }
4050
4051 if (optind == argc)
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
deleted file mode 100644
index aba8742f6a..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
+++ /dev/null
@@ -1,117 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9--- coreutils-6.9/src/ls.c.ls-x 2007-06-13 14:27:36.000000000 +0100
10+++ coreutils-6.9/src/ls.c 2007-06-13 14:28:42.000000000 +0100
11@@ -4151,16 +4151,16 @@
12 size_t pos = 0;
13 size_t cols = calculate_columns (false);
14 struct column_info const *line_fmt = &column_info[cols - 1];
15- size_t name_length = length_of_file_name_and_frills (cwd_file);
16+ struct fileinfo const *f = sorted_file[0];
17+ size_t name_length = length_of_file_name_and_frills (f);
18 size_t max_name_length = line_fmt->col_arr[0];
19
20 /* Print first entry. */
21- print_file_name_and_frills (cwd_file);
22+ print_file_name_and_frills (f);
23
24 /* Now the rest. */
25 for (filesno = 1; filesno < cwd_n_used; ++filesno)
26 {
27- struct fileinfo const *f;
28 size_t col = filesno % cols;
29
30 if (col == 0)
31--- coreutils-6.9/tests/ls/Makefile.am.ls-x 2007-03-18 21:36:43.000000000 +0000
32+++ coreutils-6.9/tests/ls/Makefile.am 2007-06-13 14:28:42.000000000 +0100
33@@ -24,7 +24,7 @@
34 stat-dtype \
35 inode dangle file-type recursive dired infloop \
36 rt-1 time-1 symlink-slash follow-slink no-arg m-option \
37- stat-vs-dirent
38+ stat-vs-dirent x-option
39
40 EXTRA_DIST = $(TESTS)
41 TESTS_ENVIRONMENT = \
42--- /dev/null 2007-06-13 08:43:51.993263382 +0100
43+++ coreutils-6.9/tests/ls/x-option 2007-06-13 14:28:42.000000000 +0100
44@@ -0,0 +1,59 @@
45+#!/bin/sh
46+# Exercise the -x option.
47+
48+# Copyright (C) 2007 Free Software Foundation, Inc.
49+
50+# This program is free software; you can redistribute it and/or modify
51+# it under the terms of the GNU General Public License as published by
52+# the Free Software Foundation; either version 2 of the License, or
53+# (at your option) any later version.
54+
55+# This program is distributed in the hope that it will be useful,
56+# but WITHOUT ANY WARRANTY; without even the implied warranty of
57+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58+# GNU General Public License for more details.
59+
60+# You should have received a copy of the GNU General Public License
61+# along with this program; if not, write to the Free Software
62+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
63+# 02110-1301, USA.
64+
65+if test "$VERBOSE" = yes; then
66+ set -x
67+ ls --version
68+fi
69+
70+. $srcdir/../envvar-check
71+. $srcdir/../lang-default
72+
73+pwd=`pwd`
74+t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
75+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
76+trap '(exit $?); exit $?' 1 2 13 15
77+
78+framework_failure=0
79+mkdir -p $tmp || framework_failure=1
80+cd $tmp || framework_failure=1
81+mkdir subdir || framework_failure=1
82+touch subdir/b || framework_failure=1
83+touch subdir/a || framework_failure=1
84+
85+if test $framework_failure = 1; then
86+ echo "$0: failure in testing framework" 1>&2
87+ (exit 1); exit 1
88+fi
89+
90+fail=0
91+
92+# Coreutils 6.8 and 6.9 would output this in the wrong order.
93+ls -x subdir > out || fail=1
94+ls -rx subdir >> out || fail=1
95+cat <<\EOF > exp || fail=1
96+a b
97+b a
98+EOF
99+
100+cmp out exp || fail=1
101+test $fail = 1 && diff out exp 2> /dev/null
102+
103+(exit $fail); exit $fail
104--- coreutils-6.9/NEWS.ls-x 2007-03-22 21:19:45.000000000 +0000
105+++ coreutils-6.9/NEWS 2007-06-13 14:28:42.000000000 +0100
106@@ -13,6 +13,11 @@
107 Using pr -m -s (i.e. merging files, with TAB as the output separator)
108 no longer inserts extraneous spaces between output columns.
109
110+** Bug fixes
111+
112+ ls -x DIR would sometimes output the wrong string in place of the
113+ first entry. [introduced in coreutils-6.8]
114+
115
116 * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
117
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
deleted file mode 100644
index 58074c09a5..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
+++ /dev/null
@@ -1,19 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9--- coreutils-5.2.1/src/who.c.overflow 2005-05-25 09:59:06.000000000 +0100
10+++ coreutils-5.2.1/src/who.c 2005-05-25 10:00:31.000000000 +0100
11@@ -75,7 +75,7 @@
12 # define NEW_TIME 0
13 #endif
14
15-#define IDLESTR_LEN 6
16+#define IDLESTR_LEN 10
17
18 #if HAVE_STRUCT_XTMP_UT_PID
19 # define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
deleted file mode 100644
index 64e5f12baa..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1Upstream-Status: Pending
2
3automake 1.12 has depricated automatic de-ANSI-fication support
4
5this patch avoids these kinds of errors:
6
7| configure.ac:40: error: automatic de-ANSI-fication support has been removed
8| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
9| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:138: gl_CHECK_ALL_TYPES is expanded from...
10| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:24: coreutils_MACROS is expanded from...
11| configure.ac:40: the top level
12| autom4te: m4 failed with exit status: 1
13
14Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
152012/05/04
16
17Index: coreutils-6.9/m4/jm-macros.m4
18===================================================================
19--- coreutils-6.9.orig/m4/jm-macros.m4
20+++ coreutils-6.9/m4/jm-macros.m4
21@@ -142,11 +142,6 @@ AC_DEFUN([gl_CHECK_ALL_TYPES],
22 dnl whether functions and headers are available, whether they work, etc.
23 AC_REQUIRE([AC_SYS_LARGEFILE])
24
25- dnl This test must precede tests of compiler characteristics like
26- dnl that for the inline keyword, since it may change the degree to
27- dnl which the compiler supports such features.
28- AC_REQUIRE([AM_C_PROTOTYPES])
29-
30 dnl Checks for typedefs, structures, and compiler characteristics.
31 AC_REQUIRE([AC_C_BIGENDIAN])
32 AC_REQUIRE([AC_C_VOLATILE])
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch b/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
deleted file mode 100644
index e0d600a390..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3Use native coreutils binaries to build manpages in cross environment.
4This avoids man page build issues like this:
5
6| Making all in man
7| make[1]: Entering directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
8| Updating man page cut.1
9| Updating man page dir.1
10| Updating man page expand.1
11| Updating man page fold.1
12| Updating man page install.1
13| Updating man page join.1
14| Updating man page pr.1
15| Updating man page ls.1
16| Updating man page sort.1
17| Updating man page unexpand.1
18| Updating man page uniq.1
19| Updating man page who.1
20| Updating man page vdir.1
21| help2man: can't get `--help' info from dir.td/dir
22| help2man: can't get `--help' info from cut.td/cut
23| make[1]: *** [dir.1] Error 126
24| make[1]: *** Waiting for unfinished jobs....
25| help2man: can't get `--help' info from fold.td/fold
26| help2man: can't get `--help' info from install.td/install
27| help2man: can't get `--help' info from expand.td/expand
28| help2man: can't get `--help' info from join.td/join
29| make[1]: *** [cut.1] Error 126
30| make[1]: *** [fold.1] Error 126
31| make[1]: *** [install.1] Error 126
32| help2man: can't get `--help' info from sort.td/sort
33| make[1]: *** [expand.1] Error 126
34| help2man: can't get `--help' info from pr.td/pr
35| make[1]: *** [join.1] Error 126
36| help2man: can't get `--help' info from ls.td/ls
37| help2man: can't get `--help' info from unexpand.td/unexpand
38| help2man: can't get `--help' info from uniq.td/uniq
39| help2man: can't get `--help' info from who.td/who
40| make[1]: *** [sort.1] Error 126
41| make[1]: *** [pr.1] Error 126
42| help2man: can't get `--help' info from vdir.td/vdir
43| make[1]: *** [ls.1] Error 126
44| make[1]: *** [uniq.1] Error 126
45| make[1]: *** [unexpand.1] Error 126
46| make[1]: *** [who.1] Error 126
47| make[1]: *** [vdir.1] Error 126
48| make[1]: Leaving directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
49| make: *** [all-recursive] Error 1
50| FATAL: oe_runmake failed
51| ERROR: Function 'do_compile' failed (see /build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/temp/log.do_compile.12780 for further information)
52NOTE: package coreutils-6.9-r0: task do_compile: Failed
53ERROR: Task 8 (/home/nitin/prj/poky.git/meta/recipes-core/coreutils/coreutils_6.9.bb, do_compile) failed with exit code '1'
54
55
56This patch is made for gplv2 coreutils the recipe
57Nitin A Kamble <nitin.a.kamble@intel.com>
582011/03/17
59
60Index: man/Makefile.am
61===================================================================
62--- a/man.orig/Makefile.am
63+++ b/man/Makefile.am
64@@ -167,7 +167,7 @@ mapped_name = `echo $*|sed 's/install/gi
65 $(PERL) -- $(srcdir)/help2man \
66 --source='$(PACKAGE_STRING)' \
67 --include=$(srcdir)/$*.x \
68- --output=$t/$@ $t/$*; \
69+ --output=$t/$@ $*; \
70 } \
71 && sed 's|$*\.td/||g' $t/$@ > $@ \
72 && chmod a-w $@ \
73Index: man/Makefile.in
74===================================================================
75--- a/man.orig/Makefile.in
76+++ b/man/Makefile.in
77@@ -865,7 +865,7 @@ yes.1: $(common_dep) $(srcdir)/yes.x .
78 $(PERL) -- $(srcdir)/help2man \
79 --source='$(PACKAGE_STRING)' \
80 --include=$(srcdir)/$*.x \
81- --output=$t/$@ $t/$*; \
82+ --output=$t/$@ $*; \
83 } \
84 && sed 's|$*\.td/||g' $t/$@ > $@ \
85 && chmod a-w $@ \
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
deleted file mode 100644
index 508810623d..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3# coreutils uses gnulib which conflicts with newer libc header on futimens
4# this patch simply renames coreutils futimes to avoid confliction
5#
6# Signed-off-by: Kevin Tian <kevin.tian@intel.com>, 2010-08-18
7# (this patch is licensed under GPLv2)
8
9diff --git a/lib/utimens.c b/lib/utimens.c
10index 71bc510..ae870b8 100644
11--- a/lib/utimens.c
12+++ b/lib/utimens.c
13@@ -75,7 +75,7 @@ struct utimbuf
14 Return 0 on success, -1 (setting errno) on failure. */
15
16 int
17-futimens (int fd ATTRIBUTE_UNUSED,
18+futimens_coreutils (int fd ATTRIBUTE_UNUSED,
19 char const *file, struct timespec const timespec[2])
20 {
21 /* Some Linux-based NFS clients are buggy, and mishandle time stamps
22@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
23 int
24 utimens (char const *file, struct timespec const timespec[2])
25 {
26- return futimens (-1, file, timespec);
27+ return futimens_coreutils (-1, file, timespec);
28 }
29diff --git a/lib/utimens.h b/lib/utimens.h
30index 0097aaa..13fc45a 100644
31--- a/lib/utimens.h
32+++ b/lib/utimens.h
33@@ -1,3 +1,3 @@
34 #include <time.h>
35-int futimens (int, char const *, struct timespec const [2]);
36+int futimens_coreutils (int, char const *, struct timespec const [2]);
37 int utimens (char const *, struct timespec const [2]);
38diff --git a/src/copy.c b/src/copy.c
39index 4bdb75c..04634f1 100644
40--- a/src/copy.c
41+++ b/src/copy.c
42@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
43 timespec[0] = get_stat_atime (src_sb);
44 timespec[1] = get_stat_mtime (src_sb);
45
46- if (futimens (dest_desc, dst_name, timespec) != 0)
47+ if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
48 {
49 error (0, errno, _("preserving times for %s"), quote (dst_name));
50 if (x->require_preserve)
51diff --git a/src/touch.c b/src/touch.c
52index a79c26d..6ef317d 100644
53--- a/src/touch.c
54+++ b/src/touch.c
55@@ -182,7 +182,7 @@ touch (const char *file)
56 t = timespec;
57 }
58
59- ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
60+ ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
61
62 if (fd == STDIN_FILENO)
63 {
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
deleted file mode 100644
index 8a8ffa7264..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3# remove the line to cause recursive inclusion error from autoreconf, sicne
4# newer autoconf has included this definition. Simply rename it here.
5#
6# Signed-off-by: Kevin Tian <kevin.tian@intel.com>, 2010-08-18
7# (this patch is licensed under GPLv2)
8
9diff --git a/extensions.m4 b/extensions.m4
10index 143a9e5..f6558f1 100644
11--- a/m4/extensions.m4
12+++ b/m4/extensions.m4
13@@ -16,7 +16,7 @@
14 # ------------------------
15 # Enable extensions on systems that normally disable them,
16 # typically due to standards-conformance issues.
17-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
18+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY],
19 [
20 AC_BEFORE([$0], [AC_COMPILE_IFELSE])
21 AC_BEFORE([$0], [AC_RUN_IFELSE])
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch b/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch
deleted file mode 100644
index c72efd4d30..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/loadavg.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1Remove hardcoded paths so OE's configure QA does not detect it and fail the builds
2For cross compilation is less interesting to look into host paths for target libraries anyway
3
4Upstream-Status: Inappropriate [OE Specific]
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: coreutils-6.9/m4/getloadavg.m4
8===================================================================
9--- coreutils-6.9.orig/m4/getloadavg.m4
10+++ coreutils-6.9/m4/getloadavg.m4
11@@ -49,7 +49,6 @@ if test $gl_have_func = no; then
12 # There is a commonly available library for RS/6000 AIX.
13 # Since it is not a standard part of AIX, it might be installed locally.
14 gl_getloadavg_LIBS=$LIBS
15- LIBS="-L/usr/local/lib $LIBS"
16 AC_CHECK_LIB(getloadavg, getloadavg,
17 [LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS])
18 fi
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
deleted file mode 100644
index 59a4fe0053..0000000000
--- a/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1Upstream-Status: Inappropriate [legacy version]
2
3# man page for 'touch' is generated differently from others. All other utilities
4# are provided static man source files, while for 'touch' it requires help2man
5# to invoke "touch --help" and then convert the output into the manual. Since touch
6# is with target format which can't be invoked on build system, disable building
7# 'touch' man page here.
8#
9# Signed-off-by: Kevin Tian <kevin.tian@intel.com>, 2010-08-18
10# (this patch is licensed under GPLv2)
11
12diff --git a/man/Makefile.am b/man/Makefile.am
13index 32df9d1..37b09e3 100644
14--- a/man/Makefile.am
15+++ b/man/Makefile.am
16@@ -27,7 +27,7 @@ dist_man_MANS = \
17 paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
18 rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
19 shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
20- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
21+ su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
22 tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
23 whoami.1 yes.1 $(MAN)
24 optional_mans = \
diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb
deleted file mode 100644
index 821aafc6e0..0000000000
--- a/meta/recipes-core/coreutils/coreutils_6.9.bb
+++ /dev/null
@@ -1,107 +0,0 @@
1SUMMARY = "The basic file, shell and text manipulation utilities"
2DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
3manipulation utilities. These are the core utilities which are expected to exist on \
4every system."
5
6HOMEPAGE = "http://www.gnu.org/software/coreutils/"
7BUGTRACKER = "http://debbugs.gnu.org/coreutils"
8LICENSE = "GPLv2+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
10 file://src/ls.c;beginline=4;endline=16;md5=15ed60f67b1db5fedd5dbc37cf8a9543"
11PR = "r5"
12DEPENDS = "virtual/libiconv"
13
14inherit autotools gettext texinfo
15
16SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \
17 file://gnulib_m4.patch \
18 file://futimens.patch \
19 file://coreutils-ls-x.patch \
20 file://coreutils-6.9-cp-i-u.patch \
21 file://coreutils-i18n.patch \
22 file://coreutils-overflow.patch \
23 file://coreutils-fix-install.patch \
24 file://man-touch.patch \
25 file://coreutils_fix_for_automake-1.12.patch \
26 file://coreutils-fix-texinfo.patch \
27 file://fix_for_manpage_building.patch \
28 file://loadavg.patch \
29 "
30
31SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06"
32SRC_URI[sha256sum] = "89c2895ad157de50e53298b22d91db116ee4e1dd3fdf4019260254e2e31497b0"
33
34EXTRA_OECONF += "ac_cv_func_getgroups_works=yes \
35 ac_cv_func_strcoll_works=yes"
36
37# acl is not a default feature
38#
39PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}"
40
41# with, without, depends, rdepends
42#
43PACKAGECONFIG[acl] = "ac_cv_header_sys_acl_h=yes ac_cv_header_acl_libacl_h=yes ac_cv_search_acl_get_file=-lacl,ac_cv_header_sys_acl_h=no ac_cv_header_acl_libacl_h=no ac_cv_search_acl_get_file=,acl,"
44
45
46# [ gets a special treatment and is not included in this
47bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
48 env expand expr factor fmt fold groups head hostid id install \
49 join link logname md5sum mkfifo nice nl nohup od paste pathchk \
50 pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
51 sha384sum sha512sum shred shuf sort split sum tac tail tee test \
52 tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime"
53
54# hostname gets a special treatment and is not included in this
55base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
56 mknod mv pwd rm rmdir sleep stty sync touch true uname hostname stat"
57
58sbindir_progs= "chroot"
59
60# Let aclocal use the relative path for the m4 file rather than the
61# absolute since coreutils has a lot of m4 files, otherwise there might
62# be an "Argument list too long" error when it is built in a long/deep
63# directory.
64acpaths = "-I ./m4"
65
66do_install() {
67 autotools_do_install
68
69 install -d ${D}${base_bindir}
70 [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
71
72 install -d ${D}${sbindir}
73 [ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done
74
75 # [ requires special handling because [.coreutils will cause the sed stuff
76 # in update-alternatives to fail, therefore use lbracket - the name used
77 # for the actual source file.
78 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
79
80 # Newer versions of coreutils do not include su, to mimic this behavior
81 # we simply remove it.
82 rm -f ${D}${bindir}/su
83}
84
85inherit update-alternatives
86
87ALTERNATIVE_PRIORITY = "100"
88
89ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}"
90
91ALTERNATIVE_${PN}-doc = "su.1 hostname.1"
92ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
93ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
94
95ALTERNATIVE_PRIORITY[uptime] = "10"
96ALTERNATIVE_PRIORITY[hostname] = "10"
97
98ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
99ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
100
101python __anonymous() {
102 for prog in d.getVar('base_bindir_progs').split():
103 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
104
105 for prog in d.getVar('sbindir_progs').split():
106 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
107}
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch b/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
deleted file mode 100644
index e4c5f1566b..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8Index: gettext-0.16.1/gettext-tools/configure.ac
9===================================================================
10--- gettext-0.16.1.orig/gettext-tools/configure.ac 2006-11-27 09:02:01.000000000 -0800
11+++ gettext-0.16.1/gettext-tools/configure.ac 2011-03-16 16:55:36.111396557 -0700
12@@ -36,27 +36,15 @@
13 gt_JAVA_CHOICE
14
15 gt_GCJ
16-if test -n "$HAVE_GCJ" && test "$JAVA_CHOICE" = yes; then
17- BUILDJAVAEXE=yes
18-else
19 BUILDJAVAEXE=no
20-fi
21 AC_SUBST(BUILDJAVAEXE)
22
23 gt_JAVAEXEC
24 gt_JAVACOMP([1.3])
25 AC_CHECK_PROG(JAR, jar, jar)
26-if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
27- BUILDJAVA=yes
28-else
29 BUILDJAVA=no
30-fi
31 AC_SUBST(BUILDJAVA)
32-if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
33- TESTJAVA=yes
34-else
35 TESTJAVA=no
36-fi
37 AC_SUBST(TESTJAVA)
38
39 gt_CSHARPCOMP
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
deleted file mode 100644
index 49a10f5b18..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
+++ /dev/null
@@ -1,110 +0,0 @@
1
2This patch updates the required version number from 2.61 to the
3current 2.65 version of aclocal, this will need to be updated
4when we update aclocal
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by: Saul Wold <sgw@linux.intel.com>
9
10Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
11===================================================================
12--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:36.391519775 -0700
13+++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:45.569526073 -0700
14@@ -148,7 +148,7 @@
15 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
16 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
17 dnl Autoconf >= 2.61 supports dots in --with options.
18- define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
19+ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.65]),[-1],[translit([$1],[.],[_])],[$1])])
20 dnl By default, look in $includedir and $libdir.
21 use_additional=yes
22 AC_LIB_WITH_FINAL_PREFIX([
23Index: gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4
24===================================================================
25--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
26+++ gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:45.570526904 -0700
27@@ -11,8 +11,8 @@
28 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
29 # PARTICULAR PURPOSE.
30
31-m4_if(m4_PACKAGE_VERSION, [2.61],,
32-[m4_fatal([this file was generated for autoconf 2.61.
33+m4_if(m4_PACKAGE_VERSION, [2.65],,
34+[m4_fatal([this file was generated for autoconf 2.65.
35 You have another version of autoconf. If you want to use that,
36 you should regenerate the build system entirely.], [63])])
37
38Index: gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4
39===================================================================
40--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
41+++ gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:45.572525773 -0700
42@@ -11,8 +11,8 @@
43 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
44 # PARTICULAR PURPOSE.
45
46-m4_if(m4_PACKAGE_VERSION, [2.61],,
47-[m4_fatal([this file was generated for autoconf 2.61.
48+m4_if(m4_PACKAGE_VERSION, [2.65],,
49+[m4_fatal([this file was generated for autoconf 2.65.
50 You have another version of autoconf. If you want to use that,
51 you should regenerate the build system entirely.], [63])])
52
53Index: gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4
54===================================================================
55--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
56+++ gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:45.578394916 -0700
57@@ -11,7 +11,7 @@
58 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
59 # PARTICULAR PURPOSE.
60
61-m4_if(m4_PACKAGE_VERSION, [2.61],,
62+m4_if(m4_PACKAGE_VERSION, [2.65],,
63 [m4_fatal([this file was generated for autoconf 2.61.
64 You have another version of autoconf. If you want to use that,
65 you should regenerate the build system entirely.], [63])])
66Index: gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4
67===================================================================
68--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
69+++ gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:45.586395416 -0700
70@@ -11,8 +11,8 @@
71 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
72 # PARTICULAR PURPOSE.
73
74-m4_if(m4_PACKAGE_VERSION, [2.61],,
75-[m4_fatal([this file was generated for autoconf 2.61.
76+m4_if(m4_PACKAGE_VERSION, [2.65],,
77+[m4_fatal([this file was generated for autoconf 2.65.
78 You have another version of autoconf. If you want to use that,
79 you should regenerate the build system entirely.], [63])])
80
81Index: gettext-0.16.1/gettext-tools/aclocal.m4
82===================================================================
83--- gettext-0.16.1.orig/gettext-tools/aclocal.m4 2006-11-27 09:34:32.000000000 -0800
84+++ gettext-0.16.1/gettext-tools/aclocal.m4 2011-03-17 02:27:01.135682807 -0700
85@@ -11,8 +11,8 @@
86 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
87 # PARTICULAR PURPOSE.
88
89-m4_if(m4_PACKAGE_VERSION, [2.61],,
90-[m4_fatal([this file was generated for autoconf 2.61.
91+m4_if(m4_PACKAGE_VERSION, [2.65],,
92+[m4_fatal([this file was generated for autoconf 2.65.
93 You have another version of autoconf. If you want to use that,
94 you should regenerate the build system entirely.], [63])])
95
96Index: gettext-0.16.1/gettext-tools/examples/aclocal.m4
97===================================================================
98--- gettext-0.16.1.orig/gettext-tools/examples/aclocal.m4 2006-11-27 09:16:23.000000000 -0800
99+++ gettext-0.16.1/gettext-tools/examples/aclocal.m4 2011-03-17 02:26:52.589396683 -0700
100@@ -11,8 +11,8 @@
101 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
102 # PARTICULAR PURPOSE.
103
104-m4_if(m4_PACKAGE_VERSION, [2.61],,
105-[m4_fatal([this file was generated for autoconf 2.61.
106+m4_if(m4_PACKAGE_VERSION, [2.65],,
107+[m4_fatal([this file was generated for autoconf 2.65.
108 You have another version of autoconf. If you want to use that,
109 you should regenerate the build system entirely.], [63])])
110
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
deleted file mode 100644
index fd5feebc85..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
+++ /dev/null
@@ -1,348 +0,0 @@
1
2This patch removes the circular dependency on AC_GNU_SOURCE in
3AC_USE_SYSTEM_EXTENSIONS.
4
5Thanks to Mark Hatle for the timely pointers and fixes.
6
7Upstream-Status: Inappropriate [licensing]
8
9Signed-off-by: Saul Wold <sgw@linux.intel.com>
10
11diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 gettext.patched/gettext-runtime/gnulib-m4/extensions.m4
12--- gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 2006-11-27 09:14:38.000000000 -0800
13+++ gettext.patched/gettext-runtime/gnulib-m4/extensions.m4 2011-03-16 23:54:01.711923448 -0700
14@@ -16,43 +16,47 @@
15 # ------------------------
16 # Enable extensions on systems that normally disable them,
17 # typically due to standards-conformance issues.
18-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
19-[
20- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
21- AC_BEFORE([$0], [AC_RUN_IFELSE])
22-
23- AC_REQUIRE([AC_GNU_SOURCE])
24- AC_REQUIRE([AC_AIX])
25- AC_REQUIRE([AC_MINIX])
26-
27- AH_VERBATIM([__EXTENSIONS__],
28-[/* Enable extensions on Solaris. */
29-#ifndef __EXTENSIONS__
30-# undef __EXTENSIONS__
31-#endif
32-#ifndef _POSIX_PTHREAD_SEMANTICS
33-# undef _POSIX_PTHREAD_SEMANTICS
34-#endif
35-#ifndef _TANDEM_SOURCE
36-# undef _TANDEM_SOURCE
37-#endif])
38- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
39- [ac_cv_safe_to_define___extensions__],
40- [AC_COMPILE_IFELSE(
41- [AC_LANG_PROGRAM([
42-# define __EXTENSIONS__ 1
43- AC_INCLUDES_DEFAULT])],
44- [ac_cv_safe_to_define___extensions__=yes],
45- [ac_cv_safe_to_define___extensions__=no])])
46- test $ac_cv_safe_to_define___extensions__ = yes &&
47- AC_DEFINE([__EXTENSIONS__])
48- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
49- AC_DEFINE([_TANDEM_SOURCE])
50-])
51+#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
52+#[
53+# AC_BEFORE([$0], [AC_COMPILE_IFELSE])
54+# AC_BEFORE([$0], [AC_RUN_IFELSE])
55+#
56+# AC_REQUIRE([AC_GNU_SOURCE])
57+# AC_REQUIRE([AC_AIX])
58+# AC_REQUIRE([AC_MINIX])
59+#
60+# AH_VERBATIM([__EXTENSIONS__],
61+#[/* Enable extensions on Solaris. */
62+##ifndef __EXTENSIONS__
63+## undef __EXTENSIONS__
64+##endif
65+##ifndef _POSIX_PTHREAD_SEMANTICS
66+## undef _POSIX_PTHREAD_SEMANTICS
67+##endif
68+##ifndef _TANDEM_SOURCE
69+## undef _TANDEM_SOURCE
70+##endif])
71+# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
72+# [ac_cv_safe_to_define___extensions__],
73+# [AC_COMPILE_IFELSE(
74+# [AC_LANG_PROGRAM([
75+## define __EXTENSIONS__ 1
76+# AC_INCLUDES_DEFAULT])],
77+# [ac_cv_safe_to_define___extensions__=yes],
78+# [ac_cv_safe_to_define___extensions__=no])])
79+# test $ac_cv_safe_to_define___extensions__ = yes &&
80+# AC_DEFINE([__EXTENSIONS__])
81+# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
82+# AC_DEFINE([_TANDEM_SOURCE])
83+#])
84
85 # gl_USE_SYSTEM_EXTENSIONS
86 # ------------------------
87 # Enable extensions on systems that normally disable them,
88 # typically due to standards-conformance issues.
89 AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
90- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
91+[
92+ AC_REQUIRE([AC_GNU_SOURCE])
93+
94+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
95+])
96diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4
97--- gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:19.000000000 -0800
98+++ gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4 2011-03-16 23:50:17.471531838 -0700
99@@ -25,7 +25,7 @@
100 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
101 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
102 AC_REQUIRE([AC_PROG_RANLIB])
103- AC_REQUIRE([AC_GNU_SOURCE])
104+ dnl AC_REQUIRE([AC_GNU_SOURCE])
105 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
106 ])
107
108diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4
109--- gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 2006-11-27 09:14:38.000000000 -0800
110+++ gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4 2011-03-16 23:50:10.814396529 -0700
111@@ -9,7 +9,7 @@
112
113 AC_DEFUN([gl_MBCHAR],
114 [
115- AC_REQUIRE([AC_GNU_SOURCE])
116+ dnl AC_REQUIRE([AC_GNU_SOURCE])
117 dnl The following line is that so the user can test HAVE_WCHAR_H
118 dnl before #include "mbchar.h".
119 AC_CHECK_HEADERS_ONCE([wchar.h])
120diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4
121--- gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 2006-11-27 09:14:38.000000000 -0800
122+++ gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4 2011-03-16 23:50:08.357396247 -0700
123@@ -7,7 +7,7 @@
124 AC_DEFUN([gl_FUNC_WCWIDTH],
125 [
126 dnl Persuade glibc <wchar.h> to declare wcwidth().
127- AC_REQUIRE([AC_GNU_SOURCE])
128+ dnl AC_REQUIRE([AC_GNU_SOURCE])
129
130 AC_REQUIRE([AC_C_INLINE])
131 AC_REQUIRE([gt_TYPE_WCHAR_T])
132diff -ru gettext-0.16.1/gettext-runtime/m4/lock.m4 gettext.patched/gettext-runtime/m4/lock.m4
133--- gettext-0.16.1/gettext-runtime/m4/lock.m4 2006-10-24 13:59:59.000000000 -0700
134+++ gettext.patched/gettext-runtime/m4/lock.m4 2011-03-16 23:50:04.355891676 -0700
135@@ -35,7 +35,7 @@
136 AC_BEFORE([$0], [gl_ARGP])dnl
137
138 AC_REQUIRE([AC_CANONICAL_HOST])
139- AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
140+ dnl AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
141 dnl Check for multithreading.
142 AC_ARG_ENABLE(threads,
143 AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
144diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 gettext.patched/gettext-tools/gnulib-m4/extensions.m4
145--- gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 2006-11-27 09:14:54.000000000 -0800
146+++ gettext.patched/gettext-tools/gnulib-m4/extensions.m4 2011-03-16 23:53:28.487671266 -0700
147@@ -16,43 +16,47 @@
148 # ------------------------
149 # Enable extensions on systems that normally disable them,
150 # typically due to standards-conformance issues.
151-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
152-[
153- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
154- AC_BEFORE([$0], [AC_RUN_IFELSE])
155-
156- AC_REQUIRE([AC_GNU_SOURCE])
157- AC_REQUIRE([AC_AIX])
158- AC_REQUIRE([AC_MINIX])
159-
160- AH_VERBATIM([__EXTENSIONS__],
161-[/* Enable extensions on Solaris. */
162-#ifndef __EXTENSIONS__
163-# undef __EXTENSIONS__
164-#endif
165-#ifndef _POSIX_PTHREAD_SEMANTICS
166-# undef _POSIX_PTHREAD_SEMANTICS
167-#endif
168-#ifndef _TANDEM_SOURCE
169-# undef _TANDEM_SOURCE
170-#endif])
171- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
172- [ac_cv_safe_to_define___extensions__],
173- [AC_COMPILE_IFELSE(
174- [AC_LANG_PROGRAM([
175-# define __EXTENSIONS__ 1
176- AC_INCLUDES_DEFAULT])],
177- [ac_cv_safe_to_define___extensions__=yes],
178- [ac_cv_safe_to_define___extensions__=no])])
179- test $ac_cv_safe_to_define___extensions__ = yes &&
180- AC_DEFINE([__EXTENSIONS__])
181- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
182- AC_DEFINE([_TANDEM_SOURCE])
183-])
184+#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
185+#[
186+# AC_BEFORE([$0], [AC_COMPILE_IFELSE])
187+# AC_BEFORE([$0], [AC_RUN_IFELSE])
188+#
189+# AC_REQUIRE([AC_GNU_SOURCE])
190+# AC_REQUIRE([AC_AIX])
191+# AC_REQUIRE([AC_MINIX])
192+#
193+# AH_VERBATIM([__EXTENSIONS__],
194+#[/* Enable extensions on Solaris. */
195+##ifndef __EXTENSIONS__
196+## undef __EXTENSIONS__
197+##endif
198+##ifndef _POSIX_PTHREAD_SEMANTICS
199+## undef _POSIX_PTHREAD_SEMANTICS
200+##endif
201+##ifndef _TANDEM_SOURCE
202+## undef _TANDEM_SOURCE
203+##endif])
204+# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
205+# [ac_cv_safe_to_define___extensions__],
206+# [AC_COMPILE_IFELSE(
207+# [AC_LANG_PROGRAM([
208+## define __EXTENSIONS__ 1
209+# AC_INCLUDES_DEFAULT])],
210+# [ac_cv_safe_to_define___extensions__=yes],
211+# [ac_cv_safe_to_define___extensions__=no])])
212+# test $ac_cv_safe_to_define___extensions__ = yes &&
213+# AC_DEFINE([__EXTENSIONS__])
214+# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
215+# AC_DEFINE([_TANDEM_SOURCE])
216+#])
217
218 # gl_USE_SYSTEM_EXTENSIONS
219 # ------------------------
220 # Enable extensions on systems that normally disable them,
221 # typically due to standards-conformance issues.
222 AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
223- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
224+[
225+ AC_REQUIRE([AC_GNU_SOURCE])
226+
227+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
228+])
229diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4
230--- gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 2006-11-27 09:14:54.000000000 -0800
231+++ gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4 2011-03-16 23:52:06.477463671 -0700
232@@ -91,7 +91,7 @@
233 AC_DEFUN([gl_FUNC_FNMATCH_GNU],
234 [
235 dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
236- AC_REQUIRE([AC_GNU_SOURCE])
237+ dnl AC_REQUIRE([AC_GNU_SOURCE])
238
239 FNMATCH_H=
240 _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
241diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 gettext.patched/gettext-tools/gnulib-m4/getdelim.m4
242--- gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 2006-11-27 09:14:54.000000000 -0800
243+++ gettext.patched/gettext-tools/gnulib-m4/getdelim.m4 2011-03-16 23:52:22.871674845 -0700
244@@ -12,7 +12,7 @@
245 [
246
247 dnl Persuade glibc <stdio.h> to declare getdelim().
248- AC_REQUIRE([AC_GNU_SOURCE])
249+ dnl AC_REQUIRE([AC_GNU_SOURCE])
250
251 AC_REPLACE_FUNCS(getdelim)
252 AC_CHECK_DECLS_ONCE(getdelim)
253diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 gettext.patched/gettext-tools/gnulib-m4/getline.m4
254--- gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 2006-11-27 09:14:54.000000000 -0800
255+++ gettext.patched/gettext-tools/gnulib-m4/getline.m4 2011-03-16 23:51:49.829971108 -0700
256@@ -16,7 +16,7 @@
257 AC_DEFUN([gl_FUNC_GETLINE],
258 [
259 dnl Persuade glibc <stdio.h> to declare getline().
260- AC_REQUIRE([AC_GNU_SOURCE])
261+ dnl AC_REQUIRE([AC_GNU_SOURCE])
262
263 AC_CHECK_DECLS([getline])
264
265diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4
266--- gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:36.000000000 -0800
267+++ gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4 2011-03-16 23:52:18.970450488 -0700
268@@ -25,7 +25,7 @@
269 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
270 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
271 AC_REQUIRE([AC_PROG_RANLIB])
272- AC_REQUIRE([AC_GNU_SOURCE])
273+ dnl AC_REQUIRE([AC_GNU_SOURCE])
274 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
275 AC_REQUIRE([gl_LOCK_EARLY])
276 ])
277diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 gettext.patched/gettext-tools/gnulib-m4/mbchar.m4
278--- gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 2006-11-27 09:14:55.000000000 -0800
279+++ gettext.patched/gettext-tools/gnulib-m4/mbchar.m4 2011-03-16 23:51:40.844410216 -0700
280@@ -9,7 +9,7 @@
281
282 AC_DEFUN([gl_MBCHAR],
283 [
284- AC_REQUIRE([AC_GNU_SOURCE])
285+ dnl AC_REQUIRE([AC_GNU_SOURCE])
286 dnl The following line is that so the user can test HAVE_WCHAR_H
287 dnl before #include "mbchar.h".
288 AC_CHECK_HEADERS_ONCE([wchar.h])
289diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4
290--- gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 2006-11-27 09:14:55.000000000 -0800
291+++ gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4 2011-03-16 23:52:14.691396045 -0700
292@@ -7,7 +7,7 @@
293 AC_DEFUN([gl_FUNC_STPCPY],
294 [
295 dnl Persuade glibc <string.h> to declare stpcpy().
296- AC_REQUIRE([AC_GNU_SOURCE])
297+ dnl AC_REQUIRE([AC_GNU_SOURCE])
298
299 AC_REPLACE_FUNCS(stpcpy)
300 if test $ac_cv_func_stpcpy = no; then
301diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4
302--- gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 2006-11-27 09:14:55.000000000 -0800
303+++ gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4 2011-03-16 23:52:10.356641459 -0700
304@@ -7,7 +7,7 @@
305 AC_DEFUN([gl_FUNC_STPNCPY],
306 [
307 dnl Persuade glibc <string.h> to declare stpncpy().
308- AC_REQUIRE([AC_GNU_SOURCE])
309+ dnl AC_REQUIRE([AC_GNU_SOURCE])
310
311 dnl Both glibc and AIX (4.3.3, 5.1) have an stpncpy() function
312 dnl declared in <string.h>. Its side effects are the same as those
313diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4
314--- gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 2006-11-27 09:14:55.000000000 -0800
315+++ gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4 2011-03-16 23:51:08.260324221 -0700
316@@ -7,7 +7,7 @@
317 AC_DEFUN([gl_FUNC_WCWIDTH],
318 [
319 dnl Persuade glibc <wchar.h> to declare wcwidth().
320- AC_REQUIRE([AC_GNU_SOURCE])
321+ dnl AC_REQUIRE([AC_GNU_SOURCE])
322
323 AC_REQUIRE([AC_C_INLINE])
324 AC_REQUIRE([gt_TYPE_WCHAR_T])
325diff -ru gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4
326--- gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:45.000000000 -0800
327+++ gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2011-03-16 23:51:02.036061317 -0700
328@@ -25,7 +25,7 @@
329 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
330 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
331 AC_REQUIRE([AC_PROG_RANLIB])
332- AC_REQUIRE([AC_GNU_SOURCE])
333+ dnl AC_REQUIRE([AC_GNU_SOURCE])
334 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
335 AC_REQUIRE([gl_LOCK_EARLY])
336 ])
337diff -ru gettext-0.16.1/gettext-tools/m4/regex.m4 gettext.patched/gettext-tools/m4/regex.m4
338--- gettext-0.16.1/gettext-tools/m4/regex.m4 2006-11-27 09:02:05.000000000 -0800
339+++ gettext.patched/gettext-tools/m4/regex.m4 2011-03-16 23:50:53.533477195 -0700
340@@ -116,7 +116,7 @@
341 dnl to get them.
342
343 dnl Persuade glibc <string.h> to declare mempcpy().
344- AC_REQUIRE([AC_GNU_SOURCE])
345+ dnl AC_REQUIRE([AC_GNU_SOURCE])
346
347 AC_REQUIRE([AC_C_RESTRICT])
348 AC_REQUIRE([AC_FUNC_ALLOCA])
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
deleted file mode 100644
index 072fe5ff6c..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
+++ /dev/null
@@ -1,19 +0,0 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8--- gettext-0.17/autoconf-lib-link/m4/lib-link.m4~ 2009-04-17 15:12:30.000000000 -0700
9+++ gettext-0.17/autoconf-lib-link/m4/lib-link.m4 2009-04-17 15:37:39.000000000 -0700
10@@ -267,6 +267,9 @@
11 fi
12 fi
13 fi
14+ dnl Just let the compiler find the library, the compiler and user are smarter then this script
15+ dnl when cross compiling and working with a relocated install.
16+ found_dir=""
17 if test "X$found_dir" = "X"; then
18 for x in $LDFLAGS $LTLIB[]NAME; do
19 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
deleted file mode 100644
index f09e450efe..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
+++ /dev/null
@@ -1,20 +0,0 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8Index: gettext-0.16.1/gettext-runtime/intl/Makefile.in
9===================================================================
10--- gettext-0.16.1.orig/gettext-runtime/intl/Makefile.in 2006-11-27 09:02:00.000000000 -0800
11+++ gettext-0.16.1/gettext-runtime/intl/Makefile.in 2011-03-16 16:04:49.175419930 -0700
12@@ -35,7 +35,7 @@
13 # 'make' does the wrong thing if GNU gettext was configured with
14 # "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
15 # files it finds in srcdir = ../../gettext-runtime/intl.
16-VPATH = $(srcdir)
17+#VPATH = $(srcdir)
18
19 prefix = @prefix@
20 exec_prefix = @exec_prefix@
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
deleted file mode 100644
index 4da8dd4536..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1
2This patch hardcodes in version 0.17 for the GETTEXT_MACRO_VERSION,
3the version check is only part of 0.17 and will not affect any 0.16.1
4operations
5
6Upstream-Status: Inappropriate [licensing]
7
8Signed-off-by: Saul Wold <sgw@linux.intel.com>
9
10Index: gettext-0.16.1/gettext-runtime/m4/po.m4
11===================================================================
12--- gettext-0.16.1.orig/gettext-runtime/m4/po.m4 2011-03-17 02:24:28.953520231 -0700
13+++ gettext-0.16.1/gettext-runtime/m4/po.m4 2011-03-17 02:28:25.455396862 -0700
14@@ -27,6 +27,9 @@
15 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
16 AC_REQUIRE([AM_NLS])dnl
17
18+ dnl Hardcode the MACRO_VERSION to 0.17 for gnutls
19+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
20+
21 dnl Perform the following tests also if --disable-nls has been given,
22 dnl because they are needed for "make dist" to work.
23
24Index: gettext-0.16.1/gettext-runtime/po/Makefile.in.in
25===================================================================
26--- gettext-0.16.1.orig/gettext-runtime/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700
27+++ gettext-0.16.1/gettext-runtime/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700
28@@ -10,6 +10,9 @@
29 #
30 # Origin: gettext-0.16
31
32+# Hardcode this value for gnutls building against gplv2 code
33+GETTEXT_MACRO_VERSION = 0.17
34+
35 PACKAGE = @PACKAGE@
36 VERSION = @VERSION@
37 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
38Index: gettext-0.16.1/gettext-tools/po/Makefile.in.in
39===================================================================
40--- gettext-0.16.1.orig/gettext-tools/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700
41+++ gettext-0.16.1/gettext-tools/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700
42@@ -10,6 +10,9 @@
43 #
44 # Origin: gettext-0.16
45
46+# Hardcode this value for gnutls building against gplv2 code
47+GETTEXT_MACRO_VERSION = 0.17
48+
49 PACKAGE = @PACKAGE@
50 VERSION = @VERSION@
51 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch b/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
deleted file mode 100644
index d921069711..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
+++ /dev/null
@@ -1,720 +0,0 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
9===================================================================
10--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2006-11-27 09:01:58.000000000 -0800
11+++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 00:36:08.710836720 -0700
12@@ -6,12 +6,14 @@
13
14 dnl From Bruno Haible.
15
16-AC_PREREQ(2.50)
17+AC_PREREQ(2.54)
18
19 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
20 dnl the libraries corresponding to explicit and implicit dependencies.
21 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
22 dnl augments the CPPFLAGS variable.
23+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
24+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
25 AC_DEFUN([AC_LIB_LINKFLAGS],
26 [
27 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
28@@ -24,13 +26,16 @@
29 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
30 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
31 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
32+ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
33 ])
34 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
35 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
36 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
37+ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
38 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
39 AC_SUBST([LIB]NAME)
40 AC_SUBST([LTLIB]NAME)
41+ AC_SUBST([LIB]NAME[_PREFIX])
42 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
43 dnl results of this search when this library appears as a dependency.
44 HAVE_LIB[]NAME=yes
45@@ -46,6 +51,8 @@
46 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
47 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
48 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
49+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
50+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
51 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
52 [
53 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
54@@ -82,17 +89,24 @@
55 CPPFLAGS="$ac_save_CPPFLAGS"
56 LIB[]NAME=
57 LTLIB[]NAME=
58+ LIB[]NAME[]_PREFIX=
59+
60 fi
61 AC_SUBST([HAVE_LIB]NAME)
62 AC_SUBST([LIB]NAME)
63 AC_SUBST([LTLIB]NAME)
64+ AC_SUBST([LIB]NAME[_PREFIX])
65 undefine([Name])
66 undefine([NAME])
67 ])
68
69 dnl Determine the platform dependent parameters needed to use rpath:
70-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
71-dnl hardcode_direct, hardcode_minus_L.
72+dnl acl_libext,
73+dnl acl_shlibext,
74+dnl acl_hardcode_libdir_flag_spec,
75+dnl acl_hardcode_libdir_separator,
76+dnl acl_hardcode_direct,
77+dnl acl_hardcode_minus_L.
78 AC_DEFUN([AC_LIB_RPATH],
79 [
80 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
81@@ -109,12 +123,14 @@
82 acl_cv_rpath=done
83 ])
84 wl="$acl_cv_wl"
85- libext="$acl_cv_libext"
86- shlibext="$acl_cv_shlibext"
87- hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
88- hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
89- hardcode_direct="$acl_cv_hardcode_direct"
90- hardcode_minus_L="$acl_cv_hardcode_minus_L"
91+ acl_libext="$acl_cv_libext"
92+ acl_shlibext="$acl_cv_shlibext"
93+ acl_libname_spec="$acl_cv_libname_spec"
94+ acl_library_names_spec="$acl_cv_library_names_spec"
95+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
96+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
97+ acl_hardcode_direct="$acl_cv_hardcode_direct"
98+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
99 dnl Determine whether the user wants rpath handling at all.
100 AC_ARG_ENABLE(rpath,
101 [ --disable-rpath do not hardcode runtime library paths],
102@@ -124,20 +140,24 @@
103 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
104 dnl the libraries corresponding to explicit and implicit dependencies.
105 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
106+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
107+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
108 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
109 [
110 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
111 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
112 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
113+ dnl Autoconf >= 2.61 supports dots in --with options.
114+ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
115 dnl By default, look in $includedir and $libdir.
116 use_additional=yes
117 AC_LIB_WITH_FINAL_PREFIX([
118 eval additional_includedir=\"$includedir\"
119 eval additional_libdir=\"$libdir\"
120 ])
121- AC_LIB_ARG_WITH([lib$1-prefix],
122-[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
123- --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
124+ AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
125+[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
126+ --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
127 [
128 if test "X$withval" = "Xno"; then
129 use_additional=no
130@@ -158,6 +178,7 @@
131 LIB[]NAME=
132 LTLIB[]NAME=
133 INC[]NAME=
134+ LIB[]NAME[]_PREFIX=
135 rpathdirs=
136 ltrpathdirs=
137 names_already_handled=
138@@ -197,27 +218,53 @@
139 found_la=
140 found_so=
141 found_a=
142+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
143+ if test -n "$acl_shlibext"; then
144+ shrext=".$acl_shlibext" # typically: shrext=.so
145+ else
146+ shrext=
147+ fi
148 if test $use_additional = yes; then
149- if test -n "$shlibext" \
150- && { test -f "$additional_libdir/lib$name.$shlibext" \
151- || { test "$shlibext" = dll \
152- && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
153- found_dir="$additional_libdir"
154- if test -f "$additional_libdir/lib$name.$shlibext"; then
155- found_so="$additional_libdir/lib$name.$shlibext"
156+ dir="$additional_libdir"
157+ dnl The same code as in the loop below:
158+ dnl First look for a shared library.
159+ if test -n "$acl_shlibext"; then
160+ if test -f "$dir/$libname$shrext"; then
161+ found_dir="$dir"
162+ found_so="$dir/$libname$shrext"
163 else
164- found_so="$additional_libdir/lib$name.dll.a"
165+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
166+ ver=`(cd "$dir" && \
167+ for f in "$libname$shrext".*; do echo "$f"; done \
168+ | sed -e "s,^$libname$shrext\\\\.,," \
169+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
170+ | sed 1q ) 2>/dev/null`
171+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
172+ found_dir="$dir"
173+ found_so="$dir/$libname$shrext.$ver"
174+ fi
175+ else
176+ eval library_names=\"$acl_library_names_spec\"
177+ for f in $library_names; do
178+ if test -f "$dir/$f"; then
179+ found_dir="$dir"
180+ found_so="$dir/$f"
181+ break
182+ fi
183+ done
184+ fi
185 fi
186- if test -f "$additional_libdir/lib$name.la"; then
187- found_la="$additional_libdir/lib$name.la"
188+ fi
189+ dnl Then look for a static library.
190+ if test "X$found_dir" = "X"; then
191+ if test -f "$dir/$libname.$acl_libext"; then
192+ found_dir="$dir"
193+ found_a="$dir/$libname.$acl_libext"
194 fi
195- else
196- if test -f "$additional_libdir/lib$name.$libext"; then
197- found_dir="$additional_libdir"
198- found_a="$additional_libdir/lib$name.$libext"
199- if test -f "$additional_libdir/lib$name.la"; then
200- found_la="$additional_libdir/lib$name.la"
201- fi
202+ fi
203+ if test "X$found_dir" != "X"; then
204+ if test -f "$dir/$libname.la"; then
205+ found_la="$dir/$libname.la"
206 fi
207 fi
208 fi
209@@ -227,26 +274,44 @@
210 case "$x" in
211 -L*)
212 dir=`echo "X$x" | sed -e 's/^X-L//'`
213- if test -n "$shlibext" \
214- && { test -f "$dir/lib$name.$shlibext" \
215- || { test "$shlibext" = dll \
216- && test -f "$dir/lib$name.dll.a"; }; }; then
217- found_dir="$dir"
218- if test -f "$dir/lib$name.$shlibext"; then
219- found_so="$dir/lib$name.$shlibext"
220+ dnl First look for a shared library.
221+ if test -n "$acl_shlibext"; then
222+ if test -f "$dir/$libname$shrext"; then
223+ found_dir="$dir"
224+ found_so="$dir/$libname$shrext"
225 else
226- found_so="$dir/lib$name.dll.a"
227- fi
228- if test -f "$dir/lib$name.la"; then
229- found_la="$dir/lib$name.la"
230+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
231+ ver=`(cd "$dir" && \
232+ for f in "$libname$shrext".*; do echo "$f"; done \
233+ | sed -e "s,^$libname$shrext\\\\.,," \
234+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
235+ | sed 1q ) 2>/dev/null`
236+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
237+ found_dir="$dir"
238+ found_so="$dir/$libname$shrext.$ver"
239+ fi
240+ else
241+ eval library_names=\"$acl_library_names_spec\"
242+ for f in $library_names; do
243+ if test -f "$dir/$f"; then
244+ found_dir="$dir"
245+ found_so="$dir/$f"
246+ break
247+ fi
248+ done
249+ fi
250 fi
251- else
252- if test -f "$dir/lib$name.$libext"; then
253+ fi
254+ dnl Then look for a static library.
255+ if test "X$found_dir" = "X"; then
256+ if test -f "$dir/$libname.$acl_libext"; then
257 found_dir="$dir"
258- found_a="$dir/lib$name.$libext"
259- if test -f "$dir/lib$name.la"; then
260- found_la="$dir/lib$name.la"
261- fi
262+ found_a="$dir/$libname.$acl_libext"
263+ fi
264+ fi
265+ if test "X$found_dir" != "X"; then
266+ if test -f "$dir/$libname.la"; then
267+ found_la="$dir/$libname.la"
268 fi
269 fi
270 ;;
271@@ -282,12 +347,12 @@
272 ltrpathdirs="$ltrpathdirs $found_dir"
273 fi
274 dnl The hardcoding into $LIBNAME is system dependent.
275- if test "$hardcode_direct" = yes; then
276+ if test "$acl_hardcode_direct" = yes; then
277 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
278 dnl resulting binary.
279 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
280 else
281- if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
282+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
283 dnl Use an explicit option to hardcode DIR into the resulting
284 dnl binary.
285 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
286@@ -318,13 +383,13 @@
287 if test -z "$haveit"; then
288 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
289 fi
290- if test "$hardcode_minus_L" != no; then
291+ if test "$acl_hardcode_minus_L" != no; then
292 dnl FIXME: Not sure whether we should use
293 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
294 dnl here.
295 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
296 else
297- dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
298+ dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
299 dnl here, because this doesn't fit in flags passed to the
300 dnl compiler. So give up. No hardcoding. This affects only
301 dnl very old systems.
302@@ -512,18 +577,18 @@
303 done
304 done
305 if test "X$rpathdirs" != "X"; then
306- if test -n "$hardcode_libdir_separator"; then
307+ if test -n "$acl_hardcode_libdir_separator"; then
308 dnl Weird platform: only the last -rpath option counts, the user must
309 dnl pass all path elements in one option. We can arrange that for a
310 dnl single library, but not when more than one $LIBNAMEs are used.
311 alldirs=
312 for found_dir in $rpathdirs; do
313- alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
314+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
315 done
316- dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
317+ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
318 acl_save_libdir="$libdir"
319 libdir="$alldirs"
320- eval flag=\"$hardcode_libdir_flag_spec\"
321+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
322 libdir="$acl_save_libdir"
323 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
324 else
325@@ -531,7 +596,7 @@
326 for found_dir in $rpathdirs; do
327 acl_save_libdir="$libdir"
328 libdir="$found_dir"
329- eval flag=\"$hardcode_libdir_flag_spec\"
330+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
331 libdir="$acl_save_libdir"
332 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
333 done
334@@ -642,3 +707,79 @@
335 fi
336 AC_SUBST([$1])
337 ])
338+
339+dnl For those cases where a variable contains several -L and -l options
340+dnl referring to unknown libraries and directories, this macro determines the
341+dnl necessary additional linker options for the runtime path.
342+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
343+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
344+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
345+dnl otherwise linking without libtool is assumed.
346+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
347+[
348+ AC_REQUIRE([AC_LIB_RPATH])
349+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
350+ $1=
351+ if test "$enable_rpath" != no; then
352+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
353+ dnl Use an explicit option to hardcode directories into the resulting
354+ dnl binary.
355+ rpathdirs=
356+ next=
357+ for opt in $2; do
358+ if test -n "$next"; then
359+ dir="$next"
360+ dnl No need to hardcode the standard /usr/lib.
361+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
362+ rpathdirs="$rpathdirs $dir"
363+ fi
364+ next=
365+ else
366+ case $opt in
367+ -L) next=yes ;;
368+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
369+ dnl No need to hardcode the standard /usr/lib.
370+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
371+ rpathdirs="$rpathdirs $dir"
372+ fi
373+ next= ;;
374+ *) next= ;;
375+ esac
376+ fi
377+ done
378+ if test "X$rpathdirs" != "X"; then
379+ if test -n ""$3""; then
380+ dnl libtool is used for linking. Use -R options.
381+ for dir in $rpathdirs; do
382+ $1="${$1}${$1:+ }-R$dir"
383+ done
384+ else
385+ dnl The linker is used for linking directly.
386+ if test -n "$acl_hardcode_libdir_separator"; then
387+ dnl Weird platform: only the last -rpath option counts, the user
388+ dnl must pass all path elements in one option.
389+ alldirs=
390+ for dir in $rpathdirs; do
391+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
392+ done
393+ acl_save_libdir="$libdir"
394+ libdir="$alldirs"
395+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
396+ libdir="$acl_save_libdir"
397+ $1="$flag"
398+ else
399+ dnl The -rpath options are cumulative.
400+ for dir in $rpathdirs; do
401+ acl_save_libdir="$libdir"
402+ libdir="$dir"
403+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
404+ libdir="$acl_save_libdir"
405+ $1="${$1}${$1:+ }$flag"
406+ done
407+ fi
408+ fi
409+ fi
410+ fi
411+ fi
412+ AC_SUBST([$1])
413+])
414Index: gettext-0.16.1/autoconf-lib-link/config.rpath
415===================================================================
416--- gettext-0.16.1.orig/autoconf-lib-link/config.rpath 2006-11-27 09:01:58.000000000 -0800
417+++ gettext-0.16.1/autoconf-lib-link/config.rpath 2011-03-17 00:33:23.336539490 -0700
418@@ -2,7 +2,7 @@
419 # Output a system dependent set of variables, describing how to set the
420 # run time search path of shared libraries in an executable.
421 #
422-# Copyright 1996-2006 Free Software Foundation, Inc.
423+# Copyright 1996-2007 Free Software Foundation, Inc.
424 # Taken from GNU libtool, 2001
425 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
426 #
427@@ -47,6 +47,18 @@
428 done
429 cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
430
431+# Code taken from libtool.m4's _LT_CC_BASENAME.
432+
433+for cc_temp in $CC""; do
434+ case $cc_temp in
435+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
436+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
437+ \-*) ;;
438+ *) break;;
439+ esac
440+done
441+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
442+
443 # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
444
445 wl=
446@@ -64,7 +76,14 @@
447 ;;
448 esac
449 ;;
450- mingw* | pw32* | os2*)
451+ darwin*)
452+ case $cc_basename in
453+ xlc*)
454+ wl='-Wl,'
455+ ;;
456+ esac
457+ ;;
458+ mingw* | cygwin* | pw32* | os2*)
459 ;;
460 hpux9* | hpux10* | hpux11*)
461 wl='-Wl,'
462@@ -74,7 +93,7 @@
463 ;;
464 newsos6)
465 ;;
466- linux*)
467+ linux* | k*bsd*-gnu)
468 case $cc_basename in
469 icc* | ecc*)
470 wl='-Wl,'
471@@ -100,7 +119,7 @@
472 osf3* | osf4* | osf5*)
473 wl='-Wl,'
474 ;;
475- sco3.2v5*)
476+ rdos*)
477 ;;
478 solaris*)
479 wl='-Wl,'
480@@ -108,11 +127,14 @@
481 sunos4*)
482 wl='-Qoption ld '
483 ;;
484- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
485+ sysv4 | sysv4.2uw2* | sysv4.3*)
486 wl='-Wl,'
487 ;;
488 sysv4*MP*)
489 ;;
490+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
491+ wl='-Wl,'
492+ ;;
493 unicos*)
494 wl='-Wl,'
495 ;;
496@@ -141,6 +163,10 @@
497 # we just hope/assume this is gcc and not c89 (= MSVC++)
498 with_gnu_ld=yes
499 ;;
500+ interix*)
501+ # we just hope/assume this is gcc and not c89 (= MSVC++)
502+ with_gnu_ld=yes
503+ ;;
504 openbsd*)
505 with_gnu_ld=no
506 ;;
507@@ -189,11 +215,11 @@
508 ld_shlibs=no
509 fi
510 ;;
511- interix3*)
512+ interix[3-9]*)
513 hardcode_direct=no
514 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
515 ;;
516- linux*)
517+ gnu* | linux* | k*bsd*-gnu)
518 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
519 :
520 else
521@@ -280,7 +306,7 @@
522 strings "$collect2name" | grep resolve_lib_name >/dev/null
523 then
524 # We have reworked collect2
525- hardcode_direct=yes
526+ :
527 else
528 # We have old collect2
529 hardcode_direct=unsupported
530@@ -359,7 +385,7 @@
531 hardcode_direct=yes
532 hardcode_minus_L=yes
533 ;;
534- freebsd* | kfreebsd*-gnu | dragonfly*)
535+ freebsd* | dragonfly*)
536 hardcode_libdir_flag_spec='-R$libdir'
537 hardcode_direct=yes
538 ;;
539@@ -412,18 +438,22 @@
540 hardcode_libdir_separator=:
541 ;;
542 openbsd*)
543- hardcode_direct=yes
544- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
545- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
546+ if test -f /usr/libexec/ld.so; then
547+ hardcode_direct=yes
548+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
549+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
550+ else
551+ case "$host_os" in
552+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
553+ hardcode_libdir_flag_spec='-R$libdir'
554+ ;;
555+ *)
556+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
557+ ;;
558+ esac
559+ fi
560 else
561- case "$host_os" in
562- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
563- hardcode_libdir_flag_spec='-R$libdir'
564- ;;
565- *)
566- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
567- ;;
568- esac
569+ ld_shlibs=no
570 fi
571 ;;
572 os2*)
573@@ -471,7 +501,7 @@
574 ld_shlibs=yes
575 fi
576 ;;
577- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
578+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* |sco3.2v5.0.[024]*)
579 ;;
580 sysv5* | sco3.2v5* | sco5v6*)
581 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
582@@ -488,33 +518,51 @@
583
584 # Check dynamic linker characteristics
585 # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
586+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
587+# only about the one the linker finds when passed -lNAME. This is the last
588+# element of library_names_spec in libtool.m4, or possibly two of them if the
589+# linker has special search rules.
590+library_names_spec= # the last element of library_names_spec in libtool.m4
591 libname_spec='lib$name'
592 case "$host_os" in
593 aix3*)
594+ library_names_spec='$libname.a'
595 ;;
596 aix4* | aix5*)
597+ library_names_spec='$libname$shrext'
598 ;;
599 amigaos*)
600+ library_names_spec='$libname.a'
601 ;;
602 beos*)
603+ library_names_spec='$libname$shrext'
604 ;;
605 bsdi[45]*)
606+ library_names_spec='$libname$shrext'
607 ;;
608 cygwin* | mingw* | pw32*)
609 shrext=.dll
610+ library_names_spec='$libname.dll.a $libname.lib'
611 ;;
612 darwin* | rhapsody*)
613 shrext=.dylib
614+ library_names_spec='$libname$shrext'
615 ;;
616 dgux*)
617+ library_names_spec='$libname$shrext'
618 ;;
619 freebsd1*)
620 ;;
621- kfreebsd*-gnu)
622- ;;
623 freebsd* | dragonfly*)
624+ case "$host_os" in
625+ freebsd[123]*)
626+ library_names_spec='$libname$shrext$versuffix' ;;
627+ *)
628+ library_names_spec='$libname$shrext' ;;
629+ esac
630 ;;
631 gnu*)
632+ library_names_spec='$libname$shrext'
633 ;;
634 hpux9* | hpux10* | hpux11*)
635 case $host_cpu in
636@@ -528,10 +576,13 @@
637 shrext=.sl
638 ;;
639 esac
640+ library_names_spec='$libname$shrext'
641 ;;
642- interix3*)
643+ interix[3-9]*)
644+ library_names_spec='$libname$shrext'
645 ;;
646 irix5* | irix6* | nonstopux*)
647+ library_names_spec='$libname$shrext'
648 case "$host_os" in
649 irix5* | nonstopux*)
650 libsuff= shlibsuff=
651@@ -548,33 +599,46 @@
652 ;;
653 linux*oldld* | linux*aout* | linux*coff*)
654 ;;
655- linux*)
656+ linux* | k*bsd*-gnu)
657+ library_names_spec='$libname$shrext'
658 ;;
659 knetbsd*-gnu)
660+ library_names_spec='$libname$shrext'
661 ;;
662 netbsd*)
663+ library_names_spec='$libname$shrext'
664 ;;
665 newsos6)
666+ library_names_spec='$libname$shrext'
667 ;;
668 nto-qnx*)
669+ library_names_spec='$libname$shrext'
670 ;;
671 openbsd*)
672+ library_names_spec='$libname$shrext$versuffix'
673 ;;
674 os2*)
675 libname_spec='$name'
676 shrext=.dll
677+ library_names_spec='$libname.a'
678 ;;
679 osf3* | osf4* | osf5*)
680+ library_names_spec='$libname$shrext'
681 ;;
682 solaris*)
683+ library_names_spec='$libname$shrext'
684 ;;
685 sunos4*)
686+ library_names_spec='$libname$shrext$versuffix'
687 ;;
688 sysv4 | sysv4.3*)
689+ library_names_spec='$libname$shrext'
690 ;;
691 sysv4*MP*)
692+ library_names_spec='$libname$shrext'
693 ;;
694 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
695+ library_names_spec='$libname$shrext'
696 ;;
697 uts4*)
698 ;;
699@@ -583,6 +647,8 @@
700 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
701 escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
702 shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
703+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
704+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
705 escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
706
707 LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
708@@ -596,6 +662,12 @@
709 # Shared library suffix (normally "so").
710 shlibext="$shlibext"
711
712+# Format of library name prefix.
713+libname_spec="$escaped_libname_spec"
714+
715+# Library names that the linker finds when passed -lNAME.
716+library_names_spec="$escaped_library_names_spec"
717+
718 # Flag to hardcode \$libdir into a binary during linking.
719 # This must work even if \$libdir does not exist.
720 hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
diff --git a/meta/recipes-core/gettext/gettext_0.16.1.bb b/meta/recipes-core/gettext/gettext_0.16.1.bb
deleted file mode 100644
index e79f4dacf3..0000000000
--- a/meta/recipes-core/gettext/gettext_0.16.1.bb
+++ /dev/null
@@ -1,124 +0,0 @@
1SUMMARY = "Utilities and libraries for producing multi-lingual messages"
2DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
3HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
4SECTION = "libs"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=9ea3144f04c41cd2eada5d3f472e6ea5"
7
8PR = "r6"
9DEPENDS = "virtual/libiconv"
10DEPENDS_class-native = ""
11PROVIDES = "virtual/libintl virtual/gettext"
12PROVIDES_class-native = "virtual/gettext-native"
13
14SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
15 file://gettext-vpath.patch \
16 file://linklib_from_0.17.patch \
17 file://gettext-autoconf-lib-link-no-L.patch \
18 file://disable_java.patch \
19 file://fix_aclocal_version.patch \
20 file://fix_gnu_source_circular.patch \
21 file://hardcode_macro_version.patch \
22 "
23
24SRC_URI[md5sum] = "3d9ad24301c6d6b17ec30704a13fe127"
25SRC_URI[sha256sum] = "0bf850d1a079fb5a61f0a47b1a9efd35eb44032255375e1cedb0253bc27b376d"
26
27PARALLEL_MAKE = ""
28
29LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
30
31inherit autotools texinfo
32
33EXTRA_OECONF += "--without-lispdir \
34 --disable-csharp \
35 --disable-libasprintf \
36 --disable-java \
37 --disable-native-java \
38 --disable-openmp \
39 --without-emacs \
40 "
41EXTRA_OECONF_append_libc-musl = "\
42 gt_cv_func_gnugettext1_libc=yes \
43 gt_cv_func_gnugettext2_libc=yes \
44 "
45
46acpaths = '-I ${S}/autoconf-lib-link/m4/ \
47 -I ${S}/gettext-runtime/m4 \
48 -I ${S}/gettext-tools/m4'
49
50do_configure_prepend() {
51 rm -f ${S}/config/m4/libtool.m4
52}
53
54do_install_append_libc-musl () {
55 rm -f ${D}${libdir}/charset.alias
56}
57
58# these lack the .x behind the .so, but shouldn't be in the -dev package
59# Otherwise you get the following results:
60# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
61# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
62# because gettext depends on gettext-dev, which pulls in more -dev packages:
63# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
64# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
65# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
66# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
67
68PACKAGES =+ "libgettextlib libgettextsrc"
69FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
70FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
71
72PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-staticdev gettext-runtime-doc"
73
74FILES_${PN} += "${libdir}/${BPN}/*"
75
76FILES_gettext-runtime = "${bindir}/gettext \
77 ${bindir}/ngettext \
78 ${bindir}/envsubst \
79 ${bindir}/gettext.sh \
80 ${libdir}/libasprintf${SODEV} \
81 ${libdir}/GNU.Gettext.dll \
82 "
83FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
84 ${libdir}/charset.alias \
85 "
86FILES_gettext-runtime-staticdev += "${libdir}/libasprintf.a"
87FILES_gettext-runtime-dev += "${includedir}/autosprintf.h \
88 ${libdir}/libasprintf${SOLIBDEV}"
89FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
90 ${includedir}/libintl.h \
91 "
92FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
93 ${mandir}/man1/ngettext.* \
94 ${mandir}/man1/envsubst.* \
95 ${mandir}/man1/.* \
96 ${mandir}/man3/* \
97 ${docdir}/gettext/gettext.* \
98 ${docdir}/gettext/ngettext.* \
99 ${docdir}/gettext/envsubst.* \
100 ${docdir}/gettext/*.3.html \
101 ${datadir}/gettext/ABOUT-NLS \
102 ${docdir}/gettext/csharpdoc/* \
103 ${docdir}/libasprintf/autosprintf.html \
104 ${infodir}/autosprintf.info \
105 "
106
107do_install_append() {
108 rm -f ${D}${libdir}/preloadable_libintl.so
109}
110
111do_install_append_class-native () {
112 rm ${D}${datadir}/aclocal/*
113 rm ${D}${datadir}/gettext/config.rpath
114 rm ${D}${datadir}/gettext/po/Makefile.in.in
115 rm ${D}${datadir}/gettext/po/remove-potcdate.sin
116}
117
118# Anyone inheriting gettext will have both gettext-native and gettext
119# available, and we don't want to use older macros from the target gettext in
120# a non-gplv3 build, so kill them and let dependent recipes rely on
121# gettext-native.
122SYSROOT_DIRS_BLACKLIST += "${datadir}/aclocal"
123
124BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/readline/readline-5.2/configure-fix.patch b/meta/recipes-core/readline/readline-5.2/configure-fix.patch
deleted file mode 100644
index be60a9861e..0000000000
--- a/meta/recipes-core/readline/readline-5.2/configure-fix.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1Upstream-Status: Pending
2
3Without this it fails to link against libtermcap causing various missing symbols
4issues.
5
6RP - 8/10/08
7
8Index: readline-5.2/configure.in
9===================================================================
10--- readline-5.2.orig/configure.in 2008-10-08 09:58:52.000000000 +0100
11+++ readline-5.2/configure.in 2008-10-08 09:59:03.000000000 +0100
12@@ -211,10 +211,10 @@
13 AC_MSG_CHECKING(configuration for building shared libraries)
14 eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
15
16-# case "$SHLIB_LIBS" in
17-# *curses*|*termcap*|*termlib*) ;;
18-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
19-# esac
20+ case "$SHLIB_LIBS" in
21+ *curses*|*termcap*|*termlib*) ;;
22+ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
23+ esac
24
25 AC_SUBST(SHOBJ_CC)
26 AC_SUBST(SHOBJ_CFLAGS)
diff --git a/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch b/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
deleted file mode 100644
index 3166b470f2..0000000000
--- a/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1This support script ends up hardcoding unnecessary rpaths into the libraries. We
2will search $libdir automatically so this is just wastes space. There may be some
3cases this is necessary but our use cases aren't one of them.
4
5Upstream-Status: Inappropriate
6
7Signed-off-by: Saul Wold <sgw@linux.intel.com>
8
9Index: readline-5.2/support/shobj-conf
10===================================================================
11--- readline-5.2.orig/support/shobj-conf
12+++ readline-5.2/support/shobj-conf
13@@ -110,7 +110,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
14 SHOBJ_LD='${CC}'
15 SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
16
17- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
18+ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
19 SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
20 ;;
21
diff --git a/meta/recipes-core/readline/readline_5.2.bb b/meta/recipes-core/readline/readline_5.2.bb
deleted file mode 100644
index c1007a2311..0000000000
--- a/meta/recipes-core/readline/readline_5.2.bb
+++ /dev/null
@@ -1,84 +0,0 @@
1SUMMARY = "Library for editing typed command lines"
2DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
3command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
4additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
5lines, and perform csh-like history expansion on previous commands."
6SECTION = "libs"
7
8LICENSE = "GPLv2+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f"
10
11DEPENDS += "ncurses"
12
13PR = "r9"
14
15SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \
16 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-001;name=patch1;apply=yes;striplevel=0 \
17 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-002;name=patch2;apply=yes;striplevel=0 \
18 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-003;name=patch3;apply=yes;striplevel=0 \
19 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-004;name=patch4;apply=yes;striplevel=0 \
20 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-005;name=patch5;apply=yes;striplevel=0 \
21 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-006;name=patch6;apply=yes;striplevel=0 \
22 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-007;name=patch7;apply=yes;striplevel=0 \
23 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-008;name=patch8;apply=yes;striplevel=0 \
24 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-009;name=patch9;apply=yes;striplevel=0 \
25 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-010;name=patch10;apply=yes;striplevel=0 \
26 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-011;name=patch11;apply=yes;striplevel=0 \
27 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-012;name=patch12;apply=yes;striplevel=0 \
28 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-013;name=patch13;apply=yes;striplevel=0 \
29 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-014;name=patch14;apply=yes;striplevel=0 \
30 file://configure-fix.patch \
31 file://config-dirent-symbols.patch \
32 file://fix-redundant-rpath.patch"
33
34SRC_URI[archive.md5sum] = "e39331f32ad14009b9ff49cc10c5e751"
35SRC_URI[archive.sha256sum] = "12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45"
36
37SRC_URI[patch1.md5sum] = "9d4d41622aa9b230c57f68548ce87d8f"
38SRC_URI[patch1.sha256sum] = "eac304c369154059f93049ada328739faaf40338d3cb1fb4b544c93d5ce3f8d5"
39SRC_URI[patch2.md5sum] = "f03e512d14206e37f7d6a748b56b9476"
40SRC_URI[patch2.sha256sum] = "9deacaef25507a0c2ae0b661bf9342559b59a2954d66ea3c5f5bcd900fdfcf78"
41SRC_URI[patch3.md5sum] = "252b42d8750f1a94b6bdf086612dceb2"
42SRC_URI[patch3.sha256sum] = "2a55d2ecb1c9b0147aeb193a6323616ab31c1c525a83b2db3a994b15594ba934"
43SRC_URI[patch4.md5sum] = "a32333c2e603a3ed250514e91050e552"
44SRC_URI[patch4.sha256sum] = "a03b65633781efa7c3aae5d57162985e7b7a3c10acf0f2621be610e16f27e5f2"
45SRC_URI[patch5.md5sum] = "8106796c09b789523a3a78ab69c04b6d"
46SRC_URI[patch5.sha256sum] = "06001896514148a757ea6edbbd40c4fc4331dc653847244386c37b138b150f64"
47SRC_URI[patch6.md5sum] = "512188e2bf0837f7eca19dbf71f182ae"
48SRC_URI[patch6.sha256sum] = "dfef3e982c0adf8bb5a9b7d0468ec8f5f18138b325e28759437464de5be71013"
49SRC_URI[patch7.md5sum] = "ac17aca62eb6fb398c9f2fe9de540aff"
50SRC_URI[patch7.sha256sum] = "775b028c7b761397ac6ae1bdfbac7e896dc3b9b3adc2f91312499180ca13bdd1"
51SRC_URI[patch8.md5sum] = "2484c392db021905f112cf97a94dfd4c"
52SRC_URI[patch8.sha256sum] = "a21b4e0bf0530b878bad24d5be23d18a9e03a75a31ae30844dc0933bb3d77ecd"
53SRC_URI[patch9.md5sum] = "fc6eb35d07914fae5c57d49c12483ff7"
54SRC_URI[patch9.sha256sum] = "138d5e0f0709a47a2d1621295a3dd5e3cc73b63b5cc28dab03abc4e94fe95ecf"
55SRC_URI[patch10.md5sum] = "7a2bf3dc7ac7680b1461a5701100e91b"
56SRC_URI[patch10.sha256sum] = "83f8c1aadb86b1a2fad8821a9c6be72a8de5afd7fd9fde58a30b3b57d939693e"
57SRC_URI[patch11.md5sum] = "ef6cef6822663470f6ac8c517c5a7ec6"
58SRC_URI[patch11.sha256sum] = "08ad3384ab0906e6fa4cc417eb8c43ff59375bcead15fd5c8e31730f0413b3d6"
59SRC_URI[patch12.md5sum] = "e3e9f441c8111589855bc363e5640f6c"
60SRC_URI[patch12.sha256sum] = "20f0243be2299c23213492cc2c19cfd15cc528d2b566a76a2de58306bb9e4c9e"
61SRC_URI[patch13.md5sum] = "3e2e5f543ed268a68fd1fa839faade1a"
62SRC_URI[patch13.sha256sum] = "0cc649516a5bdfa61c5e56937407570288b6972d75aa1bd060ad30ebe98144d5"
63SRC_URI[patch14.md5sum] = "a1be30e1c6f1099bb5fcef00a2631fb8"
64SRC_URI[patch14.sha256sum] = "6f1a68320d01522ca1ea5a737124ecc8739f3dcbfea2dee21e3ccf839a21a817"
65
66inherit autotools
67
68EXTRA_AUTORECONF += "--exclude=autoheader"
69
70LEAD_SONAME = "libreadline.so"
71
72do_configure_prepend () {
73 if [ ! -e ${S}/acinclude.m4 ]; then
74 cat ${S}/aclocal.m4 > ${S}/acinclude.m4
75 fi
76}
77
78do_install_append () {
79 # Make install doesn't properly install these
80 oe_libinstall -so -C shlib libhistory ${D}${libdir}
81 oe_libinstall -so -C shlib libreadline ${D}${libdir}
82}
83
84BBCLASSEXTEND = "native nativesdk"