Gentoo Archives: gentoo-commits

From: Sebastian Pipping <sping@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/betagarden:master commit in: sys-devel/make/files/, sys-devel/make/
Date: Mon, 26 Sep 2011 21:07:25
Message-Id: 491cba441cee11a8b81abb1fc4754808e517c914.sping@gentoo
1 commit: 491cba441cee11a8b81abb1fc4754808e517c914
2 Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org>
3 AuthorDate: Mon Sep 26 20:59:22 2011 +0000
4 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 26 21:06:19 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=491cba44
7
8 sys-devel/make: 3.82-r3 (dup from main tree)
9
10 ---
11 .../make/files/make-3.82-MAKEFLAGS-reexec.patch | 14 +++
12 .../make/files/make-3.82-archives-many-objs.patch | 60 +++++++++++
13 sys-devel/make/files/make-3.82-glob-speedup.patch | 104 ++++++++++++++++++++
14 .../make/files/make-3.82-memory-corruption.patch | 37 +++++++
15 sys-devel/make/make-3.82-r3.ebuild | 44 ++++++++
16 5 files changed, 259 insertions(+), 0 deletions(-)
17
18 diff --git a/sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch b/sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch
19 new file mode 100644
20 index 0000000..a2f5965
21 --- /dev/null
22 +++ b/sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch
23 @@ -0,0 +1,14 @@
24 +http://bugs.gentoo.org/331975
25 +https://savannah.gnu.org/bugs/?30723
26 +
27 +--- main.c 2010/07/19 07:10:53 1.243
28 ++++ main.c 2010/08/10 07:35:34 1.244
29 +@@ -2093,7 +2093,7 @@
30 + const char *pv = define_makeflags (1, 1);
31 + char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
32 + sprintf (p, "MAKEFLAGS=%s", pv);
33 +- putenv (p);
34 ++ putenv (allocated_variable_expand (p));
35 + }
36 +
37 + if (ISDB (DB_BASIC))
38
39 diff --git a/sys-devel/make/files/make-3.82-archives-many-objs.patch b/sys-devel/make/files/make-3.82-archives-many-objs.patch
40 new file mode 100644
41 index 0000000..abdcd32
42 --- /dev/null
43 +++ b/sys-devel/make/files/make-3.82-archives-many-objs.patch
44 @@ -0,0 +1,60 @@
45 +http://bugs.gentoo.org/334889
46 +https://savannah.gnu.org/bugs/?30612
47 +
48 +revision 1.194
49 +date: 2010-08-13 22:50:14 -0400; author: psmith; state: Exp; lines: +9 -6; commitid: 4UaslPqQHZTs5wKu;
50 +- Fix Savannah bug #30612: handling of archive references with >1 object
51 +
52 +Index: read.c
53 +===================================================================
54 +RCS file: /sources/make/make/read.c,v
55 +retrieving revision 1.193
56 +retrieving revision 1.194
57 +diff -u -p -r1.193 -r1.194
58 +--- read.c 13 Jul 2010 01:20:42 -0000 1.193
59 ++++ read.c 14 Aug 2010 02:50:14 -0000 1.194
60 +@@ -3028,7 +3028,7 @@ parse_file_seq (char **stringp, unsigned
61 + {
62 + /* This looks like the first element in an open archive group.
63 + A valid group MUST have ')' as the last character. */
64 +- const char *e = p + nlen;
65 ++ const char *e = p;
66 + do
67 + {
68 + e = next_token (e);
69 +@@ -3084,19 +3084,19 @@ parse_file_seq (char **stringp, unsigned
70 + Go to the next item in the string. */
71 + if (flags & PARSEFS_NOGLOB)
72 + {
73 +- NEWELT (concat (2, prefix, tp));
74 ++ NEWELT (concat (2, prefix, tmpbuf));
75 + continue;
76 + }
77 +
78 + /* If we get here we know we're doing glob expansion.
79 + TP is a string in tmpbuf. NLEN is no longer used.
80 + We may need to do more work: after this NAME will be set. */
81 +- name = tp;
82 ++ name = tmpbuf;
83 +
84 + /* Expand tilde if applicable. */
85 +- if (tp[0] == '~')
86 ++ if (tmpbuf[0] == '~')
87 + {
88 +- tildep = tilde_expand (tp);
89 ++ tildep = tilde_expand (tmpbuf);
90 + if (tildep != 0)
91 + name = tildep;
92 + }
93 +@@ -3152,7 +3152,10 @@ parse_file_seq (char **stringp, unsigned
94 + else
95 + {
96 + /* We got a chain of items. Attach them. */
97 +- (*newp)->next = found;
98 ++ if (*newp)
99 ++ (*newp)->next = found;
100 ++ else
101 ++ *newp = found;
102 +
103 + /* Find and set the new end. Massage names if necessary. */
104 + while (1)
105
106 diff --git a/sys-devel/make/files/make-3.82-glob-speedup.patch b/sys-devel/make/files/make-3.82-glob-speedup.patch
107 new file mode 100644
108 index 0000000..c826c2c
109 --- /dev/null
110 +++ b/sys-devel/make/files/make-3.82-glob-speedup.patch
111 @@ -0,0 +1,104 @@
112 +change from upstream to speed up by skipping unused globs
113 +https://bugs.gentoo.org/382845
114 +
115 +http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.198&r2=1.200
116 +
117 +Revision 1.200
118 +Sat May 7 14:36:12 2011 UTC (4 months, 1 week ago) by psmith
119 +Branch: MAIN
120 +Changes since 1.199: +1 -1 lines
121 +Inverted the boolean test from what I wanted it to be. Added a
122 +regression test to make sure this continues to work.
123 +
124 +Revision 1.199
125 +Mon May 2 00:18:06 2011 UTC (4 months, 2 weeks ago) by psmith
126 +Branch: MAIN
127 +Changes since 1.198: +35 -25 lines
128 +Avoid invoking glob() unless the filename has potential globbing
129 +characters in it, for performance improvements.
130 +
131 +--- a/read.c 2011/04/29 15:27:39 1.198
132 ++++ b/read.c 2011/05/07 14:36:12 1.200
133 +@@ -2901,6 +2901,7 @@
134 + const char *name;
135 + const char **nlist = 0;
136 + char *tildep = 0;
137 ++ int globme = 1;
138 + #ifndef NO_ARCHIVES
139 + char *arname = 0;
140 + char *memname = 0;
141 +@@ -3109,32 +3110,40 @@
142 + }
143 + #endif /* !NO_ARCHIVES */
144 +
145 +- switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
146 +- {
147 +- case GLOB_NOSPACE:
148 +- fatal (NILF, _("virtual memory exhausted"));
149 +-
150 +- case 0:
151 +- /* Success. */
152 +- i = gl.gl_pathc;
153 +- nlist = (const char **)gl.gl_pathv;
154 +- break;
155 +-
156 +- case GLOB_NOMATCH:
157 +- /* If we want only existing items, skip this one. */
158 +- if (flags & PARSEFS_EXISTS)
159 +- {
160 +- i = 0;
161 +- break;
162 +- }
163 +- /* FALLTHROUGH */
164 +-
165 +- default:
166 +- /* By default keep this name. */
167 ++ /* glob() is expensive: don't call it unless we need to. */
168 ++ if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL)
169 ++ {
170 ++ globme = 0;
171 + i = 1;
172 + nlist = &name;
173 +- break;
174 +- }
175 ++ }
176 ++ else
177 ++ switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
178 ++ {
179 ++ case GLOB_NOSPACE:
180 ++ fatal (NILF, _("virtual memory exhausted"));
181 ++
182 ++ case 0:
183 ++ /* Success. */
184 ++ i = gl.gl_pathc;
185 ++ nlist = (const char **)gl.gl_pathv;
186 ++ break;
187 ++
188 ++ case GLOB_NOMATCH:
189 ++ /* If we want only existing items, skip this one. */
190 ++ if (flags & PARSEFS_EXISTS)
191 ++ {
192 ++ i = 0;
193 ++ break;
194 ++ }
195 ++ /* FALLTHROUGH */
196 ++
197 ++ default:
198 ++ /* By default keep this name. */
199 ++ i = 1;
200 ++ nlist = &name;
201 ++ break;
202 ++ }
203 +
204 + /* For each matched element, add it to the list. */
205 + while (i-- > 0)
206 +@@ -3174,7 +3183,8 @@
207 + #endif /* !NO_ARCHIVES */
208 + NEWELT (concat (2, prefix, nlist[i]));
209 +
210 +- globfree (&gl);
211 ++ if (globme)
212 ++ globfree (&gl);
213 +
214 + #ifndef NO_ARCHIVES
215 + if (arname)
216
217 diff --git a/sys-devel/make/files/make-3.82-memory-corruption.patch b/sys-devel/make/files/make-3.82-memory-corruption.patch
218 new file mode 100644
219 index 0000000..b28c073
220 --- /dev/null
221 +++ b/sys-devel/make/files/make-3.82-memory-corruption.patch
222 @@ -0,0 +1,37 @@
223 +--- function.c 2011/04/18 01:25:20 1.121
224 ++++ function.c 2011/05/02 12:35:01 1.122
225 +@@ -706,7 +706,7 @@
226 + const char *word_iterator = argv[0];
227 + char buf[20];
228 +
229 +- while (find_next_token (&word_iterator, (unsigned int *) 0) != 0)
230 ++ while (find_next_token (&word_iterator, NULL) != 0)
231 + ++i;
232 +
233 + sprintf (buf, "%d", i);
234 +@@ -1133,21 +1133,14 @@
235 +
236 + /* Find the maximum number of words we'll have. */
237 + t = argv[0];
238 +- wordi = 1;
239 +- while (*t != '\0')
240 ++ wordi = 0;
241 ++ while ((p = find_next_token (&t, NULL)) != 0)
242 + {
243 +- char c = *(t++);
244 +-
245 +- if (! isspace ((unsigned char)c))
246 +- continue;
247 +-
248 ++ ++t;
249 + ++wordi;
250 +-
251 +- while (isspace ((unsigned char)*t))
252 +- ++t;
253 + }
254 +
255 +- words = xmalloc (wordi * sizeof (char *));
256 ++ words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *));
257 +
258 + /* Now assign pointers to each string in the array. */
259 + t = argv[0];
260
261 diff --git a/sys-devel/make/make-3.82-r3.ebuild b/sys-devel/make/make-3.82-r3.ebuild
262 new file mode 100644
263 index 0000000..b1de58f
264 --- /dev/null
265 +++ b/sys-devel/make/make-3.82-r3.ebuild
266 @@ -0,0 +1,44 @@
267 +# Copyright 1999-2011 Gentoo Foundation
268 +# Distributed under the terms of the GNU General Public License v2
269 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/make-3.82-r3.ebuild,v 1.1 2011/09/17 23:29:34 vapier Exp $
270 +
271 +EAPI="2"
272 +
273 +inherit flag-o-matic eutils
274 +
275 +DESCRIPTION="Standard tool to compile source trees"
276 +HOMEPAGE="http://www.gnu.org/software/make/make.html"
277 +SRC_URI="mirror://gnu//make/${P}.tar.bz2"
278 +
279 +LICENSE="GPL-3"
280 +SLOT="0"
281 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
282 +IUSE="nls static"
283 +
284 +DEPEND="nls? ( sys-devel/gettext )"
285 +RDEPEND="nls? ( virtual/libintl )"
286 +
287 +src_prepare() {
288 + epatch "${FILESDIR}"/${P}-archives-many-objs.patch #334889
289 + epatch "${FILESDIR}"/${P}-MAKEFLAGS-reexec.patch #31975
290 + epatch "${FILESDIR}"/${P}-memory-corruption.patch #355907
291 + epatch "${FILESDIR}"/${P}-glob-speedup.patch #382845
292 +}
293 +
294 +src_configure() {
295 + use static && append-ldflags -static
296 + econf \
297 + --program-prefix=g \
298 + $(use_enable nls)
299 +}
300 +
301 +src_install() {
302 + emake DESTDIR="${D}" install || die "make install failed"
303 + dodoc AUTHORS ChangeLog NEWS README*
304 + if [[ ${USERLAND} == "GNU" ]] ; then
305 + # we install everywhere as 'gmake' but on GNU systems,
306 + # symlink 'make' to 'gmake'
307 + dosym gmake /usr/bin/make
308 + dosym gmake.1 /usr/share/man/man1/make.1
309 + fi
310 +}