[next] [prev] [prev-tail] [tail] [up]

### 8.7 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 is distributed in binary form along with the compiler.

Its usage is very simple:

ppumove [options] unit1.ppu unit2.ppu ... unitn.ppu

where options is a combination of:

-b:
  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 l i n u x (and Unix like OSes), and pmove.bat on Wi n d o w s and d o s.
-d xxx:
  Set the directory in which to place the output files to xxx.
-e xxx:
  Set the extension of the moved unit files to xxx. By default, this is .ppl. You don’t have to specify the dot.
-o xxx:
  Set 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 l i n u x, 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:
  Operate silently.
-s:
  Make a static library instead of a dynamic one; By default a dynamic library is made on l i n u x.
-w:
  Tell ppumove that it is working under Wi n d o w s NT. This will change the names of the linker and archiving program to ldw and arw, respectively.
-h or -?:
  Display a short help.

The action of the ppumove program is as follows: It takes each of the unit files, and modifies it so that the compiler 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 l i n u x. The extension will be set to .a for static libraries, for shared libraries, the extensions are .so on linux, and .dll under Wi n d o w s NT and o s/2.

As an example, the following command

./ppumove -o both -e ppl ppu.ppu timer.ppu

will generate the following output under l i n u x:

PPU-Mover Version 2.1.1
Copyright (c) 1998-2007 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 Wi n d o w s NT, 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 ppu code in the library.

You could then use or distribute the files libboth.so, timer.ppl and ppu.ppl.

[next] [prev] [prev-tail] [front] [up]