P2CCSection: User Commands (1)
Index Return to Main Contents
NAMEp2cc - Pascal compiler using p2c
SYNOPSISp2cc [ options and files ]
DESCRIPTIONP2cc is a Pascal compiler that works by running p2c, the Pascal to C translator, followed by cc, the C compiler.
All command-line options and arguments are passed directly to the C compiler, except that files ending with .p or .pas are passed through p2c first, and that the options listed below are interpreted specially by p2cc. As usual, programs made up of several source modules can be compiled all on one p2cc command, or separately using p2cc -c and then linked afterwards with a final p2cc command.
- Translate .p and .pas files to C but do not compile the resulting .c files. This is analogous to the -S and -c options of most C compilers, which stop with assembly language or unlinked object files, respectively.
- Pass option to p2c rather than to the C compiler.
- This switch is passed on to the C compiler to enable optional optimization of the program. It also instructs p2c to do a few optimizations of its own, e.g., disabling certain run-time range checks.
- The -I switch is passed to both p2c and the C compiler, where it will identify places to look for Pascal interface texts or C .h files, respectively.
- Enable "verbose" mode. This affects both p2c and the C compiler.
ENVIRONMENTThe following environment variables may be used to affect the operation of p2cc.
- This variable holds a regular expression for recognizing the names of Pascal files. By default, it recognizes strings which end in .p or .pas.
- This holds the name of the command to run the C compiler. Default is cc.
- This holds additional arguments to be passed to the cc command, before the names of any source files.
- These arguments are passed to the cc command after the names of source files.
- This is the name of the libp2c.a file holding p2c runtime routines. Its default is -lp2c, which causes the linker to look for libp2c.a in the usual places for libraries.
- This holds the name of the command to run p2c. It is p2c by default.
- These are arguments to be passed to p2c on the command line. The default specifies -comp, which set the defaults for various p2c configuration options to be more suitable for compilation rather than translation, and -local, which sets other options to work on the assumption that the output from p2c will be compiled and run on the same type of machine that ran p2c itself.
- This is the suffix to use for the names of temporary C source files. The default is ..c, ensuring that p2c will not inadvertently erase .c files in the same directory as the Pascal source files. Note that if the -p2c option is used, the suffix is forced instead to .c since the user has explicitly asked for C source files.
AUTHORDave Gillespie, firstname.lastname@example.org.
SEE ALSOp2c(1), cc(1)