diff options
author | wen <wen@FreeBSD.org> | 2016-03-04 14:46:27 +0800 |
---|---|---|
committer | wen <wen@FreeBSD.org> | 2016-03-04 14:46:27 +0800 |
commit | 9f81556ab14155e96b1c874c9eb6a998e3bb1281 (patch) | |
tree | 4ce521c704b8e310c187ebba0f831881637b97f9 /lang/p2c | |
parent | d96a82c745afa8f31078e165b551a4094dad99c2 (diff) | |
download | freebsd-ports-gnome-9f81556ab14155e96b1c874c9eb6a998e3bb1281.tar.gz freebsd-ports-gnome-9f81556ab14155e96b1c874c9eb6a998e3bb1281.tar.zst freebsd-ports-gnome-9f81556ab14155e96b1c874c9eb6a998e3bb1281.zip |
- Update to 2.01
PR: 205212
Submitted by: tkato432@yahoo.com
Diffstat (limited to 'lang/p2c')
-rw-r--r-- | lang/p2c/Makefile | 20 | ||||
-rw-r--r-- | lang/p2c/distinfo | 4 | ||||
-rw-r--r-- | lang/p2c/files/patch-Makefile | 8 | ||||
-rw-r--r-- | lang/p2c/files/patch-comment.c | 11 | ||||
-rw-r--r-- | lang/p2c/files/patch-lex.c | 74 | ||||
-rw-r--r-- | lang/p2c/files/patch-loc.p2clib.c | 2 | ||||
-rw-r--r-- | lang/p2c/files/patch-makeproto.c | 4 | ||||
-rw-r--r-- | lang/p2c/files/patch-out.c | 11 | ||||
-rw-r--r-- | lang/p2c/files/patch-p2clib.c | 8 | ||||
-rw-r--r-- | lang/p2c/files/patch-parse.c | 31 | ||||
-rw-r--r-- | lang/p2c/files/patch-trans.c | 65 | ||||
-rw-r--r-- | lang/p2c/files/patch-trans.h | 13 | ||||
-rw-r--r-- | lang/p2c/pkg-descr | 40 | ||||
-rw-r--r-- | lang/p2c/pkg-plist | 7 |
14 files changed, 57 insertions, 241 deletions
diff --git a/lang/p2c/Makefile b/lang/p2c/Makefile index 8737efb36ec2..231565789a95 100644 --- a/lang/p2c/Makefile +++ b/lang/p2c/Makefile @@ -2,27 +2,29 @@ # $FreeBSD$ PORTNAME= p2c -PORTVERSION= 1.21a -PORTREVISION= 3 +PORTVERSION= 2.01 CATEGORIES= lang -MASTER_SITES= http://darkstar.ist.utl.pt/slackware/slackware_source/d/p2c/ \ - http://www.slackware.at/data/slackware-10.0/source/d/p2c/ -DISTFILES= p2c-1.21alpha2.tar.gz +MASTER_SITES= https://schneider.ncifcrf.gov/p2c/ MAINTAINER= ports@FreeBSD.org COMMENT= Pascal to C translator -BROKEN= unfetchable - LICENSE= GPLv2 -WRKSRC= ${WRKDIR}/p2c-1.21alpha-07.Dec.93/src +WRKSRC_SUBDIR= src USES= perl5 shebangfix SHEBANG_FILES= p2cc.perl perl_OLD_CMD= /bin/perl +USE_PERL5= run ALL_TARGET= all p2cc +pre-build: + @${RM} -f ${WRKSRC}/p2c.man.inst + +post-build: + @${LN} -sf p2c.man.inst ${WRKSRC}/p2c.1 + do-install: (cd ${WRKSRC} && ${INSTALL_PROGRAM} p2c \ ${STAGEDIR}${PREFIX}/bin) @@ -40,5 +42,7 @@ do-install: (cd ${WRKSRC} && ${INSTALL_DATA} ${i} \ ${STAGEDIR}${PREFIX}/lib/p2c) .endfor + (cd ${WRKSRC} && ${INSTALL_MAN} p2c.1 \ + ${STAGEDIR}${MANPREFIX}/man/man1) .include <bsd.port.mk> diff --git a/lang/p2c/distinfo b/lang/p2c/distinfo index 3ed0ae225cf8..712bdc84560c 100644 --- a/lang/p2c/distinfo +++ b/lang/p2c/distinfo @@ -1,2 +1,2 @@ -SHA256 (p2c-1.21alpha2.tar.gz) = 5e7874a46d6ac58b1d3ecc0409b5458733cbca8abb12e33d68b23a72910d5c29 -SIZE (p2c-1.21alpha2.tar.gz) = 423399 +SHA256 (p2c-2.01.tar.gz) = a05635e6b0b40bee9617771ba628deefae13369cd7d49bb880cc8590495fcf60 +SIZE (p2c-2.01.tar.gz) = 586605 diff --git a/lang/p2c/files/patch-Makefile b/lang/p2c/files/patch-Makefile index 58508436230c..562622e162a5 100644 --- a/lang/p2c/files/patch-Makefile +++ b/lang/p2c/files/patch-Makefile @@ -1,4 +1,4 @@ ---- Makefile.orig +--- Makefile.orig 2015-11-18 20:12:06 UTC +++ Makefile @@ -19,29 +19,30 @@ SHELL = /bin/sh @@ -39,13 +39,13 @@ +CC ?= cc # you may wish to use gcc here instead OPT = # -O # uncomment this for optimization DEB = # -g # uncomment this for debugging - DEFS = # place other -D types of things here + DEFS = -DTEST_MALLOC # place other -D types of things here # TDS 2015nov18 -CFLAGS = $(OPT) $(DEB) $(DEFS) +CFLAGS += $(OPT) $(DEB) $(DEFS) LFLAGS = -@@ -64,9 +65,9 @@ +@@ -64,9 +65,9 @@ LIBSRCS = p2clib.c loc.p2clib.c LIBOBJS = p2clib.o loc.p2clib.o OTHERLIBOBJS = @@ -58,7 +58,7 @@ MISCSRCS = makeproto.c PROTOS = p2c.proto p2c.hdrs -@@ -128,7 +129,6 @@ +@@ -128,7 +129,6 @@ p2cc: p2cc.perl sed -e "s;--HOMEDIR--;$(ABSHOMEDIR);" \ -e "s;--INCDIR--;$(ABSINCDIR);" \ -e "s;--LIBDIR--;$(ABSLIBDIR);" \ diff --git a/lang/p2c/files/patch-comment.c b/lang/p2c/files/patch-comment.c deleted file mode 100644 index 07950f78c31b..000000000000 --- a/lang/p2c/files/patch-comment.c +++ /dev/null @@ -1,11 +0,0 @@ ---- comment.c.orig -+++ comment.c -@@ -299,7 +299,7 @@ - printf("\"%s\", line %d,%d: %s\n", infname, inf_lnum, outf_lnum, msg); - } - if (verbose) -- fprintf(logf, "%s:%d:%d: %s\n", infname, inf_lnum, outf_lnum, msg); -+ fprintf(p2c_logf, "%s:%d:%d: %s\n", infname, inf_lnum, outf_lnum, msg); - if (notephase == 2 || regression) - prefix = format_s("\004 p2c: %s:", infname); - else diff --git a/lang/p2c/files/patch-lex.c b/lang/p2c/files/patch-lex.c deleted file mode 100644 index c91ca92e2ea2..000000000000 --- a/lang/p2c/files/patch-lex.c +++ /dev/null @@ -1,74 +0,0 @@ ---- lex.c.orig -+++ lex.c -@@ -520,7 +520,7 @@ - if (outf != stdout) - printf("Translation aborted: Too many errors.\n"); - if (verbose) -- fprintf(logf, "Translation aborted: Too many errors.\n"); -+ fprintf(p2c_logf, "Translation aborted: Too many errors.\n"); - closelogfile(); - exit_failure(); - } -@@ -541,9 +541,9 @@ - printf("Translation aborted.\n"); - } - if (verbose) { -- fprintf(logf, "%s:%d:%d: %s\n", -+ fprintf(p2c_logf, "%s:%d:%d: %s\n", - infname, inf_lnum, outf_lnum, msg); -- fprintf(logf, "Translation aborted.\n"); -+ fprintf(p2c_logf, "Translation aborted.\n"); - } - closelogfile(); - exit_failure(); -@@ -562,7 +562,7 @@ - { - if (checkeatnote(msg)) { - if (verbose) -- fprintf(logf, "%s:%d:%d: Omitted warning: %s\n", -+ fprintf(p2c_logf, "%s:%d:%d: Omitted warning: %s\n", - infname, inf_lnum, outf_lnum, msg); - return; - } -@@ -577,7 +577,7 @@ - { - if (checkeatnote(msg)) { - if (verbose) -- fprintf(logf, "%s:%d:%d: Omitted internal error in %s: %s\n", -+ fprintf(p2c_logf, "%s:%d:%d: Omitted internal error in %s: %s\n", - infname, inf_lnum, outf_lnum, proc, msg); - return; - } -@@ -596,7 +596,7 @@ - { - if (blockkind == TOK_IMPORT || checkeatnote(msg)) { - if (verbose) -- fprintf(logf, "%s:%d:%d: Omitted note: %s\n", -+ fprintf(p2c_logf, "%s:%d:%d: Omitted note: %s\n", - infname, inf_lnum, outf_lnum, msg); - return; - } -@@ -612,12 +612,12 @@ - { - if (blockkind == TOK_IMPORT || checkeatnote(msg)) { - if (verbose) -- fprintf(logf, "%s:%d:%d: Omitted end-note: %s\n", -+ fprintf(p2c_logf, "%s:%d:%d: Omitted end-note: %s\n", - infname, inf_lnum, outf_lnum, msg); - return; - } - if (verbose) -- fprintf(logf, "%s:%d:%d: Recorded end-note: %s\n", -+ fprintf(p2c_logf, "%s:%d:%d: Recorded end-note: %s\n", - infname, inf_lnum, outf_lnum, msg); - (void) strlist_add(&endnotelist, msg); - } -@@ -1327,7 +1327,7 @@ - else - printf("Reading include file \"%s\"\n", fn); - if (verbose) -- fprintf(logf, "Reading include file \"%s\"\n", fn); -+ fprintf(p2c_logf, "Reading include file \"%s\"\n", fn); - if (expandincludes == 0) { - push_input_file(fp, fn, 2); - curtok = TOK_INCLUDE; diff --git a/lang/p2c/files/patch-loc.p2clib.c b/lang/p2c/files/patch-loc.p2clib.c index 09825f1ae0bd..459f39be668c 100644 --- a/lang/p2c/files/patch-loc.p2clib.c +++ b/lang/p2c/files/patch-loc.p2clib.c @@ -1,4 +1,4 @@ ---- loc.p2clib.c.orig +--- loc.p2clib.c.orig 1993-12-08 05:36:53 UTC +++ loc.p2clib.c @@ -4,3 +4,42 @@ * the symbol LOCAL_INIT when you compile p2clib.c. diff --git a/lang/p2c/files/patch-makeproto.c b/lang/p2c/files/patch-makeproto.c index 906bfcdff7a5..83553724a374 100644 --- a/lang/p2c/files/patch-makeproto.c +++ b/lang/p2c/files/patch-makeproto.c @@ -1,4 +1,4 @@ ---- makeproto.c.orig +--- makeproto.c.orig 1993-12-08 05:36:53 UTC +++ makeproto.c @@ -7,6 +7,7 @@ @@ -8,7 +8,7 @@ #include <ctype.h> #include <time.h> -@@ -157,7 +158,7 @@ +@@ -157,7 +158,7 @@ char **argv; char argdecls[MAXARGS][256], argnames[MAXARGS][80]; char *cp, *cp2, *cp3; int i, j, pos, len, thistab, numstars, whichf, nargs, incomment, errors = 0; diff --git a/lang/p2c/files/patch-out.c b/lang/p2c/files/patch-out.c deleted file mode 100644 index ebf722599e29..000000000000 --- a/lang/p2c/files/patch-out.c +++ /dev/null @@ -1,11 +0,0 @@ ---- out.c.orig -+++ out.c -@@ -1194,7 +1194,7 @@ - " seconds, %ld tries on line %d [251]", alts, outf_lnum); - note(outbuf); - } else if (verbose) { -- fprintf(logf, "%s, %d/%d: Line breaker spent %ld tries\n", -+ fprintf(p2c_logf, "%s, %d/%d: Line breaker spent %ld tries\n", - infname, inf_lnum, outf_lnum, alts); - } - if (testinglinebreaker) diff --git a/lang/p2c/files/patch-p2clib.c b/lang/p2c/files/patch-p2clib.c index 1079ca980d29..6dc610d40bd3 100644 --- a/lang/p2c/files/patch-p2clib.c +++ b/lang/p2c/files/patch-p2clib.c @@ -1,6 +1,6 @@ ---- p2clib.c.orig +--- p2clib.c.orig 1993-12-08 05:36:53 UTC +++ p2clib.c -@@ -890,7 +890,7 @@ +@@ -890,7 +890,7 @@ int *Day, *Month, *Year, *Hour, *Min, *S { #ifndef NO_TIME struct tm *tm; @@ -9,7 +9,7 @@ time(&clock); tm = localtime(&clock); -@@ -908,7 +908,7 @@ +@@ -908,7 +908,7 @@ int *Day, *Month, *Year, *Hour, *Min, *S Void VAXdate(s) char *s; { @@ -18,7 +18,7 @@ char *c; int i; static int where[] = {8, 9, 0, 4, 5, 6, 0, 20, 21, 22, 23}; -@@ -924,7 +924,7 @@ +@@ -924,7 +924,7 @@ char *s; Void VAXtime(s) char *s; { diff --git a/lang/p2c/files/patch-parse.c b/lang/p2c/files/patch-parse.c deleted file mode 100644 index a4a88dee81e5..000000000000 --- a/lang/p2c/files/patch-parse.c +++ /dev/null @@ -1,31 +0,0 @@ ---- parse.c.orig -+++ parse.c -@@ -4392,7 +4392,7 @@ - long saveserial; - - if (verbose) -- fprintf(logf, "%s, %d/%d: Translating %s (in %s)\n", -+ fprintf(p2c_logf, "%s, %d/%d: Translating %s (in %s)\n", - infname, inf_lnum, outf_lnum, - curctx->name, curctx->ctx->name); - notephase = 1; -@@ -5477,8 +5477,8 @@ - if (!fp) { - if (need) - perror(infnbuf); -- if (logf) -- fprintf(logf, "(Unable to open search file \"%s\")\n", infnbuf); -+ if (p2c_logf) -+ fprintf(p2c_logf, "(Unable to open search file \"%s\")\n", infnbuf); - return 0; - } - flushcomments(NULL, -1, -1); -@@ -5515,7 +5515,7 @@ - else - printf("Reading import text for \"%s\"\n", mod->name); - if (verbose) -- fprintf(logf, "%s, %d/%d: Reading import text for \"%s\"\n", -+ fprintf(p2c_logf, "%s, %d/%d: Reading import text for \"%s\"\n", - infname, inf_lnum, outf_lnum, mod->name); - pushctx(mod); - gettok(); diff --git a/lang/p2c/files/patch-trans.c b/lang/p2c/files/patch-trans.c index cf38d4f3e4b8..797361ba68bf 100644 --- a/lang/p2c/files/patch-trans.c +++ b/lang/p2c/files/patch-trans.c @@ -1,6 +1,6 @@ ---- trans.c.orig +--- trans.c.orig 2015-10-02 17:52:53 UTC +++ trans.c -@@ -23,6 +23,8 @@ +@@ -23,6 +23,8 @@ the Free Software Foundation, Inc., 675 #include "trans.h" #include <time.h> @@ -9,7 +9,7 @@ -@@ -575,7 +577,7 @@ +@@ -575,7 +577,7 @@ extern char *getenv PP((char *)); # endif #endif @@ -18,65 +18,12 @@ Static void openlogfile() { -@@ -588,17 +590,17 @@ - if (!name) - name = format_s("%s.log", codefname); - saveoldfile(name); -- logf = fopen(name, "w"); -- if (logf) { -- fprintf(logf, "\nTranslation of %s to %s by p2c %s\n", -+ p2c_logf = fopen(name, "w"); -+ if (p2c_logf) { -+ fprintf(p2c_logf, "\nTranslation of %s to %s by p2c %s\n", - infname, codefname, P2C_VERSION); -- fprintf(logf, "Translated"); -+ fprintf(p2c_logf, "Translated"); - uname = getenv("USER"); - if (uname) -- fprintf(logf, " by %s", uname); -+ fprintf(p2c_logf, " by %s", uname); - time(&starting_time); -- fprintf(logf, " on %s", ctime(&starting_time)); -- fprintf(logf, "\n\n"); -+ fprintf(p2c_logf, " on %s", ctime(&starting_time)); -+ fprintf(p2c_logf, "\n\n"); - } else { - perror(name); - verbose = 0; -@@ -608,20 +610,20 @@ +@@ -608,7 +610,7 @@ Static void openlogfile() void closelogfile() { - long ending_time; + time_t ending_time; -- if (logf) { -- fprintf(logf, "\n\n"); -+ if (p2c_logf) { -+ fprintf(p2c_logf, "\n\n"); - #if defined(unix) || defined(__unix) -- fprintf(logf, "Total memory used: %ld bytes.\n", (long)sbrk(0)); -+ fprintf(p2c_logf, "Total memory used: %ld bytes.\n", (long)sbrk(0)); - #endif - time(&ending_time); -- fprintf(logf, "Processed %d source lines in %ld:%ld seconds.\n", -+ fprintf(p2c_logf, "Processed %d source lines in %ld:%ld seconds.\n", - inf_ltotal, - (ending_time - starting_time) / 60, - (ending_time - starting_time) % 60); -- fprintf(logf, "\n\nTranslation completed on %s", ctime(&ending_time)); -- fclose(logf); -+ fprintf(p2c_logf, "\n\nTranslation completed on %s", ctime(&ending_time)); -+ fclose(p2c_logf); - } - } - -@@ -949,7 +951,7 @@ - setbuf(codef, NULL); /* for debugging */ - outf = codef; - outf_lnum = 1; -- logf = NULL; -+ p2c_logf = NULL; - if (verbose) - openlogfile(); - setup_complete = 0; + if (logfile) { + fprintf(logfile, "\n\n"); diff --git a/lang/p2c/files/patch-trans.h b/lang/p2c/files/patch-trans.h index 9865d08f3392..f5dab9734783 100644 --- a/lang/p2c/files/patch-trans.h +++ b/lang/p2c/files/patch-trans.h @@ -1,15 +1,6 @@ ---- trans.h.orig +--- trans.h.orig 2015-10-05 23:04:46 UTC +++ trans.h -@@ -1773,7 +1773,7 @@ - - extern char *infname, *outfname, *codefname, *hdrfname; - extern char *requested_module; --extern FILE *inf, *outf, *codef, *hdrf, *logf; -+extern FILE *inf, *outf, *codef, *hdrf, *p2c_logf; - extern short setup_complete, found_module; - extern short regression, verbose, conserve_mem; - extern int inf_lnum, inf_ltotal; -@@ -1861,8 +1861,10 @@ +@@ -1863,8 +1863,10 @@ extern Expr *new_array_size; /* Our library omits declarations for these functions! */ diff --git a/lang/p2c/pkg-descr b/lang/p2c/pkg-descr index c61c21fa3c5a..80eb1e0e0bca 100644 --- a/lang/p2c/pkg-descr +++ b/lang/p2c/pkg-descr @@ -1,21 +1,21 @@ -P2c is a tool for translating Pascal programs into C. The input -consists of a set of source files in any of the following Pascal -dialects: HP Pascal, Turbo/UCSD Pascal, DEC VAX Pascal, Oregon -Software Pascal/2, Macintosh Programmer's Workshop Pascal, -Sun/Berkeley Pascal, Texas Instruments Pascal, Apollo Domain Pascal. -Modula-2 syntax is also supported. Output is a set of .c and .h files -that comprise an equivalent program in any of several dialects of -C. Output code may be kept machine- and dialect independent, or it may -be targeted to a specific machine and compiler. Most reasonable Pascal -programs are converted into fully functional C which will compile and -run with no further modifications, although p2c sometimes chooses to -generate readable code at the expense of absolute generality. P2c -endeavors to insert notes and warning messages into the output code to -point out areas which may require human intervention. Output code is -arranged to be readable and efficient, and to make use of C idioms -wherever possible. The main goal of the translation is to produce C -files which are pleasant and "natural" enough to be acceptable as the -new source files for a program. In a pinch, p2c will also serve as an -ad hoc Pascal compiler. The p2cc script makes it easy to use p2c as a -compiler. +P2c is a tool for translating Pascal programs into C. The input consists +of a set of source files in any of the following Pascal dialects: HP +Pascal, Turbo/UCSD Pascal, DEC VAX Pascal, Oregon Software Pascal/2, +Macintosh Programmer's Workshop Pascal, Sun/Berkeley Pascal, Texas +Instruments Pascal, Apollo Domain Pascal. Modula-2 syntax is also +supported. Output is a set of .c and .h files that comprise an +equivalent program in any of several dialects of C. Output code may be +kept machine- and dialect independent, or it may be targeted to a +specific machine and compiler. Most reasonable Pascal programs are +converted into fully functional C which will compile and run with no +further modifications, although p2c sometimes chooses to generate +readable code at the expense of absolute generality. P2c endeavors to +insert notes and warning messages into the output code to point out +areas which may require human intervention. Output code is arranged to +be readable and efficient, and to make use of C idioms wherever +possible. The main goal of the translation is to produce C files which +are pleasant and "natural" enough to be acceptable as the new source +files for a program. In a pinch, p2c will also serve as an ad hoc Pascal +compiler. The p2cc script makes it easy to use p2c as a compiler. +WWW: https://schneider.ncifcrf.gov/p2c/ diff --git a/lang/p2c/pkg-plist b/lang/p2c/pkg-plist index 496ea23eebdf..39bbd4b1ed96 100644 --- a/lang/p2c/pkg-plist +++ b/lang/p2c/pkg-plist @@ -1,10 +1,11 @@ bin/p2c bin/p2cc -lib/libp2c.a include/p2c/p2c.h -lib/p2c/p2crc +lib/libp2c.a lib/p2c/loc.p2crc +lib/p2c/p2crc +lib/p2c/string.pas lib/p2c/system.imp lib/p2c/system.m2 lib/p2c/turbo.imp -lib/p2c/string.pas +man/man1/p2c.1.gz |