From e78baaa1739cb7f3ccfb716226e061dc1f9b0c19 Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Fri, 14 Nov 2003 08:06:58 +0000 Subject: Small bug fix. This is of strong relevance to the Axiom port which I hope to commit in a week or three. --- devel/noweb/Makefile | 3 + devel/noweb/files/patch-Makefile | 55 ++++++++++++++++++ devel/noweb/files/patch-a | 55 ------------------ devel/noweb/files/patch-c_modules.c | 109 +++++++++++++++++++++++++++++++++++ devel/noweb/files/patch-c_modules.nw | 21 +++++++ 5 files changed, 188 insertions(+), 55 deletions(-) create mode 100644 devel/noweb/files/patch-Makefile delete mode 100644 devel/noweb/files/patch-a create mode 100644 devel/noweb/files/patch-c_modules.c create mode 100644 devel/noweb/files/patch-c_modules.nw (limited to 'devel/noweb') diff --git a/devel/noweb/Makefile b/devel/noweb/Makefile index 49da1f33bf9c..b6c0fcf6e708 100644 --- a/devel/noweb/Makefile +++ b/devel/noweb/Makefile @@ -27,6 +27,9 @@ MLINKS= notangle.1 noweave.1 notangle.1 nountangle.1 NOWEBTEXDIR= ${PREFIX}/share/texmf-local/tex/plain/noweb NOWEBLATEXDIR= ${PREFIX}/share/texmf-local/tex/latex/noweb +post-patch: + @${TOUCH} ${WRKSRC}/c/modules.[ch] + post-build: @(cd ${WRKSRC} && ${SH} ${WRKSRC}/awkname awk) diff --git a/devel/noweb/files/patch-Makefile b/devel/noweb/files/patch-Makefile new file mode 100644 index 000000000000..85f093cd3e6e --- /dev/null +++ b/devel/noweb/files/patch-Makefile @@ -0,0 +1,55 @@ +--- Makefile.orig Wed Mar 28 15:40:00 2001 ++++ Makefile Wed Apr 3 16:31:21 2002 +@@ -2,13 +2,14 @@ + # See file COPYRIGHT for more information. + # + # Adjust these two lines for your ANSI C compiler +-CC=gcc -ansi -pedantic +-CFLAGS= ++#CC=gcc -ansi -pedantic ++#CFLAGS= + # If you have Icon, you should use the Icon versions of the noweb pipeline. + # Set LIBSRC=icon +-LIBSRC=awk ++LIBSRC=icon ++#LIBSRC=awk + # If you have no Icon compiler, but do have icont, make ICONC=icont +-ICONC=iconc ++ICONC=icont + ICONT=icont + + # BIN is where the commands (notangle, noweave, nountangle, noroots) land +@@ -18,13 +19,13 @@ + # MAN7EXT is the extension for the nowebstyle man page (usually 7) + # TEXINPUTS is the directory for TeX macro files + # ELISP is the directory for emacs lisp files, or /dev/null not to install +-BIN=/usr/local/noweb +-LIB=/usr/local/noweb/lib +-MAN=/usr/local/noweb/man ++BIN=${PREFIX}/bin ++LIB=${PREFIX}/share/noweb ++MAN=${PREFIX}/man + MANEXT=1 + MAN7EXT=7 +-TEXINPUTS=/usr/local/tex/inputs +-ELISP=/dev/null ++TEXINPUTS=${LIB}/tex ++ELISP=${PREFIX}/share/emacs/site-lisp + + # change WEAVE if you want a different version of noweave to be installed + WEAVE=noweave +@@ -143,12 +144,12 @@ + rm -f $(CATDIR)/nountangle.$(MANEXT).gz + (cd $(CATDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz) + install-tex: +- -mkdir $(TEXINPUTS) 2>/dev/null ++ -mkdir -p $(TEXINPUTS) 2>/dev/null + cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS) + -texhash || echo "Program texhash not found or failed" + + install-elisp: +- -mkdir $(ELISP) 2>/dev/null ++ -mkdir -p $(ELISP) 2>/dev/null + cp elisp/noweb-mode.el $(ELISP) + + checkin: diff --git a/devel/noweb/files/patch-a b/devel/noweb/files/patch-a deleted file mode 100644 index 85f093cd3e6e..000000000000 --- a/devel/noweb/files/patch-a +++ /dev/null @@ -1,55 +0,0 @@ ---- Makefile.orig Wed Mar 28 15:40:00 2001 -+++ Makefile Wed Apr 3 16:31:21 2002 -@@ -2,13 +2,14 @@ - # See file COPYRIGHT for more information. - # - # Adjust these two lines for your ANSI C compiler --CC=gcc -ansi -pedantic --CFLAGS= -+#CC=gcc -ansi -pedantic -+#CFLAGS= - # If you have Icon, you should use the Icon versions of the noweb pipeline. - # Set LIBSRC=icon --LIBSRC=awk -+LIBSRC=icon -+#LIBSRC=awk - # If you have no Icon compiler, but do have icont, make ICONC=icont --ICONC=iconc -+ICONC=icont - ICONT=icont - - # BIN is where the commands (notangle, noweave, nountangle, noroots) land -@@ -18,13 +19,13 @@ - # MAN7EXT is the extension for the nowebstyle man page (usually 7) - # TEXINPUTS is the directory for TeX macro files - # ELISP is the directory for emacs lisp files, or /dev/null not to install --BIN=/usr/local/noweb --LIB=/usr/local/noweb/lib --MAN=/usr/local/noweb/man -+BIN=${PREFIX}/bin -+LIB=${PREFIX}/share/noweb -+MAN=${PREFIX}/man - MANEXT=1 - MAN7EXT=7 --TEXINPUTS=/usr/local/tex/inputs --ELISP=/dev/null -+TEXINPUTS=${LIB}/tex -+ELISP=${PREFIX}/share/emacs/site-lisp - - # change WEAVE if you want a different version of noweave to be installed - WEAVE=noweave -@@ -143,12 +144,12 @@ - rm -f $(CATDIR)/nountangle.$(MANEXT).gz - (cd $(CATDIR); ln notangle.$(MANEXT).gz nountangle.$(MANEXT).gz) - install-tex: -- -mkdir $(TEXINPUTS) 2>/dev/null -+ -mkdir -p $(TEXINPUTS) 2>/dev/null - cp tex/nwmac.tex tex/noweb.sty $(TEXINPUTS) - -texhash || echo "Program texhash not found or failed" - - install-elisp: -- -mkdir $(ELISP) 2>/dev/null -+ -mkdir -p $(ELISP) 2>/dev/null - cp elisp/noweb-mode.el $(ELISP) - - checkin: diff --git a/devel/noweb/files/patch-c_modules.c b/devel/noweb/files/patch-c_modules.c new file mode 100644 index 000000000000..0162d0e5d936 --- /dev/null +++ b/devel/noweb/files/patch-c_modules.c @@ -0,0 +1,109 @@ +--- c/modules.c.orig Wed Mar 28 14:49:00 2001 ++++ c/modules.c Thu Nov 13 20:15:53 2003 +@@ -17,7 +17,7 @@ + + static + void append(Module mp, struct modpart *p); +-#line 227 "modules.nw" ++#line 233 "modules.nw" + static int seekcycle(Module mp, Parent parent); + #line 132 "modules.nw" + static char *lastfilename = 0; +@@ -81,12 +81,12 @@ + struct parent thismodule; /* the value only matters when we're expanding a module */ + + +-#line 219 "modules.nw" ++#line 225 "modules.nw" + thismodule.this = mp; + thismodule.parent = parent; + #line 153 "modules.nw" + +-#line 222 "modules.nw" ++#line 228 "modules.nw" + if (seekcycle(mp, parent)) { + errormsg(Error, "<<%s>>", mp->name); + return Error; +@@ -111,11 +111,12 @@ + #line 157 "modules.nw" + ; break; + case MODULE: +-#line 201 "modules.nw" ++#line 206 "modules.nw" + newmod = lookup(p->contents); + if (newmod==NULL) { +- errormsg (Error, "undefined chunk name: <<%s>>", p->contents); ++ errormsg (Error, "ignoring undefined chunk name: <<%s>>", p->contents); + error=Error; ++ printf("<<%s>>",p->contents); + } else { + int retcode; + if (*locformat == 0 && partial_distance == 0) { +@@ -142,7 +143,7 @@ + } + return error; + } +-#line 229 "modules.nw" ++#line 235 "modules.nw" + static int seekcycle(Module mp, Parent parent) { + if (parent == NULL) { + return 0; +@@ -155,14 +156,14 @@ + return 0; + } + } +-#line 251 "modules.nw" ++#line 257 "modules.nw" + int printloc(FILE *fp, char *fmt, Location loc, int partial) { + char *p; + if (*fmt + && (loc.filename!=lastfilename || lastlineno != loc.lineno)) { + if (partial) putc('\n',fp); + +-#line 263 "modules.nw" ++#line 269 "modules.nw" + for (p = fmt; *p; p++) { + if (*p == '%') { + switch (*++p) { +@@ -177,35 +178,35 @@ + p += 2; + } else + +-#line 283 "modules.nw" ++#line 289 "modules.nw" + { static int complained = 0; + if (!complained) { + errormsg(Error,"Bad format sequence ``%%%c'' in -L%s",*p,fmt); + complained = 1; + } + } +-#line 277 "modules.nw" ++#line 283 "modules.nw" + break; + default: +-#line 283 "modules.nw" ++#line 289 "modules.nw" + { static int complained = 0; + if (!complained) { + errormsg(Error,"Bad format sequence ``%%%c'' in -L%s",*p,fmt); + complained = 1; + } + } +-#line 278 "modules.nw" ++#line 284 "modules.nw" + break; + } + } else putc(*p, fp); + } +-#line 257 "modules.nw" ++#line 263 "modules.nw" + lastfilename = loc.filename; + lastlineno = loc.lineno; + return 1; + } else return 0; + } +-#line 309 "modules.nw" ++#line 315 "modules.nw" + void remove_final_newline (Module mp) { + /* remove trailing newline that must be in module */ + if (mp->tail==NULL) /* module has no text */ diff --git a/devel/noweb/files/patch-c_modules.nw b/devel/noweb/files/patch-c_modules.nw new file mode 100644 index 000000000000..c46d2d83ca8a --- /dev/null +++ b/devel/noweb/files/patch-c_modules.nw @@ -0,0 +1,21 @@ +--- c/modules.nw.orig Wed Mar 28 14:44:00 2001 ++++ c/modules.nw Mon Nov 10 09:25:05 2003 +@@ -197,11 +197,17 @@ + out as a special case. + This change probably blows the case where the module being expanded is + empty. ++ ++If the lookup fails then the module (or chunk) is an undefined name. ++We complain about it but want to output the original source. ++We just wrap it in the bogus chunk name in the angle brackets ++that it must have had in the input and output it. (Tim Daly Nov 13, 2002) + <>= + newmod = lookup(p->contents); + if (newmod==NULL) { +- errormsg (Error, "undefined chunk name: @<<%s@>>", p->contents); ++ errormsg (Error, "ignoring undefined chunk name: @<<%s@>>", p->contents); + error=Error; ++ printf("@<<%s@>>",p->contents); + } else { + int retcode; + if (*locformat == 0 && partial_distance == 0) { -- cgit v1.2.3