p2c - Pascal to C translator. By Jean-Marc Zucconi.

Submitted by:	jmz
This commit is contained in:
Jordan K. Hubbard
1994-10-04 04:10:06 +00:00
parent a3d5727d88
commit 5974ef3b6b
5 changed files with 71 additions and 0 deletions

12
lang/p2c/Makefile Normal file
View File

@@ -0,0 +1,12 @@
DISTNAME= p2c-1.21alpha-07.Dec.93
DISTFILES= p2c-1.21alpha2.tar.gz
MASTER_SITES= ftp://src.doc.ic.ac.uk/gnu/hurd/
pre-install:
@mkdir -p /usr/local/lib
@mkdir -p /usr/local/man/man1
@mkdir -p /usr/local/include/p2c
@cp ${WRKSRC}/src/p2cc.man /usr/local/man/man1/p2cc.1
.include <bsd.port.mk>

1
lang/p2c/pkg-comment Normal file
View File

@@ -0,0 +1 @@
p2c - Pascal to C translator, version 1.21alpha-07.Dec.93

21
lang/p2c/pkg-descr Normal file
View File

@@ -0,0 +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 dialectindependent, 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.

16
lang/p2c/pkg-plist Normal file
View File

@@ -0,0 +1,16 @@
@cd /usr/local
@owner bin
@mode 755
bin/p2c
bin/p2cc
@mode 644
lib/libp2c.a
man/man1/p2c.1
man/man1/p2cc.1
include/p2c/p2c.h
lib/p2c/p2crc
lib/p2c/loc.p2crc
lib/p2c/system.imp
lib/p2c/system.m2
lib/p2c/turbo.imp
lib/p2c/string.pas

21
lang/p2c/scripts/configure vendored Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
if [ $# != 3 ]; then exit 1; fi
cat >>$3/Makefile <<END || exit 1;
all:
cd src; make OPT=-O
END
mv $3/src/p2cc.perl $3/src/p2cc.perl.orig || exit 1;
sed -e 1s/--.*// < $3/src/p2cc.perl.orig > $3/src/p2cc.perl || exit 1;
cat >>$3/src/Makefile <<END || exit 1;
HOMEDIR=/usr/local/lib/p2c
INCDIR=/usr/local/include/p2c
BINDIR=/usr/local/bin
LIBDIR=/usr/local/lib
MANDIR=/usr/local/man/man1
END
exit 0;