quick&dirty fix to avoid unwanted runtime dependency on gnu-m4.

tests sturm@, naddy@
This commit is contained in:
espie 2005-11-21 09:15:11 +00:00
parent 371478f6c3
commit d99a626f45
3 changed files with 64 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.39 2005/10/30 18:07:35 naddy Exp $
# $OpenBSD: Makefile,v 1.40 2005/11/21 09:15:11 espie Exp $
COMMENT= "GNU parser generator"
DISTNAME= bison-2.1
PKGNAME= ${DISTNAME}p0
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNU:=bison/}

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-data_m4sugar_m4sugar_m4,v 1.1 2005/11/21 09:15:11 espie Exp $
--- data/m4sugar/m4sugar.m4.orig Sat Nov 19 16:05:49 2005
+++ data/m4sugar/m4sugar.m4 Sat Nov 19 16:06:24 2005
@@ -55,13 +55,6 @@ divert(-1)#
changequote()
changequote([, ])
-# Some old m4's don't support m4exit. But they provide
-# equivalent functionality by core dumping because of the
-# long macros we define.
-ifdef([__gnu__], ,
-[errprint(M4sugar requires GNU M4. Install it before installing M4sugar or
-set the M4 environment variable to its absolute file name.)
-m4exit(2)])
## ------------------------------- ##

View File

@ -0,0 +1,45 @@
$OpenBSD: patch-src_output_c,v 1.3 2005/11/21 09:15:11 espie Exp $
--- src/output.c.orig Sat Nov 19 16:01:00 2005
+++ src/output.c Sat Nov 19 16:04:17 2005
@@ -506,7 +506,8 @@ output_skeleton (void)
FILE *in;
FILE *out;
int filter_fd[2];
- char const *argv[6];
+ char const *argv[7];
+ int i;
pid_t pid;
/* Compute the names of the package data dir and skeleton file.
@@ -518,7 +519,7 @@ output_skeleton (void)
char *full_cm4;
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);
@@ -542,12 +543,16 @@ output_skeleton (void)
fprintf (stderr, "running: %s %s - %s %s\n",
m4, full_m4sugar, full_cm4, full_skeleton);
- argv[0] = m4;
- argv[1] = full_m4sugar;
- argv[2] = "-";
- argv[3] = full_cm4;
- argv[4] = full_skeleton;
- argv[5] = NULL;
+ i = 0;
+ argv[i++] = m4;
+ if (strcmp(m4, "/usr/bin/m4") == 0) {
+ argv[i++] = "-g";
+ }
+ argv[i++] = full_m4sugar;
+ argv[i++] = "-";
+ argv[i++] = full_cm4;
+ argv[i++] = full_skeleton;
+ argv[i++] = NULL;
init_subpipe ();
pid = create_subpipe (argv, filter_fd);