1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-17 03:25:46 +00:00

Add the Bison 1.25 bug-for-bug "broken-undeftoken-init" compatiblity option

taken from src/contrib/bison, as we will need this if one is buiding our
older EGCS source base.
This commit is contained in:
David E. O'Brien 2000-01-17 11:42:02 +00:00
parent 177ea6b5ae
commit 78b76c5699
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=24790
12 changed files with 240 additions and 0 deletions

View File

@ -0,0 +1,18 @@
--- src/getargs.c.orig Mon Jun 14 15:19:05 1999
+++ src/getargs.c Mon Jan 17 03:38:56 2000
@@ -31,6 +31,7 @@
int noparserflag = 0;
int toknumflag = 0;
int rawtoknumflag = 0;
+int broken_undeftoken_init;
char *spec_name_prefix; /* for -p. */
char *spec_file_prefix; /* for -b. */
extern int fixed_outfiles;/* for -y */
@@ -44,6 +45,7 @@
struct option longopts[] =
{
+ {"broken-undeftoken-init", 0, &broken_undeftoken_init, 1},
{"debug", 0, &debugflag, 1},
{"defines", 0, &definesflag, 1},
{"file-prefix", 1, 0, 'b'},

View File

@ -0,0 +1,22 @@
--- src/reader.c.orig Mon Jun 14 15:19:05 1999
+++ src/reader.c Mon Jan 17 03:38:56 2000
@@ -44,6 +44,7 @@
int rline_allocated;
extern char *program_name;
+extern int broken_undeftoken_init;
extern int definesflag;
extern int nolinesflag;
extern int noparserflag;
@@ -199,7 +200,10 @@
/* it is always token number 2. */
undeftoken = getsym("$undefined.");
undeftoken->class = STOKEN;
- undeftoken->user_token_number = 2;
+ /* XXX ``broken_undeftoken_init'' makes Bison 1.28 bug-compatable
+ with Bison 1.25. FreeBSD depends on this behavior when compiling
+ EGCS-1.1.2's cc1plus. */
+ undeftoken->user_token_number = broken_undeftoken_init ? 0 : 2;
/* Read the declaration section. Copy %{ ... %} groups to ftable and fdefines file.
Also notice any %token, %left, etc. found there. */
if (noparserflag)

View File

@ -0,0 +1,18 @@
--- src/getargs.c.orig Mon Jun 14 15:19:05 1999
+++ src/getargs.c Mon Jan 17 03:38:56 2000
@@ -31,6 +31,7 @@
int noparserflag = 0;
int toknumflag = 0;
int rawtoknumflag = 0;
+int broken_undeftoken_init;
char *spec_name_prefix; /* for -p. */
char *spec_file_prefix; /* for -b. */
extern int fixed_outfiles;/* for -y */
@@ -44,6 +45,7 @@
struct option longopts[] =
{
+ {"broken-undeftoken-init", 0, &broken_undeftoken_init, 1},
{"debug", 0, &debugflag, 1},
{"defines", 0, &definesflag, 1},
{"file-prefix", 1, 0, 'b'},

View File

@ -0,0 +1,22 @@
--- src/reader.c.orig Mon Jun 14 15:19:05 1999
+++ src/reader.c Mon Jan 17 03:38:56 2000
@@ -44,6 +44,7 @@
int rline_allocated;
extern char *program_name;
+extern int broken_undeftoken_init;
extern int definesflag;
extern int nolinesflag;
extern int noparserflag;
@@ -199,7 +200,10 @@
/* it is always token number 2. */
undeftoken = getsym("$undefined.");
undeftoken->class = STOKEN;
- undeftoken->user_token_number = 2;
+ /* XXX ``broken_undeftoken_init'' makes Bison 1.28 bug-compatable
+ with Bison 1.25. FreeBSD depends on this behavior when compiling
+ EGCS-1.1.2's cc1plus. */
+ undeftoken->user_token_number = broken_undeftoken_init ? 0 : 2;
/* Read the declaration section. Copy %{ ... %} groups to ftable and fdefines file.
Also notice any %token, %left, etc. found there. */
if (noparserflag)

View File

@ -0,0 +1,18 @@
--- src/getargs.c.orig Mon Jun 14 15:19:05 1999
+++ src/getargs.c Mon Jan 17 03:38:56 2000
@@ -31,6 +31,7 @@
int noparserflag = 0;
int toknumflag = 0;
int rawtoknumflag = 0;
+int broken_undeftoken_init;
char *spec_name_prefix; /* for -p. */
char *spec_file_prefix; /* for -b. */
extern int fixed_outfiles;/* for -y */
@@ -44,6 +45,7 @@
struct option longopts[] =
{
+ {"broken-undeftoken-init", 0, &broken_undeftoken_init, 1},
{"debug", 0, &debugflag, 1},
{"defines", 0, &definesflag, 1},
{"file-prefix", 1, 0, 'b'},

View File

@ -0,0 +1,22 @@
--- src/reader.c.orig Mon Jun 14 15:19:05 1999
+++ src/reader.c Mon Jan 17 03:38:56 2000
@@ -44,6 +44,7 @@
int rline_allocated;
extern char *program_name;
+extern int broken_undeftoken_init;
extern int definesflag;
extern int nolinesflag;
extern int noparserflag;
@@ -199,7 +200,10 @@
/* it is always token number 2. */
undeftoken = getsym("$undefined.");
undeftoken->class = STOKEN;
- undeftoken->user_token_number = 2;
+ /* XXX ``broken_undeftoken_init'' makes Bison 1.28 bug-compatable
+ with Bison 1.25. FreeBSD depends on this behavior when compiling
+ EGCS-1.1.2's cc1plus. */
+ undeftoken->user_token_number = broken_undeftoken_init ? 0 : 2;
/* Read the declaration section. Copy %{ ... %} groups to ftable and fdefines file.
Also notice any %token, %left, etc. found there. */
if (noparserflag)

View File

@ -0,0 +1,18 @@
--- src/getargs.c.orig Mon Jun 14 15:19:05 1999
+++ src/getargs.c Mon Jan 17 03:38:56 2000
@@ -31,6 +31,7 @@
int noparserflag = 0;
int toknumflag = 0;
int rawtoknumflag = 0;
+int broken_undeftoken_init;
char *spec_name_prefix; /* for -p. */
char *spec_file_prefix; /* for -b. */
extern int fixed_outfiles;/* for -y */
@@ -44,6 +45,7 @@
struct option longopts[] =
{
+ {"broken-undeftoken-init", 0, &broken_undeftoken_init, 1},
{"debug", 0, &debugflag, 1},
{"defines", 0, &definesflag, 1},
{"file-prefix", 1, 0, 'b'},

View File

@ -0,0 +1,22 @@
--- src/reader.c.orig Mon Jun 14 15:19:05 1999
+++ src/reader.c Mon Jan 17 03:38:56 2000
@@ -44,6 +44,7 @@
int rline_allocated;
extern char *program_name;
+extern int broken_undeftoken_init;
extern int definesflag;
extern int nolinesflag;
extern int noparserflag;
@@ -199,7 +200,10 @@
/* it is always token number 2. */
undeftoken = getsym("$undefined.");
undeftoken->class = STOKEN;
- undeftoken->user_token_number = 2;
+ /* XXX ``broken_undeftoken_init'' makes Bison 1.28 bug-compatable
+ with Bison 1.25. FreeBSD depends on this behavior when compiling
+ EGCS-1.1.2's cc1plus. */
+ undeftoken->user_token_number = broken_undeftoken_init ? 0 : 2;
/* Read the declaration section. Copy %{ ... %} groups to ftable and fdefines file.
Also notice any %token, %left, etc. found there. */
if (noparserflag)

View File

@ -0,0 +1,18 @@
--- src/getargs.c.orig Mon Jun 14 15:19:05 1999
+++ src/getargs.c Mon Jan 17 03:38:56 2000
@@ -31,6 +31,7 @@
int noparserflag = 0;
int toknumflag = 0;
int rawtoknumflag = 0;
+int broken_undeftoken_init;
char *spec_name_prefix; /* for -p. */
char *spec_file_prefix; /* for -b. */
extern int fixed_outfiles;/* for -y */
@@ -44,6 +45,7 @@
struct option longopts[] =
{
+ {"broken-undeftoken-init", 0, &broken_undeftoken_init, 1},
{"debug", 0, &debugflag, 1},
{"defines", 0, &definesflag, 1},
{"file-prefix", 1, 0, 'b'},

View File

@ -0,0 +1,22 @@
--- src/reader.c.orig Mon Jun 14 15:19:05 1999
+++ src/reader.c Mon Jan 17 03:38:56 2000
@@ -44,6 +44,7 @@
int rline_allocated;
extern char *program_name;
+extern int broken_undeftoken_init;
extern int definesflag;
extern int nolinesflag;
extern int noparserflag;
@@ -199,7 +200,10 @@
/* it is always token number 2. */
undeftoken = getsym("$undefined.");
undeftoken->class = STOKEN;
- undeftoken->user_token_number = 2;
+ /* XXX ``broken_undeftoken_init'' makes Bison 1.28 bug-compatable
+ with Bison 1.25. FreeBSD depends on this behavior when compiling
+ EGCS-1.1.2's cc1plus. */
+ undeftoken->user_token_number = broken_undeftoken_init ? 0 : 2;
/* Read the declaration section. Copy %{ ... %} groups to ftable and fdefines file.
Also notice any %token, %left, etc. found there. */
if (noparserflag)

View File

@ -0,0 +1,18 @@
--- src/getargs.c.orig Mon Jun 14 15:19:05 1999
+++ src/getargs.c Mon Jan 17 03:38:56 2000
@@ -31,6 +31,7 @@
int noparserflag = 0;
int toknumflag = 0;
int rawtoknumflag = 0;
+int broken_undeftoken_init;
char *spec_name_prefix; /* for -p. */
char *spec_file_prefix; /* for -b. */
extern int fixed_outfiles;/* for -y */
@@ -44,6 +45,7 @@
struct option longopts[] =
{
+ {"broken-undeftoken-init", 0, &broken_undeftoken_init, 1},
{"debug", 0, &debugflag, 1},
{"defines", 0, &definesflag, 1},
{"file-prefix", 1, 0, 'b'},

View File

@ -0,0 +1,22 @@
--- src/reader.c.orig Mon Jun 14 15:19:05 1999
+++ src/reader.c Mon Jan 17 03:38:56 2000
@@ -44,6 +44,7 @@
int rline_allocated;
extern char *program_name;
+extern int broken_undeftoken_init;
extern int definesflag;
extern int nolinesflag;
extern int noparserflag;
@@ -199,7 +200,10 @@
/* it is always token number 2. */
undeftoken = getsym("$undefined.");
undeftoken->class = STOKEN;
- undeftoken->user_token_number = 2;
+ /* XXX ``broken_undeftoken_init'' makes Bison 1.28 bug-compatable
+ with Bison 1.25. FreeBSD depends on this behavior when compiling
+ EGCS-1.1.2's cc1plus. */
+ undeftoken->user_token_number = broken_undeftoken_init ? 0 : 2;
/* Read the declaration section. Copy %{ ... %} groups to ftable and fdefines file.
Also notice any %token, %left, etc. found there. */
if (noparserflag)