diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-02-19 07:46:08 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-02-19 07:46:08 +0000 |
commit | a673a799c22768e2180fc539a10e64ff80831d77 (patch) | |
tree | 50c70857c48079e5da19545efc726975ace86948 /sys-devel/make | |
parent | Fixes a crash issue on PPC64. (Fixes bug #58092) (diff) | |
download | gentoo-2-a673a799c22768e2180fc539a10e64ff80831d77.tar.gz gentoo-2-a673a799c22768e2180fc539a10e64ff80831d77.tar.bz2 gentoo-2-a673a799c22768e2180fc539a10e64ff80831d77.zip |
Add patch from upstream for conditional eval statements #123317 by Maurice van der Pot.
(Portage version: 2.1_pre4-r1)
Diffstat (limited to 'sys-devel/make')
-rw-r--r-- | sys-devel/make/ChangeLog | 11 | ||||
-rw-r--r-- | sys-devel/make/files/digest-make-3.80-r4 | 1 | ||||
-rw-r--r-- | sys-devel/make/files/make-3.80-conditional-eval.patch | 157 | ||||
-rw-r--r-- | sys-devel/make/make-3.80-r4.ebuild | 51 |
4 files changed, 218 insertions, 2 deletions
diff --git a/sys-devel/make/ChangeLog b/sys-devel/make/ChangeLog index 8853d5057fa0..45572daaf575 100644 --- a/sys-devel/make/ChangeLog +++ b/sys-devel/make/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-devel/make -# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.32 2005/09/29 22:31:41 vapier Exp $ +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.33 2006/02/19 07:46:08 vapier Exp $ + +*make-3.80-r4 (19 Feb 2006) + + 19 Feb 2006; Mike Frysinger <vapier@gentoo.org> + +files/make-3.80-conditional-eval.patch, +make-3.80-r4.ebuild: + Add patch from upstream for conditional eval statements #123317 by Maurice + van der Pot. *make-3.80-r3 (29 Sep 2005) diff --git a/sys-devel/make/files/digest-make-3.80-r4 b/sys-devel/make/files/digest-make-3.80-r4 new file mode 100644 index 000000000000..bdd63b418ee6 --- /dev/null +++ b/sys-devel/make/files/digest-make-3.80-r4 @@ -0,0 +1 @@ +MD5 0bbd1df101bc0294d440471e50feca71 make-3.80.tar.bz2 920645 diff --git a/sys-devel/make/files/make-3.80-conditional-eval.patch b/sys-devel/make/files/make-3.80-conditional-eval.patch new file mode 100644 index 000000000000..f4c1581f316f --- /dev/null +++ b/sys-devel/make/files/make-3.80-conditional-eval.patch @@ -0,0 +1,157 @@ +Fix from upstream + +https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=1516 +http://bugs.gentoo.org/123317 + +Index: read.c +=================================================================== +RCS file: /cvsroot/make/make/read.c,v +retrieving revision 1.124 +retrieving revision 1.125 +diff -u -p -r1.124 -r1.125 +--- read.c 14 Oct 2002 21:54:04 -0000 1.124 ++++ read.c 25 Oct 2002 22:01:47 -0000 1.125 +@@ -272,6 +272,34 @@ read_all_makefiles (char **makefiles) + return read_makefiles; + } + ++/* Install a new conditional and return the previous one. */ ++ ++static struct conditionals * ++install_conditionals (struct conditionals *new) ++{ ++ struct conditionals *save = conditionals; ++ ++ bzero ((char *) new, sizeof (*new)); ++ conditionals = new; ++ ++ return save; ++} ++ ++/* Free the current conditionals and reinstate a saved one. */ ++ ++static void ++restore_conditionals (struct conditionals *saved) ++{ ++ /* Free any space allocated by conditional_line. */ ++ if (conditionals->ignoring) ++ free (conditionals->ignoring); ++ if (conditionals->seen_else) ++ free (conditionals->seen_else); ++ ++ /* Restore state. */ ++ conditionals = saved; ++} ++ + static int + eval_makefile (char *filename, int flags) + { +@@ -388,6 +416,8 @@ int + eval_buffer (char *buffer) + { + struct ebuffer ebuf; ++ struct conditionals *saved; ++ struct conditionals new; + const struct floc *curfile; + int r; + +@@ -402,8 +432,12 @@ eval_buffer (char *buffer) + curfile = reading_file; + reading_file = &ebuf.floc; + ++ saved = install_conditionals (&new); ++ + r = eval (&ebuf, 1); + ++ restore_conditionals (saved); ++ + reading_file = curfile; + + return r; +@@ -412,13 +446,8 @@ eval_buffer (char *buffer) + + /* Read file FILENAME as a makefile and add its contents to the data base. + +- SET_DEFAULT is true if we are allowed to set the default goal. ++ SET_DEFAULT is true if we are allowed to set the default goal. */ + +- FILENAME is added to the `read_makefiles' chain. +- +- Returns 0 if a file was not found or not read. +- Returns 1 if FILENAME was found and read. +- Returns 2 if FILENAME was read, and we kept a reference (don't free it). */ + + static int + eval (struct ebuffer *ebuf, int set_default) +@@ -782,9 +811,7 @@ eval (struct ebuffer *ebuf, int set_defa + + /* Save the state of conditionals and start + the included makefile with a clean slate. */ +- save = conditionals; +- bzero ((char *) &new_conditionals, sizeof new_conditionals); +- conditionals = &new_conditionals; ++ save = install_conditionals (&new_conditionals); + + /* Record the rules that are waiting so they will determine + the default goal before those in the included makefile. */ +@@ -810,14 +837,8 @@ eval (struct ebuffer *ebuf, int set_defa + } + } + +- /* Free any space allocated by conditional_line. */ +- if (conditionals->ignoring) +- free (conditionals->ignoring); +- if (conditionals->seen_else) +- free (conditionals->seen_else); +- +- /* Restore state. */ +- conditionals = save; ++ /* Restore conditional state. */ ++ restore_conditionals (save); + + goto rule_complete; + } +Index: tests/scripts/functions/eval +=================================================================== +RCS file: /cvsroot/make/make/tests/scripts/functions/eval,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -u -p -r1.1 -r1.2 +--- tests/scripts/functions/eval 8 Jul 2002 02:26:48 -0000 1.1 ++++ tests/scripts/functions/eval 25 Oct 2002 22:01:47 -0000 1.2 +@@ -57,4 +57,35 @@ $answer = "A = A B = B\n"; + + &compare_output($answer,&get_logfile(1)); + ++# Test to make sure eval'ing inside conditionals works properly ++ ++$makefile3 = &get_tmpfile; ++ ++open(MAKEFILE,"> $makefile3"); ++ ++print MAKEFILE <<'EOF'; ++FOO = foo ++ ++all:: ; @echo it ++ ++define Y ++ all:: ; @echo worked ++endef ++ ++ifdef BAR ++$(eval $(Y)) ++endif ++ ++EOF ++ ++close(MAKEFILE); ++ ++&run_make_with_options($makefile3, "", &get_logfile); ++$answer = "it\n"; ++&compare_output($answer,&get_logfile(1)); ++ ++&run_make_with_options($makefile3, "BAR=1", &get_logfile); ++$answer = "it\nworked\n"; ++&compare_output($answer,&get_logfile(1)); ++ + 1; diff --git a/sys-devel/make/make-3.80-r4.ebuild b/sys-devel/make/make-3.80-r4.ebuild new file mode 100644 index 000000000000..58088ee8185c --- /dev/null +++ b/sys-devel/make/make-3.80-r4.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/make-3.80-r4.ebuild,v 1.1 2006/02/19 07:46:08 vapier Exp $ + +inherit eutils flag-o-matic + +DESCRIPTION="Standard tool to compile source trees" +HOMEPAGE="http://www.gnu.org/software/make/make.html" +SRC_URI="ftp://ftp.gnu.org/gnu/make/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="nls static build" + +DEPEND="nls? ( sys-devel/gettext )" +RDEPEND="" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PV}-memory.patch + epatch "${FILESDIR}"/${P}-parallel-build-failure.patch + epatch "${FILESDIR}"/${P}-conditional-eval.patch #123317 +} + +src_compile() { + use static && append-ldflags -static + econf \ + $(use_enable nls) \ + --program-prefix=g \ + || die + emake || die +} + +src_install() { + if use build ; then + if [[ ${USERLAND} == "GNU" ]] ; then + dobin make || die "dobin" + else + newbin make gmake || die "newbin failed" + fi + else + make DESTDIR="${D}" install || die "make install failed" + dodoc AUTHORS ChangeLog NEWS README* + if [[ ${USERLAND} == "GNU" ]] ; then + dosym gmake /usr/bin/make + dosym gmake.1 /usr/share/man/man1/make.1 + fi + fi +} |