summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-09-17 23:29:34 +0000
committerMike Frysinger <vapier@gentoo.org>2011-09-17 23:29:34 +0000
commit5459f5a50dc8bdbcf8532808f9c8f0e927aefa73 (patch)
treec162a42336dc1b1cf7019be56a63b1498b17d837 /sys-devel/make
parentInitial commit by Jeff D. Horelick. (diff)
downloadgentoo-2-5459f5a50dc8bdbcf8532808f9c8f0e927aefa73.tar.gz
gentoo-2-5459f5a50dc8bdbcf8532808f9c8f0e927aefa73.tar.bz2
gentoo-2-5459f5a50dc8bdbcf8532808f9c8f0e927aefa73.zip
Add more complete glob optimization patch from upstream #382845 by Tomáš Chvátal.
(Portage version: 2.2.0_alpha58/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel/make')
-rw-r--r--sys-devel/make/ChangeLog9
-rw-r--r--sys-devel/make/files/make-3.82-glob-speedup.patch104
-rw-r--r--sys-devel/make/make-3.82-r3.ebuild44
3 files changed, 156 insertions, 1 deletions
diff --git a/sys-devel/make/ChangeLog b/sys-devel/make/ChangeLog
index aea5f283853c..a46339126adc 100644
--- a/sys-devel/make/ChangeLog
+++ b/sys-devel/make/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-devel/make
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.87 2011/09/17 07:25:05 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.88 2011/09/17 23:29:34 vapier Exp $
+
+*make-3.82-r3 (17 Sep 2011)
+
+ 17 Sep 2011; Mike Frysinger <vapier@gentoo.org> +make-3.82-r3.ebuild,
+ +files/make-3.82-glob-speedup.patch:
+ Add more complete glob optimization patch from upstream #382845 by Tomáš
+ Chvátal.
17 Sep 2011; Mike Frysinger <vapier@gentoo.org> -make-3.82-r2.ebuild,
-files/make-3.82-glob-speedup.patch:
diff --git a/sys-devel/make/files/make-3.82-glob-speedup.patch b/sys-devel/make/files/make-3.82-glob-speedup.patch
new file mode 100644
index 000000000000..c826c2c0e1fa
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-glob-speedup.patch
@@ -0,0 +1,104 @@
+change from upstream to speed up by skipping unused globs
+https://bugs.gentoo.org/382845
+
+http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.198&r2=1.200
+
+Revision 1.200
+Sat May 7 14:36:12 2011 UTC (4 months, 1 week ago) by psmith
+Branch: MAIN
+Changes since 1.199: +1 -1 lines
+Inverted the boolean test from what I wanted it to be. Added a
+regression test to make sure this continues to work.
+
+Revision 1.199
+Mon May 2 00:18:06 2011 UTC (4 months, 2 weeks ago) by psmith
+Branch: MAIN
+Changes since 1.198: +35 -25 lines
+Avoid invoking glob() unless the filename has potential globbing
+characters in it, for performance improvements.
+
+--- a/read.c 2011/04/29 15:27:39 1.198
++++ b/read.c 2011/05/07 14:36:12 1.200
+@@ -2901,6 +2901,7 @@
+ const char *name;
+ const char **nlist = 0;
+ char *tildep = 0;
++ int globme = 1;
+ #ifndef NO_ARCHIVES
+ char *arname = 0;
+ char *memname = 0;
+@@ -3109,32 +3110,40 @@
+ }
+ #endif /* !NO_ARCHIVES */
+
+- switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
+- {
+- case GLOB_NOSPACE:
+- fatal (NILF, _("virtual memory exhausted"));
+-
+- case 0:
+- /* Success. */
+- i = gl.gl_pathc;
+- nlist = (const char **)gl.gl_pathv;
+- break;
+-
+- case GLOB_NOMATCH:
+- /* If we want only existing items, skip this one. */
+- if (flags & PARSEFS_EXISTS)
+- {
+- i = 0;
+- break;
+- }
+- /* FALLTHROUGH */
+-
+- default:
+- /* By default keep this name. */
++ /* glob() is expensive: don't call it unless we need to. */
++ if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL)
++ {
++ globme = 0;
+ i = 1;
+ nlist = &name;
+- break;
+- }
++ }
++ else
++ switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
++ {
++ case GLOB_NOSPACE:
++ fatal (NILF, _("virtual memory exhausted"));
++
++ case 0:
++ /* Success. */
++ i = gl.gl_pathc;
++ nlist = (const char **)gl.gl_pathv;
++ break;
++
++ case GLOB_NOMATCH:
++ /* If we want only existing items, skip this one. */
++ if (flags & PARSEFS_EXISTS)
++ {
++ i = 0;
++ break;
++ }
++ /* FALLTHROUGH */
++
++ default:
++ /* By default keep this name. */
++ i = 1;
++ nlist = &name;
++ break;
++ }
+
+ /* For each matched element, add it to the list. */
+ while (i-- > 0)
+@@ -3174,7 +3183,8 @@
+ #endif /* !NO_ARCHIVES */
+ NEWELT (concat (2, prefix, nlist[i]));
+
+- globfree (&gl);
++ if (globme)
++ globfree (&gl);
+
+ #ifndef NO_ARCHIVES
+ if (arname)
diff --git a/sys-devel/make/make-3.82-r3.ebuild b/sys-devel/make/make-3.82-r3.ebuild
new file mode 100644
index 000000000000..b1de58f7df65
--- /dev/null
+++ b/sys-devel/make/make-3.82-r3.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/make-3.82-r3.ebuild,v 1.1 2011/09/17 23:29:34 vapier Exp $
+
+EAPI="2"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="http://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="nls static"
+
+DEPEND="nls? ( sys-devel/gettext )"
+RDEPEND="nls? ( virtual/libintl )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-archives-many-objs.patch #334889
+ epatch "${FILESDIR}"/${P}-MAKEFLAGS-reexec.patch #31975
+ epatch "${FILESDIR}"/${P}-memory-corruption.patch #355907
+ epatch "${FILESDIR}"/${P}-glob-speedup.patch #382845
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --program-prefix=g \
+ $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS ChangeLog NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ # we install everywhere as 'gmake' but on GNU systems,
+ # symlink 'make' to 'gmake'
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}