From f4eb91ebfc1a8c46f217c7434a266885af679958 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Thu, 24 Dec 2015 15:49:32 +0000 Subject: [PATCH] bison: added recipe for version 3.0.4 --- sys-devel/bison/bison-2.6.5.recipe | 6 +- sys-devel/bison/bison-3.0.4.recipe | 71 +++++++ sys-devel/bison/patches/bison-3.0.4.patchset | 196 +++++++++++++++++++ 3 files changed, 270 insertions(+), 3 deletions(-) create mode 100644 sys-devel/bison/bison-3.0.4.recipe create mode 100644 sys-devel/bison/patches/bison-3.0.4.patchset diff --git a/sys-devel/bison/bison-2.6.5.recipe b/sys-devel/bison/bison-2.6.5.recipe index a4479e3bc..12d3fc5fe 100644 --- a/sys-devel/bison/bison-2.6.5.recipe +++ b/sys-devel/bison/bison-2.6.5.recipe @@ -22,10 +22,10 @@ SECONDARY_ARCHITECTURES="x86 x86_gcc2" PROVIDES=" - bison$secondaryArchSuffix = $portVersion compat >= 2.6 - cmd:bison$secondaryArchSuffix = $portVersion compat >= 2.6 + bison$secondaryArchSuffix = $portVersion compat >= 2.5 + cmd:bison$secondaryArchSuffix = $portVersion compat >= 2.5 cmd:yacc$secondaryArchSuffix - devel:liby$secondaryArchSuffix = $portVersion compat >= 2.6 + devel:liby$secondaryArchSuffix = $portVersion compat >= 2.5 " REQUIRES=" haiku$secondaryArchSuffix diff --git a/sys-devel/bison/bison-3.0.4.recipe b/sys-devel/bison/bison-3.0.4.recipe new file mode 100644 index 000000000..1d67e6e17 --- /dev/null +++ b/sys-devel/bison/bison-3.0.4.recipe @@ -0,0 +1,71 @@ +SUMMARY="A yacc-compatible parser generator" +DESCRIPTION="Bison is a general-purpose parser generator that converts an \ +annotated context-free grammar into an LALR(1) or GLR parser for that \ +grammar. Once you are proficient with Bison, you can use it to develop a wide \ +range of language parsers, from those used in simple desk calculators to \ +complex programming languages. + +Bison is upward compatible with Yacc: all properly-written Yacc grammars ought \ +to work with Bison with no change. Anyone familiar with Yacc should be able to \ +use Bison with little trouble. You need to be fluent in C or C++ programming \ +in order to use Bison." +HOMEPAGE="http://www.gnu.org/software/bison/bison.html" +COPYRIGHT="1992-2011 Free Software Foundation, Inc." +LICENSE="GNU GPL v3" +REVISION="1" +SOURCE_URI="http://ftp.gnu.org/gnu/bison/bison-$portVersion.tar.xz" +CHECKSUM_SHA256="a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1" +PATCHES="bison-${portVersion}.patchset" + +ARCHITECTURES="x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="x86 x86_gcc2" + + +PROVIDES=" + bison$secondaryArchSuffix = $portVersion compat >= 2 + cmd:bison$secondaryArchSuffix = $portVersion compat >= 2 + cmd:yacc$secondaryArchSuffix + devel:liby$secondaryArchSuffix = $portVersion compat >= 2 + " +REQUIRES=" + haiku$secondaryArchSuffix + cmd:m4 + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:awk + cmd:diff + cmd:flex + cmd:help2man + cmd:m4 + cmd:make + cmd:makeinfo + cmd:perl + cmd:sed + " + +BUILD() +{ + runConfigure ./configure + make $jobArgs +} + +INSTALL() +{ + make install + + prepareInstalledDevelLibs liby + + rm $libDir/charset.alias + rmdir $libDir +} + +TEST() +{ + make check +} diff --git a/sys-devel/bison/patches/bison-3.0.4.patchset b/sys-devel/bison/patches/bison-3.0.4.patchset new file mode 100644 index 000000000..cc9413c0c --- /dev/null +++ b/sys-devel/bison/patches/bison-3.0.4.patchset @@ -0,0 +1,196 @@ +From 106cc98f0ecd239bc71eb44a908e9c7e0f63af67 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Thu, 24 Dec 2015 14:57:38 +0000 +Subject: gcc2 fix + + +diff --git a/src/AnnotationList.c b/src/AnnotationList.c +index 586ed9b..375001a 100644 +--- a/src/AnnotationList.c ++++ b/src/AnnotationList.c +@@ -230,12 +230,12 @@ AnnotationList__computePredecessorAnnotations (AnnotationList *self, state *s, + state **predecessor; + for (predecessor = predecessors[s->number]; *predecessor; ++predecessor) + { ++ bool potential_contribution = false; ++ bitset *lookaheads = NULL; + AnnotationList *annotation_node = + AnnotationList__alloc_on_obstack ( + self->inadequacyNode->contributionCount, annotations_obstackp); + annotation_node->inadequacyNode = self->inadequacyNode; +- bool potential_contribution = false; +- bitset *lookaheads = NULL; + { + ContributionIndex ci; + for (ci = 0; ci < self->inadequacyNode->contributionCount; ++ci) +diff --git a/src/complain.c b/src/complain.c +index 22e18cb..4cc2361 100644 +--- a/src/complain.c ++++ b/src/complain.c +@@ -104,6 +104,7 @@ ARGMATCH_VERIFY (warnings_args, warnings_types); + void + warning_argmatch (char const *arg, size_t no, size_t err) + { ++ size_t b; + int value = XARGMATCH ("--warning", arg + no + err, + warnings_args, warnings_types); + +@@ -114,7 +115,6 @@ warning_argmatch (char const *arg, size_t no, size_t err) + no = !no; + } + +- size_t b; + for (b = 0; b < warnings_size; ++b) + if (value & 1 << b) + { +diff --git a/src/getargs.c b/src/getargs.c +index fa9e3c1..433ff27 100644 +--- a/src/getargs.c ++++ b/src/getargs.c +@@ -253,6 +253,7 @@ usage (int status) + program_name); + else + { ++ const char *lc_messages = setlocale (LC_MESSAGES, NULL); + /* For ../build-aux/cross-options.pl to work, use the format: + ^ -S, --long[=ARGS] (whitespace) + A --long option is required. +@@ -363,7 +364,6 @@ FEATURE is a list of comma separated words that can include:\n\ + /* Don't output this redundant message for English locales. + Note we still output for 'C' so that it gets included in the + man page. */ +- const char *lc_messages = setlocale (LC_MESSAGES, NULL); + if (lc_messages && !STREQ (lc_messages, "en_")) + /* TRANSLATORS: Replace LANG_CODE in this URL with your language + code to +diff --git a/src/ielr.c b/src/ielr.c +index 8b28e67..29a2726 100644 +--- a/src/ielr.c ++++ b/src/ielr.c +@@ -1032,9 +1032,9 @@ ielr_split_states (bitsetv follow_kernel_items, bitsetv always_follows, + lookahead sets. */ + if (!annotation_lists) + { ++ state_list *node; + timevar_push (TV_IELR_PHASE4); + initialize_LA (); +- state_list *node; + for (node = first_state; node; node = node->next) + if (!node->state->consistent) + { +diff --git a/src/muscle-tab.c b/src/muscle-tab.c +index b38598b..4b285fb 100644 +--- a/src/muscle-tab.c ++++ b/src/muscle-tab.c +@@ -468,12 +468,13 @@ muscle_percent_variable_update (char const *variable, location variable_loc, + && STREQ (eq + 1, *value)) + : STREQ (c->obsolete, variable)) + { ++ char *res; + char *old = define_directive (c->obsolete, *value); + char *upd = define_directive (c->updated, *value); + deprecated_directive (&variable_loc, old, upd); + free (old); + free (upd); +- char *res = xstrdup (c->updated); ++ res = xstrdup (c->updated); + { + char *eq2 = strchr (res, '='); + if (eq2) +@@ -506,6 +507,7 @@ muscle_percent_define_insert (char const *var, location variable_loc, + if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE + && muscle_find_const (name)) + { ++ location loc; + muscle_percent_define_how how_old = atoi (muscle_find_const (how_name)); + unsigned i = 0; + if (how_old == MUSCLE_PERCENT_DEFINE_F) +@@ -514,7 +516,7 @@ muscle_percent_define_insert (char const *var, location variable_loc, + _("%%define variable %s redefined"), + quote (variable)); + i += SUB_INDENT; +- location loc = muscle_percent_define_get_loc (variable); ++ loc = muscle_percent_define_get_loc (variable); + complain_indent (&loc, complaint, &i, _("previous definition")); + } + +@@ -657,8 +659,9 @@ muscle_percent_define_flag_if (char const *variable) + result = false; + else if (!muscle_find_const (invalid_boolean_name)) + { ++ location loc; + muscle_insert (invalid_boolean_name, ""); +- location loc = muscle_percent_define_get_loc (variable); ++ loc = muscle_percent_define_get_loc (variable); + complain (&loc, complaint, + _("invalid value for %%define Boolean variable %s"), + quote (variable)); +diff --git a/src/scan-gram.l b/src/scan-gram.l +index a7e9bc4..18b4426 100644 +--- a/src/scan-gram.l ++++ b/src/scan-gram.l +@@ -952,10 +952,11 @@ handle_syncline (char *args, location loc) + static void + unexpected_end (boundary start, char const *msgid, char const *token_end) + { ++ size_t i; + location loc; + loc.start = start; + loc.end = scanner_cursor; +- size_t i = strlen (token_end); ++ i = strlen (token_end); + + /* Adjust scanner cursor so that any later message does not count + the characters about to be inserted. */ +diff --git a/src/symlist.c b/src/symlist.c +index 109c27c..18e6623 100644 +--- a/src/symlist.c ++++ b/src/symlist.c +@@ -120,9 +120,9 @@ symbol_list_prepend (symbol_list *list, symbol_list *node) + symbol_list * + symbol_list_append (symbol_list *list, symbol_list *node) + { ++ symbol_list *next = list; + if (!list) + return node; +- symbol_list *next = list; + while (next->next) + next = next->next; + next->next = node; +diff --git a/src/symtab.c b/src/symtab.c +index fb025da..93f36b8 100644 +--- a/src/symtab.c ++++ b/src/symtab.c +@@ -1030,8 +1030,9 @@ init_prec_nodes (void) + prec_nodes = xcalloc (nsyms, sizeof *prec_nodes); + for (i = 0; i < nsyms; ++i) + { ++ symgraph *s; + prec_nodes[i] = xmalloc (sizeof *prec_nodes[i]); +- symgraph *s = prec_nodes[i]; ++ s = prec_nodes[i]; + s->id = i; + s->succ = 0; + s->pred = 0; +diff --git a/src/uniqstr.c b/src/uniqstr.c +index a4e2db0..9a8e30b 100644 +--- a/src/uniqstr.c ++++ b/src/uniqstr.c +@@ -63,12 +63,14 @@ uniqstr_vsprintf (char const *format, ...) + length = vsnprintf (NULL, 0, format, args); + va_end (args); + ++{ + char res[length + 1]; + va_start (args, format); + vsprintf (res, format, args); + va_end (args); + return uniqstr_new (res); + } ++} + + /*------------------------------. + | Abort if S is not a uniqstr. | +-- +2.2.2 +