diff options
author | Doug Goldstein <cardoe@gentoo.org> | 2008-11-12 18:47:14 +0000 |
---|---|---|
committer | Doug Goldstein <cardoe@gentoo.org> | 2008-11-12 18:47:14 +0000 |
commit | a3ccd99af8f729c9082db595f057674dcd191d99 (patch) | |
tree | 78e8d1baa1f167b8a602b30fe7de64376c830b70 /sys-devel/bison | |
parent | Restrict fltk to 1.1 slot since vmd is not fltk-2 ready (see bug #246445). Re... (diff) | |
download | gentoo-2-a3ccd99af8f729c9082db595f057674dcd191d99.tar.gz gentoo-2-a3ccd99af8f729c9082db595f057674dcd191d99.tar.bz2 gentoo-2-a3ccd99af8f729c9082db595f057674dcd191d99.zip |
apply upstream fix for compatibility issue with older bison's. Thanks Peter Alfredsen <loki_val@gentoo.org>. Fixes bugs #246266, #246193, #246196, and #246262
(Portage version: 2.2_rc14/cvs/Linux 2.6.27-gentoo-r2 x86_64)
Diffstat (limited to 'sys-devel/bison')
-rw-r--r-- | sys-devel/bison/ChangeLog | 10 | ||||
-rw-r--r-- | sys-devel/bison/bison-2.4-r1.ebuild (renamed from sys-devel/bison/bison-2.4.ebuild) | 10 | ||||
-rw-r--r-- | sys-devel/bison/files/bison-2.4.0-compat.patch | 220 |
3 files changed, 238 insertions, 2 deletions
diff --git a/sys-devel/bison/ChangeLog b/sys-devel/bison/ChangeLog index 217735fe0d45..36de35e0514b 100644 --- a/sys-devel/bison/ChangeLog +++ b/sys-devel/bison/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-devel/bison # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/bison/ChangeLog,v 1.73 2008/11/09 19:03:42 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/bison/ChangeLog,v 1.74 2008/11/12 18:47:09 cardoe Exp $ + +*bison-2.4-r1 (12 Nov 2008) + + 12 Nov 2008; Doug Goldstein <cardoe@gentoo.org> + +files/bison-2.4.0-compat.patch, -bison-2.4.ebuild, +bison-2.4-r1.ebuild: + apply upstream fix for compatibility issue with older bison's. Thanks + Peter Alfredsen <loki_val@gentoo.org>. Fixes bugs #246266, #246193, + #246196, and #246262 09 Nov 2008; Zac Medico <zmedico@gentoo.org> bison-2.4.ebuild: Bug #246184 - Rename the yacc.1 man page to avoid collision with diff --git a/sys-devel/bison/bison-2.4.ebuild b/sys-devel/bison/bison-2.4-r1.ebuild index 85226e5ba6af..20117f14a971 100644 --- a/sys-devel/bison/bison-2.4.ebuild +++ b/sys-devel/bison/bison-2.4-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/bison/bison-2.4.ebuild,v 1.2 2008/11/09 19:03:42 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/bison/bison-2.4-r1.ebuild,v 1.1 2008/11/12 18:47:10 cardoe Exp $ inherit toolchain-funcs flag-o-matic @@ -17,6 +17,14 @@ DEPEND="nls? ( sys-devel/gettext )" RDEPEND="sys-devel/m4" +src_unpack() { + unpack ${A} + cd "${S}" + + # fix compatibility with previous bison releases + epatch "${FILESDIR}"/${PN}-2.4.0-compat.patch +} + src_compile() { use static && append-ldflags -static econf $(use_enable nls) || die diff --git a/sys-devel/bison/files/bison-2.4.0-compat.patch b/sys-devel/bison/files/bison-2.4.0-compat.patch new file mode 100644 index 000000000000..9074f5b79a7b --- /dev/null +++ b/sys-devel/bison/files/bison-2.4.0-compat.patch @@ -0,0 +1,220 @@ +diff -NrU5 bison/src/getargs.c bison-2.4.1_pre20081111/src/getargs.c +--- bison/src/getargs.c 2008-11-02 22:55:49.000000000 +0100 ++++ bison-2.4.1_pre20081111/src/getargs.c 2008-11-07 22:48:57.000000000 +0100 +@@ -68,13 +68,13 @@ + { "c++", "c++-skel.m4", ".cc", ".hh", true }, + { "java", "java-skel.m4", ".java", ".java", false }, + { "", "", "", "", false } + }; + +-static int skeleton_prio = 2; ++int skeleton_prio = default_prio; + const char *skeleton = NULL; +-static int language_prio = 2; ++int language_prio = default_prio; + struct bison_language const *language = &valid_languages[0]; + const char *include = NULL; + + char *program_name; + +@@ -518,15 +518,15 @@ + case 'I': + include = AS_FILE_NAME (optarg); + break; + + case 'L': +- language_argmatch (optarg, 0, NULL); ++ language_argmatch (optarg, command_line_prio, NULL); + break; + + case 'S': +- skeleton_arg (AS_FILE_NAME (optarg), 0, NULL); ++ skeleton_arg (AS_FILE_NAME (optarg), command_line_prio, NULL); + break; + + case 'T': + FLAGS_ARGMATCH (trace, optarg); + break; +diff -NrU5 bison/src/getargs.h bison-2.4.1_pre20081111/src/getargs.h +--- bison/src/getargs.h 2008-11-02 22:55:49.000000000 +0100 ++++ bison-2.4.1_pre20081111/src/getargs.h 2008-11-07 22:48:57.000000000 +0100 +@@ -1,9 +1,9 @@ + /* Parse command line arguments for bison. + + Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004, +- 2005, 2006, 2007 Free Software Foundation, Inc. ++ 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + + This file is part of Bison, the GNU Compiler Compiler. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +@@ -22,15 +22,17 @@ + # define GETARGS_H_ + + #include "location.h" + + extern char *program_name; ++enum { command_line_prio, grammar_prio, default_prio }; + + /* flags set by % directives */ + + /* for -S */ + extern char const *skeleton; ++extern int skeleton_prio; + + /* for -I */ + extern char const *include; + + extern bool debug_flag; /* for -t */ +@@ -66,10 +68,11 @@ + char src_extension[sizeof ".java"]; + char header_extension[sizeof ".java"]; + bool add_tab; + }; + ++extern int language_prio; + extern struct bison_language const *language; + + /*-----------. + | --report. | + `-----------*/ +diff -NrU5 bison/src/parse-gram.c bison-2.4.1_pre20081111/src/parse-gram.c +--- bison/src/parse-gram.c 2008-11-02 22:55:49.000000000 +0100 ++++ bison-2.4.1_pre20081111/src/parse-gram.c 2008-11-07 22:48:57.000000000 +0100 +@@ -1,7 +1,7 @@ + +-/* A Bison parser, made by GNU Bison 2.3b.21-d67c5-dirty. */ ++/* A Bison parser, made by GNU Bison 2.4.4-738cd. */ + + /* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. +@@ -44,11 +44,11 @@ + + /* Identify Bison output. */ + #define YYBISON 1 + + /* Bison version. */ +-#define YYBISON_VERSION "2.3b.21-d67c5-dirty" ++#define YYBISON_VERSION "2.4.4-738cd" + + /* Skeleton name. */ + #define YYSKELETON_NAME "yacc.c" + + /* Pure parsers. */ +@@ -1992,11 +1992,11 @@ + + case 18: + + /* Line 1455 of yacc.c */ + #line 257 "parse-gram.y" +- { language_argmatch ((yyvsp[(2) - (2)].chars), 1, &(yylsp[(1) - (2)])); } ++ { language_argmatch ((yyvsp[(2) - (2)].chars), grammar_prio, &(yylsp[(1) - (2)])); } + break; + + case 19: + + /* Line 1455 of yacc.c */ +@@ -2108,11 +2108,11 @@ + } + strcpy (skeleton_build + dir_length, skeleton_user); + skeleton_user = uniqstr_new (skeleton_build); + free (skeleton_build); + } +- skeleton_arg (skeleton_user, 1, &(yylsp[(1) - (2)])); ++ skeleton_arg (skeleton_user, grammar_prio, &(yylsp[(1) - (2)])); + } + break; + + case 31: + +diff -NrU5 bison/src/parse-gram.h bison-2.4.1_pre20081111/src/parse-gram.h +--- bison/src/parse-gram.h 2008-11-02 22:55:49.000000000 +0100 ++++ bison-2.4.1_pre20081111/src/parse-gram.h 2008-11-07 22:48:57.000000000 +0100 +@@ -1,7 +1,7 @@ + +-/* A Bison parser, made by GNU Bison 2.3b.21-d67c5-dirty. */ ++/* A Bison parser, made by GNU Bison 2.4.4-738cd. */ + + /* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. +diff -NrU5 bison/src/parse-gram.y bison-2.4.1_pre20081111/src/parse-gram.y +--- bison/src/parse-gram.y 2008-11-02 22:55:49.000000000 +0100 ++++ bison-2.4.1_pre20081111/src/parse-gram.y 2008-11-07 22:48:57.000000000 +0100 +@@ -252,11 +252,11 @@ + code_props_translate_code (&action); + gram_scanner_last_string_free (); + muscle_code_grow ("initial_action", action.code, @2); + code_scanner_last_string_free (); + } +-| "%language" STRING { language_argmatch ($2, 1, &@1); } ++| "%language" STRING { language_argmatch ($2, grammar_prio, &@1); } + | "%lex-param" "{...}" { add_param ("lex_param", $2, @2); } + | "%locations" { locations_flag = true; } + | "%name-prefix" STRING { spec_name_prefix = $2; } + | "%name-prefix" "=" STRING { spec_name_prefix = $3; } /* deprecated */ + | "%no-lines" { no_lines_flag = true; } +@@ -298,11 +298,11 @@ + } + strcpy (skeleton_build + dir_length, skeleton_user); + skeleton_user = uniqstr_new (skeleton_build); + free (skeleton_build); + } +- skeleton_arg (skeleton_user, 1, &@1); ++ skeleton_arg (skeleton_user, grammar_prio, &@1); + } + | "%token-table" { token_table_flag = true; } + | "%verbose" { report_flag |= report_states; } + | "%yacc" { yacc_flag = true; } + | /*FIXME: Err? What is this horror doing here? */ ";" +diff -NrU5 bison/src/scan-code.l bison-2.4.1_pre20081111/src/scan-code.l +--- bison/src/scan-code.l 2008-11-02 22:55:49.000000000 +0100 ++++ bison-2.4.1_pre20081111/src/scan-code.l 2008-11-07 22:48:57.000000000 +0100 +@@ -1,8 +1,8 @@ + /* Bison Action Scanner -*- C -*- + +- Copyright (C) 2006, 2007 Free Software Foundation, Inc. ++ Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. + + This file is part of Bison, the GNU Compiler Compiler. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +@@ -168,27 +168,30 @@ + obstack_sgrow (&obstack_for_string, "@@"); + } + + "{" STRING_GROW; ++braces_level; + "}" { +- bool outer_brace = --braces_level < 0; ++ bool outer_brace = --braces_level == 0; + + /* As an undocumented Bison extension, append `;' before the last + brace in braced code, so that the user code can omit trailing + `;'. But do not append `;' if emulating Yacc, since Yacc does +- not append one. ++ not append one. Also, some output languages (like Java) do not ++ accept an extra semicolon, so don't append if the user specified ++ a skeleton or language. + + FIXME: Bison should warn if a semicolon seems to be necessary + here, and should omit the semicolon if it seems unnecessary + (e.g., after ';', '{', or '}', each followed by comments or + white space). Such a warning shouldn't depend on --yacc; it + should depend on a new --pedantic option, which would cause + Bison to warn if it detects an extension to POSIX. --pedantic + should also diagnose other Bison extensions like %yacc. + Perhaps there should also be a GCC-style --pedantic-errors + option, so that such warnings are diagnosed as errors. */ +- if (outer_brace && ! yacc_flag) ++ if (outer_brace && !yacc_flag && language_prio == default_prio ++ && skeleton_prio == default_prio) + obstack_1grow (&obstack_for_string, ';'); + + STRING_GROW; + } + } |