summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-09-17 05:21:57 +0000
committerMike Frysinger <vapier@gentoo.org>2011-09-17 05:21:57 +0000
commit397bf25b55c015a119d2279b8ac18926e3f39e36 (patch)
tree654731ebb194567c58f1ccb0c10cde2c0587d5f2 /sys-devel
parentAdd fix from upstream for posix regex behavior #382919 by Christian Kaps. (diff)
downloadgentoo-2-397bf25b55c015a119d2279b8ac18926e3f39e36.tar.gz
gentoo-2-397bf25b55c015a119d2279b8ac18926e3f39e36.tar.bz2
gentoo-2-397bf25b55c015a119d2279b8ac18926e3f39e36.zip
Add 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')
-rw-r--r--sys-devel/make/ChangeLog8
-rw-r--r--sys-devel/make/files/make-3.82-glob-speedup.patch89
-rw-r--r--sys-devel/make/make-3.82-r2.ebuild44
3 files changed, 140 insertions, 1 deletions
diff --git a/sys-devel/make/ChangeLog b/sys-devel/make/ChangeLog
index dde744ff9013..ec7adab32a9c 100644
--- a/sys-devel/make/ChangeLog
+++ b/sys-devel/make/ChangeLog
@@ -1,6 +1,12 @@
# 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.85 2011/09/05 11:20:41 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.86 2011/09/17 05:21:57 vapier Exp $
+
+*make-3.82-r2 (17 Sep 2011)
+
+ 17 Sep 2011; Mike Frysinger <vapier@gentoo.org> +make-3.82-r2.ebuild,
+ +files/make-3.82-glob-speedup.patch:
+ Add glob optimization patch from upstream #382845 by Tomáš Chvátal.
05 Sep 2011; Jeroen Roovers <jer@gentoo.org> make-3.82-r1.ebuild:
Stable for HPPA (bug #381199).
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..79ca87eb60f5
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-glob-speedup.patch
@@ -0,0 +1,89 @@
+change from upstream to speed up by skipping unused globs
+
+https://bugs.gentoo.org/382845
+
+--- a/read.c 2011/04/29 15:27:39 1.198
++++ b/read.c 2011/05/02 00:18:06 1.199
+@@ -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-r2.ebuild b/sys-devel/make/make-3.82-r2.ebuild
new file mode 100644
index 000000000000..6e4ec2db80a4
--- /dev/null
+++ b/sys-devel/make/make-3.82-r2.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-r2.ebuild,v 1.1 2011/09/17 05:21:57 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
+}