On 2014/10/24 09:59, Jason Tubnor wrote: > Bison updated to version 3.0.2 > > Patches for: > configure > src/output.c
The patch for src/output.c is to use base m4 at runtime. (Things are a bit convoluted with this port as it uses gnu m4 to build it, but base m4 at runtime). If you put that diff back in (adapted to the changed upstream code), and fix it to use -g instead of --gnu to set gnu mode, then you get this when you run tests: ./tests/bison -o y.tab.c -d -v -Werror -Wall -Wno-yacc --report=all -o examples/calc++/calc++-parser.cc examples/calc++/calc++-parser.yy m4: /usr/obj/ports/bison-3.0.2/bison-3.0.2/data/location.cc at line 332: regular expression error in ^(.)[ ]*(::)?([^][:]|:[^:])*: invalid character class. If someone wants to look at the pieces in src/usr.bin/m4 that would be needed to make this work, here's the (non-working) diff. The alternative would be to set it up to use gnu m4, though that needs doing properly with a run dependency. One way or another we need to do something with this, we have problems in ports with our versions of bison and flex being too old (newer flex depends on newer bison). Index: Makefile =================================================================== RCS file: /cvs/ports/devel/bison/Makefile,v retrieving revision 1.50 diff -u -p -r1.50 Makefile --- Makefile 9 Nov 2013 23:19:02 -0000 1.50 +++ Makefile 28 Oct 2014 12:50:43 -0000 @@ -2,8 +2,7 @@ COMMENT= GNU parser generator -DISTNAME= bison-2.3 -REVISION= 1 +DISTNAME= bison-3.0.2 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_GNU:=bison/} Index: distinfo =================================================================== RCS file: /cvs/ports/devel/bison/distinfo,v retrieving revision 1.8 diff -u -p -r1.8 distinfo --- distinfo 8 Jul 2008 00:24:17 -0000 1.8 +++ distinfo 28 Oct 2014 12:50:43 -0000 @@ -1,5 +1,2 @@ -MD5 (bison-2.3.tar.gz) = IjJ+/dUIDisay25WCgS0Og== -RMD160 (bison-2.3.tar.gz) = TTPc/Q1LnSEVYIt6Je14hdm9gyI= -SHA1 (bison-2.3.tar.gz) = TfhMLFlxlGER/xmC+4MLPHjXxX4= -SHA256 (bison-2.3.tar.gz) = UveKpHYadM63/fdw81VN2EMIw7k8QlXjpcF1WOzaKT4= -SIZE (bison-2.3.tar.gz) = 1386694 +SHA256 (bison-3.0.2.tar.gz) = zfKdGkwPfVsMGBvIgY/mgW07atT8yPbA5VQKIow/ge0= +SIZE (bison-3.0.2.tar.gz) = 3261770 Index: patches/patch-configure =================================================================== RCS file: patches/patch-configure diff -N patches/patch-configure --- patches/patch-configure 8 Jul 2008 00:24:17 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD: patch-configure,v 1.3 2008/07/08 00:24:17 brad Exp $ ---- configure.orig Mon Jun 5 03:32:01 2006 -+++ configure Sun Jun 29 22:09:16 2008 -@@ -16768,10 +16768,10 @@ s,@host_cpu@,$host_cpu,;t t - s,@host_vendor@,$host_vendor,;t t - s,@host_os@,$host_os,;t t - s,@INTL_MACOSX_LIBS@,$INTL_MACOSX_LIBS,;t t --s,@LIBICONV@,$LIBICONV,;t t -+s,@LIBICONV@,$LTLIBICONV,;t t - s,@LTLIBICONV@,$LTLIBICONV,;t t - s,@INTLLIBS@,$INTLLIBS,;t t --s,@LIBINTL@,$LIBINTL,;t t -+s,@LIBINTL@,$LTLIBINTL,;t t - s,@LTLIBINTL@,$LTLIBINTL,;t t - s,@POSUB@,$POSUB,;t t - s,@UNISTD_H@,$UNISTD_H,;t t Index: patches/patch-data_m4sugar_m4sugar_m4 =================================================================== RCS file: /cvs/ports/devel/bison/patches/patch-data_m4sugar_m4sugar_m4,v retrieving revision 1.2 diff -u -p -r1.2 patch-data_m4sugar_m4sugar_m4 --- patches/patch-data_m4sugar_m4sugar_m4 8 Jul 2008 00:24:17 -0000 1.2 +++ patches/patch-data_m4sugar_m4sugar_m4 28 Oct 2014 12:50:43 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-data_m4sugar_m4sugar_m4,v 1.2 2008/07/08 00:24:17 brad Exp $ ---- data/m4sugar/m4sugar.m4.orig Mon Nov 14 03:13:07 2005 -+++ data/m4sugar/m4sugar.m4 Sun Jun 29 22:09:16 2008 -@@ -55,13 +55,6 @@ divert(-1)# +--- data/m4sugar/m4sugar.m4.orig Fri Aug 2 09:03:17 2013 ++++ data/m4sugar/m4sugar.m4 Tue Oct 28 06:08:11 2014 +@@ -31,13 +31,6 @@ divert(-1)# changequote() changequote([, ]) Index: patches/patch-src_output_c =================================================================== RCS file: /cvs/ports/devel/bison/patches/patch-src_output_c,v retrieving revision 1.5 diff -u -p -r1.5 patch-src_output_c --- patches/patch-src_output_c 14 Apr 2012 12:22:25 -0000 1.5 +++ patches/patch-src_output_c 28 Oct 2014 12:50:43 -0000 @@ -1,50 +1,22 @@ -$OpenBSD: patch-src_output_c,v 1.5 2012/04/14 12:22:25 espie Exp $ ---- src/output.c.orig Sun May 14 22:40:35 2006 -+++ src/output.c Fri Apr 13 20:38:39 2012 -@@ -501,7 +501,8 @@ output_skeleton (void) - FILE *in; - FILE *out; - int filter_fd[2]; -- char const *argv[6]; -+ char const *argv[7]; -+ int i; +$OpenBSD$ +--- src/output.c.orig Wed Dec 4 07:53:01 2013 ++++ src/output.c Tue Oct 28 06:14:16 2014 +@@ -547,7 +547,7 @@ output_skeleton (void) pid_t pid; - /* Compute the names of the package data dir and skeleton file. -@@ -512,7 +513,7 @@ output_skeleton (void) - char *full_m4sugar; - char *full_skeleton; - char const *p; -- char const *m4 = (p = getenv ("M4")) ? p : M4; -+ char const *m4 = (p = getenv ("M4")) ? p : "/usr/bin/m4"; - char const *pkgdatadir = (p = getenv ("BISON_PKGDATADIR")) ? p : PKGDATADIR; - size_t skeleton_size = strlen (skeleton) + 1; - size_t pkgdatadirlen = strlen (pkgdatadir); -@@ -534,12 +535,21 @@ output_skeleton (void) - fprintf (stderr, "running: %s %s - %s\n", - m4, full_m4sugar, full_skeleton); + /* Compute the names of the package data dir and skeleton files. */ +- char const *m4 = (m4 = getenv ("M4")) ? m4 : M4; ++ char const *m4 = (m4 = getenv ("M4")) ? m4 : "/usr/bin/m4"; + char const *datadir = pkgdatadir (); + char *m4sugar = xconcatenated_filename (datadir, "m4sugar/m4sugar.m4", NULL); + char *m4bison = xconcatenated_filename (datadir, "bison.m4", NULL); +@@ -587,8 +587,7 @@ output_skeleton (void) + See the thread starting at + <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html> + for details. */ +- if (*M4_GNU_OPTION) +- argv[i++] = M4_GNU_OPTION; ++ argv[i++] = "-g"; -- argv[0] = m4; -- argv[1] = full_m4sugar; -- argv[2] = "-"; -- argv[3] = full_skeleton; -- argv[4] = trace_flag & trace_m4 ? "-dV" : NULL; -- argv[5] = NULL; -+ i = 0; -+ argv[i++] = m4; -+ p = strrchr(m4, '/'); -+ if (p) -+ p++; -+ else -+ p = m4; -+ if (strcmp(p, "m4") == 0) { -+ argv[i++] = "-g"; -+ } -+ argv[i++] = full_m4sugar; -+ argv[i++] = "-"; -+ argv[i++] = full_skeleton; -+ argv[i++] = trace_flag & trace_m4 ? "-dV" : NULL; -+ argv[i++] = NULL; - - init_subpipe (); - pid = create_subpipe (argv, filter_fd); + argv[i++] = "-I"; + argv[i++] = datadir;