next up previous contents
Next: Supplied units Up: Utilities and units that Previous: Utilities and units that

Supplied programs

ppudump program

ppudump is a program which shows the contents of a Free Pascal unit. It is distributed with the compiler you can just issue the following command

  ppudump [options] foo.ppu
to display the contents of the foo.ppu unit. You can specify multiple files on the command line.

The options can be used to change the verbosity of the display. By default, all available information is displayed. You can set the verbosity level using the -Vxxx option. Here, xxx is a combination of the following letters:

h:
show header info.
i:
show interface information.
m:
show implementation information.
d:
show only (interface) definitions.
s:
show only (interface) symbols.
b:
show browser info.
a:
show everything (default if no -V option is present).

Demo programs

Also distributed with Free Pascal comes a series of demonstration programs. These programs have no other purpose than demonstrating the capabilities of Free Pascal. They are located in the demo directory of the sources.

Documentation Example programs

All example programs of the documentation are available. Check out the directories that end on ex in the documentation sources. There you will find all example sources.

ppumove program

ppumove is a program to make shared or static libraries from multiple units. It can be compared with the tpumove program that comes with Turbo Pascal.

It should be distributed in binary form along with the compiler.

It's usage is very simple:

ppumove [options] unit1.ppu unit2.ppu ... unitn.ppu
Where options is a combination of
-b:
If specified, ppumve will generate a batch file that will contain the external linking and archiving commands that must be executed. The name of this batch file is pmove.sh on LINUX, and pmove.bat otherwise.
-d xxx:
If specified, the output files will put in the directory xxx
-e xxx:
Sets the extension of the moved unit files to xxx. By default, this is .ppl. You don't have to specify the dot.
-o xxx:
sets the name of the output file, i.e. the name of the file containing all the units. This parameter is mandatory when you use multiple files. On LINUX, ppumove will prepend this name with lib if it isn't already there, and will add an extension appropriate to the type of library.
-q:
Causes ppumove to operate silently.
-s:
Tells ppumove to make a static library instead of a dynamic one; By default a dynamic library is made on LINUX.
-w:
Tells ppumove that it is working under WINDOWSNT. This will change the names of te linker and archiving program to ldw and arw, respectively.
-h or -?:
will display a short help.

The action of the ppumve program is as follows: It takes each of the unit files, and modifies it so that the compile will know that it should look for the unit code in the library. The new unit files will have an extension .ppu, this can be changed with the -e option. It will then put together all the object files of the units into one library, static or dynamic, depending on the presence of the -s option.

The name of this library must be set with the -o option. If needed, the prefix lib will be prepended under LINUX.. The extension will be set to .a for static libraries, for shared libraries the extensions are .so on linux, and .dll under WINDOWSNT and OS/2.

As an example, the following command

./ppumove -o both -e ppl ppu.ppu timer.ppu
under linux, will generate the following output:
PPU-Mover Version 0.99.7
Copyright (c) 1998 by the Free Pascal Development Team

Processing ppu.ppu... Done.
Processing timer.ppu... Done.
Linking timer.o ppu.o
Done.
And it will produce the following files:
  1. libboth.so : The shared library containing the code from ppu.o and timer.o. Under WINDOWSNT, this file would be called both.dll.
  2. timer.ppl : The unit file that tells the Free Pascal compiler to look for the timer code in the library.
  3. ppu.ppl : The unit file that tells the Free Pascal compiler to look for the timer code in the library.
You could then use or distribute the files libboth.so, timer.ppl and ppu.ppl.


next up previous contents
Next: Supplied units Up: Utilities and units that Previous: Utilities and units that

Michael Van Canneyt
Thu Sep 10 13:56:17 CEST 1998