View | Details | Raw Unified | Return to bug 205212 | Differences between
and this patch

Collapse All | Expand All

(-)lang/p2c/Makefile (-8 / +7 lines)
Lines 2-28 Link Here
2
# $FreeBSD: head/lang/p2c/Makefile 401096 2015-11-09 12:59:03Z antoine $
2
# $FreeBSD: head/lang/p2c/Makefile 401096 2015-11-09 12:59:03Z antoine $
3
3
4
PORTNAME=	p2c
4
PORTNAME=	p2c
5
PORTVERSION=	1.21a
5
PORTVERSION=	2.01
6
PORTREVISION=	3
7
CATEGORIES=	lang
6
CATEGORIES=	lang
8
MASTER_SITES=	http://darkstar.ist.utl.pt/slackware/slackware_source/d/p2c/ \
7
MASTER_SITES=	https://schneider.ncifcrf.gov/p2c/
9
		http://www.slackware.at/data/slackware-10.0/source/d/p2c/
10
DISTFILES=	p2c-1.21alpha2.tar.gz
11
8
12
MAINTAINER=	ports@FreeBSD.org
9
MAINTAINER=	ports@FreeBSD.org
13
COMMENT=	Pascal to C translator
10
COMMENT=	Pascal to C translator
14
11
15
BROKEN=		unfetchable
16
17
LICENSE=	GPLv2
12
LICENSE=	GPLv2
18
13
19
WRKSRC=		${WRKDIR}/p2c-1.21alpha-07.Dec.93/src
14
WRKSRC_SUBDIR=	src
20
15
21
USES=		perl5 shebangfix
16
USES=		perl5 shebangfix
22
SHEBANG_FILES=	p2cc.perl
17
SHEBANG_FILES=	p2cc.perl
23
perl_OLD_CMD=	/bin/perl
18
perl_OLD_CMD=	/bin/perl
19
USE_PERL5=	run
24
ALL_TARGET=	all p2cc
20
ALL_TARGET=	all p2cc
25
21
22
pre-build:
23
	@${RM} -f ${WRKSRC}/*.o
24
26
do-install:
25
do-install:
27
	(cd ${WRKSRC} && ${INSTALL_PROGRAM} p2c \
26
	(cd ${WRKSRC} && ${INSTALL_PROGRAM} p2c \
28
		${STAGEDIR}${PREFIX}/bin)
27
		${STAGEDIR}${PREFIX}/bin)
(-)lang/p2c/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (p2c-1.21alpha2.tar.gz) = 5e7874a46d6ac58b1d3ecc0409b5458733cbca8abb12e33d68b23a72910d5c29
1
SHA256 (p2c-2.01.tar.gz) = 4331e396889fd750322316373e882a3a629e1bc5389f05e90d11e04dcd0be0d3
2
SIZE (p2c-1.21alpha2.tar.gz) = 423399
2
SIZE (p2c-2.01.tar.gz) = 1544625
(-)lang/p2c/files/patch-Makefile (-3 / +3 lines)
Lines 1-4 Link Here
1
--- Makefile.orig
1
--- Makefile.orig	1993-12-08 05:36:48 UTC
2
+++ Makefile
2
+++ Makefile
3
@@ -19,29 +19,30 @@
3
@@ -19,29 +19,30 @@
4
 SHELL = /bin/sh
4
 SHELL = /bin/sh
Lines 45-51 Link Here
45
 LFLAGS =
45
 LFLAGS =
46
 
46
 
47
 
47
 
48
@@ -64,9 +65,9 @@
48
@@ -64,9 +65,9 @@ LIBSRCS = p2clib.c loc.p2clib.c
49
 LIBOBJS = p2clib.o loc.p2clib.o
49
 LIBOBJS = p2clib.o loc.p2clib.o
50
 OTHERLIBOBJS =
50
 OTHERLIBOBJS =
51
 
51
 
Lines 58-64 Link Here
58
 
58
 
59
 MISCSRCS = makeproto.c
59
 MISCSRCS = makeproto.c
60
 PROTOS = p2c.proto p2c.hdrs
60
 PROTOS = p2c.proto p2c.hdrs
61
@@ -128,7 +129,6 @@
61
@@ -128,7 +129,6 @@ p2cc: p2cc.perl
62
 	sed -e "s;--HOMEDIR--;$(ABSHOMEDIR);"   \
62
 	sed -e "s;--HOMEDIR--;$(ABSHOMEDIR);"   \
63
 	    -e "s;--INCDIR--;$(ABSINCDIR);"     \
63
 	    -e "s;--INCDIR--;$(ABSINCDIR);"     \
64
 	    -e "s;--LIBDIR--;$(ABSLIBDIR);"     \
64
 	    -e "s;--LIBDIR--;$(ABSLIBDIR);"     \
(-)lang/p2c/files/patch-comment.c (-11 lines)
Lines 1-11 Link Here
1
--- comment.c.orig
2
+++ comment.c
3
@@ -299,7 +299,7 @@
4
 	    printf("\"%s\", line %d,%d: %s\n", infname, inf_lnum, outf_lnum, msg);
5
     }
6
     if (verbose)
7
-	fprintf(logf, "%s:%d:%d: %s\n", infname, inf_lnum, outf_lnum, msg);
8
+	fprintf(p2c_logf, "%s:%d:%d: %s\n", infname, inf_lnum, outf_lnum, msg);
9
     if (notephase == 2 || regression)
10
 	prefix = format_s("\004 p2c: %s:", infname);
11
     else
(-)lang/p2c/files/patch-lex.c (-74 lines)
Lines 1-74 Link Here
1
--- lex.c.orig
2
+++ lex.c
3
@@ -520,7 +520,7 @@
4
 	    if (outf != stdout)
5
 		printf("Translation aborted: Too many errors.\n");
6
 	    if (verbose)
7
-		fprintf(logf, "Translation aborted: Too many errors.\n");
8
+		fprintf(p2c_logf, "Translation aborted: Too many errors.\n");
9
 	    closelogfile();
10
 	    exit_failure();
11
 	}
12
@@ -541,9 +541,9 @@
13
         printf("Translation aborted.\n");
14
     }
15
     if (verbose) {
16
-	fprintf(logf, "%s:%d:%d: %s\n",
17
+	fprintf(p2c_logf, "%s:%d:%d: %s\n",
18
 		infname, inf_lnum, outf_lnum, msg);
19
-	fprintf(logf, "Translation aborted.\n");
20
+	fprintf(p2c_logf, "Translation aborted.\n");
21
     }
22
     closelogfile();
23
     exit_failure();
24
@@ -562,7 +562,7 @@
25
 {
26
     if (checkeatnote(msg)) {
27
 	if (verbose)
28
-	    fprintf(logf, "%s:%d:%d: Omitted warning: %s\n",
29
+	    fprintf(p2c_logf, "%s:%d:%d: Omitted warning: %s\n",
30
 		    infname, inf_lnum, outf_lnum, msg);
31
 	return;
32
     }
33
@@ -577,7 +577,7 @@
34
 {
35
     if (checkeatnote(msg)) {
36
 	if (verbose)
37
-	    fprintf(logf, "%s:%d:%d: Omitted internal error in %s: %s\n",
38
+	    fprintf(p2c_logf, "%s:%d:%d: Omitted internal error in %s: %s\n",
39
 		    infname, inf_lnum, outf_lnum, proc, msg);
40
 	return;
41
     }
42
@@ -596,7 +596,7 @@
43
 {
44
     if (blockkind == TOK_IMPORT || checkeatnote(msg)) {
45
 	if (verbose)
46
-	    fprintf(logf, "%s:%d:%d: Omitted note: %s\n",
47
+	    fprintf(p2c_logf, "%s:%d:%d: Omitted note: %s\n",
48
 		    infname, inf_lnum, outf_lnum, msg);
49
 	return;
50
     }
51
@@ -612,12 +612,12 @@
52
 {
53
     if (blockkind == TOK_IMPORT || checkeatnote(msg)) {
54
 	if (verbose)
55
-	    fprintf(logf, "%s:%d:%d: Omitted end-note: %s\n",
56
+	    fprintf(p2c_logf, "%s:%d:%d: Omitted end-note: %s\n",
57
 		    infname, inf_lnum, outf_lnum, msg);
58
 	return;
59
     }
60
     if (verbose)
61
-	fprintf(logf, "%s:%d:%d: Recorded end-note: %s\n",
62
+	fprintf(p2c_logf, "%s:%d:%d: Recorded end-note: %s\n",
63
 		infname, inf_lnum, outf_lnum, msg);
64
     (void) strlist_add(&endnotelist, msg);
65
 }
66
@@ -1327,7 +1327,7 @@
67
 	    else
68
 		printf("Reading include file \"%s\"\n", fn);
69
 	if (verbose)
70
-	    fprintf(logf, "Reading include file \"%s\"\n", fn);
71
+	    fprintf(p2c_logf, "Reading include file \"%s\"\n", fn);
72
         if (expandincludes == 0) {
73
             push_input_file(fp, fn, 2);
74
             curtok = TOK_INCLUDE;
(-)lang/p2c/files/patch-loc.p2clib.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- loc.p2clib.c.orig
1
--- loc.p2clib.c.orig	1993-12-08 05:36:53 UTC
2
+++ loc.p2clib.c
2
+++ loc.p2clib.c
3
@@ -4,3 +4,42 @@
3
@@ -4,3 +4,42 @@
4
  * the symbol LOCAL_INIT when you compile p2clib.c.
4
  * the symbol LOCAL_INIT when you compile p2clib.c.
(-)lang/p2c/files/patch-makeproto.c (-2 / +2 lines)
Lines 1-4 Link Here
1
--- makeproto.c.orig
1
--- makeproto.c.orig	1993-12-08 05:36:53 UTC
2
+++ makeproto.c
2
+++ makeproto.c
3
@@ -7,6 +7,7 @@
3
@@ -7,6 +7,7 @@
4
 
4
 
Lines 8-14 Link Here
8
 #include <ctype.h>
8
 #include <ctype.h>
9
 #include <time.h>
9
 #include <time.h>
10
 
10
 
11
@@ -157,7 +158,7 @@
11
@@ -157,7 +158,7 @@ char **argv;
12
     char argdecls[MAXARGS][256], argnames[MAXARGS][80];
12
     char argdecls[MAXARGS][256], argnames[MAXARGS][80];
13
     char *cp, *cp2, *cp3;
13
     char *cp, *cp2, *cp3;
14
     int i, j, pos, len, thistab, numstars, whichf, nargs, incomment, errors = 0;
14
     int i, j, pos, len, thistab, numstars, whichf, nargs, incomment, errors = 0;
(-)lang/p2c/files/patch-out.c (-11 lines)
Lines 1-11 Link Here
1
--- out.c.orig
2
+++ out.c
3
@@ -1194,7 +1194,7 @@
4
 			    " seconds, %ld tries on line %d [251]", alts, outf_lnum);
5
 		    note(outbuf);
6
 		} else if (verbose) {
7
-		    fprintf(logf, "%s, %d/%d: Line breaker spent %ld tries\n",
8
+		    fprintf(p2c_logf, "%s, %d/%d: Line breaker spent %ld tries\n",
9
 			    infname, inf_lnum, outf_lnum, alts);
10
 		}
11
 		if (testinglinebreaker)
(-)lang/p2c/files/patch-p2clib.c (-4 / +4 lines)
Lines 1-6 Link Here
1
--- p2clib.c.orig
1
--- p2clib.c.orig	1993-12-08 05:36:53 UTC
2
+++ p2clib.c
2
+++ p2clib.c
3
@@ -890,7 +890,7 @@
3
@@ -890,7 +890,7 @@ int *Day, *Month, *Year, *Hour, *Min, *S
4
 {
4
 {
5
 #ifndef NO_TIME
5
 #ifndef NO_TIME
6
     struct tm *tm;
6
     struct tm *tm;
Lines 9-15 Link Here
9
 
9
 
10
     time(&clock);
10
     time(&clock);
11
     tm = localtime(&clock);
11
     tm = localtime(&clock);
12
@@ -908,7 +908,7 @@
12
@@ -908,7 +908,7 @@ int *Day, *Month, *Year, *Hour, *Min, *S
13
 Void VAXdate(s)
13
 Void VAXdate(s)
14
 char *s;
14
 char *s;
15
 {
15
 {
Lines 18-24 Link Here
18
     char *c;
18
     char *c;
19
     int i;
19
     int i;
20
     static int where[] = {8, 9, 0, 4, 5, 6, 0, 20, 21, 22, 23};
20
     static int where[] = {8, 9, 0, 4, 5, 6, 0, 20, 21, 22, 23};
21
@@ -924,7 +924,7 @@
21
@@ -924,7 +924,7 @@ char *s;
22
 Void VAXtime(s)
22
 Void VAXtime(s)
23
 char *s;
23
 char *s;
24
 {
24
 {
(-)lang/p2c/files/patch-parse.c (-31 lines)
Lines 1-31 Link Here
1
--- parse.c.orig
2
+++ parse.c
3
@@ -4392,7 +4392,7 @@
4
     long saveserial;
5
 
6
     if (verbose)
7
-	fprintf(logf, "%s, %d/%d: Translating %s (in %s)\n",
8
+	fprintf(p2c_logf, "%s, %d/%d: Translating %s (in %s)\n",
9
 		infname, inf_lnum, outf_lnum,
10
 		curctx->name, curctx->ctx->name);
11
     notephase = 1;
12
@@ -5477,8 +5477,8 @@
13
     if (!fp) {
14
         if (need)
15
             perror(infnbuf);
16
-	if (logf)
17
-	    fprintf(logf, "(Unable to open search file \"%s\")\n", infnbuf);
18
+	if (p2c_logf)
19
+	    fprintf(p2c_logf, "(Unable to open search file \"%s\")\n", infnbuf);
20
         return 0;
21
     }
22
     flushcomments(NULL, -1, -1);
23
@@ -5515,7 +5515,7 @@
24
 	    else
25
 		printf("Reading import text for \"%s\"\n", mod->name);
26
 	if (verbose)
27
-	    fprintf(logf, "%s, %d/%d: Reading import text for \"%s\"\n",
28
+	    fprintf(p2c_logf, "%s, %d/%d: Reading import text for \"%s\"\n",
29
 		    infname, inf_lnum, outf_lnum, mod->name);
30
         pushctx(mod);
31
         gettok();
(-)lang/p2c/files/patch-trans.c (-59 / +6 lines)
Lines 1-6 Link Here
1
--- trans.c.orig
1
--- trans.c.orig	2015-10-02 17:52:53 UTC
2
+++ trans.c
2
+++ trans.c
3
@@ -23,6 +23,8 @@
3
@@ -23,6 +23,8 @@ the Free Software Foundation, Inc., 675 
4
 #include "trans.h"
4
 #include "trans.h"
5
 
5
 
6
 #include <time.h>
6
 #include <time.h>
Lines 9-15 Link Here
9
 
9
 
10
 
10
 
11
 
11
 
12
@@ -575,7 +577,7 @@
12
@@ -575,7 +577,7 @@ extern char *getenv PP((char *));
13
 # endif
13
 # endif
14
 #endif
14
 #endif
15
 
15
 
Lines 18-82 Link Here
18
 
18
 
19
 Static void openlogfile()
19
 Static void openlogfile()
20
 {
20
 {
21
@@ -588,17 +590,17 @@
21
@@ -608,7 +610,7 @@ Static void openlogfile()
22
     if (!name)
23
 	name = format_s("%s.log", codefname);
24
     saveoldfile(name);
25
-    logf = fopen(name, "w");
26
-    if (logf) {
27
-	fprintf(logf, "\nTranslation of %s to %s by p2c %s\n",
28
+    p2c_logf = fopen(name, "w");
29
+    if (p2c_logf) {
30
+	fprintf(p2c_logf, "\nTranslation of %s to %s by p2c %s\n",
31
 		infname, codefname, P2C_VERSION);
32
-	fprintf(logf, "Translated");
33
+	fprintf(p2c_logf, "Translated");
34
 	uname = getenv("USER");
35
 	if (uname)
36
-	    fprintf(logf, " by %s", uname);
37
+	    fprintf(p2c_logf, " by %s", uname);
38
 	time(&starting_time);
39
-	fprintf(logf, " on %s", ctime(&starting_time));
40
-	fprintf(logf, "\n\n");
41
+	fprintf(p2c_logf, " on %s", ctime(&starting_time));
42
+	fprintf(p2c_logf, "\n\n");
43
     } else {
44
 	perror(name);
45
 	verbose = 0;
46
@@ -608,20 +610,20 @@
47
 
22
 
48
 void closelogfile()
23
 void closelogfile()
49
 {
24
 {
50
-    long ending_time;
25
-    long ending_time;
51
+    time_t ending_time;
26
+    time_t ending_time;
52
 
27
 
53
-    if (logf) {
28
     if (logfile) {
54
-	fprintf(logf, "\n\n");
29
 	fprintf(logfile, "\n\n");
55
+    if (p2c_logf) {
56
+	fprintf(p2c_logf, "\n\n");
57
 #if defined(unix) || defined(__unix)
58
-	fprintf(logf, "Total memory used: %ld bytes.\n", (long)sbrk(0));
59
+	fprintf(p2c_logf, "Total memory used: %ld bytes.\n", (long)sbrk(0));
60
 #endif
61
 	time(&ending_time);
62
-	fprintf(logf, "Processed %d source lines in %ld:%ld seconds.\n",
63
+	fprintf(p2c_logf, "Processed %d source lines in %ld:%ld seconds.\n",
64
 		inf_ltotal,
65
 		(ending_time - starting_time) / 60,
66
 		(ending_time - starting_time) % 60);
67
-	fprintf(logf, "\n\nTranslation completed on %s", ctime(&ending_time));
68
-	fclose(logf);
69
+	fprintf(p2c_logf, "\n\nTranslation completed on %s", ctime(&ending_time));
70
+	fclose(p2c_logf);
71
     }
72
 }
73
 
74
@@ -949,7 +951,7 @@
75
         setbuf(codef, NULL);      /* for debugging */
76
     outf = codef;
77
     outf_lnum = 1;
78
-    logf = NULL;
79
+    p2c_logf = NULL;
80
     if (verbose)
81
 	openlogfile();
82
     setup_complete = 0;
(-)lang/p2c/files/patch-trans.h (-11 / +2 lines)
Lines 1-15 Link Here
1
--- trans.h.orig
1
--- trans.h.orig	2015-10-05 23:04:46 UTC
2
+++ trans.h
2
+++ trans.h
3
@@ -1773,7 +1773,7 @@
3
@@ -1863,8 +1863,10 @@ extern Expr *new_array_size;
4
 
5
 extern char *infname, *outfname, *codefname, *hdrfname;
6
 extern char *requested_module;
7
-extern FILE *inf, *outf, *codef, *hdrf, *logf;
8
+extern FILE *inf, *outf, *codef, *hdrf, *p2c_logf;
9
 extern short setup_complete, found_module;
10
 extern short regression, verbose, conserve_mem;
11
 extern int inf_lnum, inf_ltotal;
12
@@ -1861,8 +1861,10 @@
13
 
4
 
14
 /* Our library omits declarations for these functions! */
5
 /* Our library omits declarations for these functions! */
15
 
6
 
(-)lang/p2c/pkg-descr (-20 / +20 lines)
Lines 1-21 Link Here
1
P2c is a tool for translating Pascal programs into C.  The input
1
P2c is a tool for translating Pascal programs into C. The input consists
2
consists of a set of source files in any of the following Pascal
2
of a set of source files in any of the following Pascal dialects: HP
3
dialects: HP Pascal, Turbo/UCSD Pascal, DEC VAX Pascal, Oregon
3
Pascal, Turbo/UCSD Pascal, DEC VAX Pascal, Oregon Software Pascal/2,
4
Software Pascal/2, Macintosh Programmer's Workshop Pascal,
4
Macintosh Programmer's Workshop Pascal, Sun/Berkeley Pascal, Texas
5
Sun/Berkeley Pascal, Texas Instruments Pascal, Apollo Domain Pascal.
5
Instruments Pascal, Apollo Domain Pascal. Modula-2 syntax is also
6
Modula-2 syntax is also supported.  Output is a set of .c and .h files
6
supported. Output is a set of .c and .h files that comprise an
7
that comprise an equivalent program in any of several dialects of
7
equivalent program in any of several dialects of C. Output code may be
8
C. Output code may be kept machine- and dialect independent, or it may
8
kept machine- and dialect independent, or it may be targeted to a
9
be targeted to a specific machine and compiler. Most reasonable Pascal
9
specific machine and compiler. Most reasonable Pascal programs are
10
programs are converted into fully functional C which will compile and
10
converted into fully functional C which will compile and run with no
11
run with no further modifications, although p2c sometimes chooses to
11
further modifications, although p2c sometimes chooses to generate
12
generate readable code at the expense of absolute generality.  P2c
12
readable code at the expense of absolute generality. P2c endeavors to
13
endeavors to insert notes and warning messages into the output code to
13
insert notes and warning messages into the output code to point out
14
point out areas which may require human intervention.  Output code is
14
areas which may require human intervention. Output code is arranged to
15
arranged to be readable and efficient, and to make use of C idioms
15
be readable and efficient, and to make use of C idioms wherever
16
wherever possible.  The main goal of the translation is to produce C
16
possible. The main goal of the translation is to produce C files which
17
files which are pleasant and "natural" enough to be acceptable as the
17
are pleasant and "natural" enough to be acceptable as the new source
18
new source files for a program.  In a pinch, p2c will also serve as an
18
files for a program. In a pinch, p2c will also serve as an ad hoc Pascal
19
ad hoc Pascal compiler.  The p2cc script makes it easy to use p2c as a
19
compiler. The p2cc script makes it easy to use p2c as a compiler.
20
compiler.
21
20
21
WWW: https://schneider.ncifcrf.gov/p2c/

Return to bug 205212