Quick start manual

Libraries and packages
9-13
Compiling packages
Packages are ordinarily compiled from the IDE using .dpk files generated by the
Package editor. You can also compile .dpk files directly from the command line.
When you build a project that contains a package, the package is implicitly
recompiled, if necessary.
Generated files
The following table lists the files produced by the successful compilation of a
package.
Several compiler directives and command-line switches are available to support
package compilation.
Package-specific compiler directives
The following table lists package-specific compiler directives that can be inserted into
source code. See the online Help for details.
Table 9.1 Compiled package files
File extension Contents
dcp A binary image containing a package header and the concatenation of
all dcu (Windows and Linux) or dpu (Linux) files in the package. A
single dcp file is created for each package. The base name for the dcp
is the base name of the dpk source file.
dcu
dpu (Linux)
A binary image for a unit file contained in a package. One dcu or dpu
file is created, when necessary, for each unit file.
.bpl (Windows)
bpl<package>.so (Linux)
The runtime package. This file is a shared library with special Borland-
specific features. The base name for the package is the base name of
the dpk source file.
Table 9.2 Package-specific compiler directives
Directive Purpose
{$IMPLICITBUILD OFF} Prevents a package from being implicitly recompiled later.
Use in .dpk files when compiling packages that provide
low-level functionality, that change infrequently between
builds, or whose source code will not be distributed.
{$G–} or {$IMPORTEDDATA OFF} Disables creation of imported data references. This
directive increases memory-access efficiency, but prevents
the unit where it occurs from referencing variables in
other packages.
{$WEAKPACKAGEUNIT ON} Packages unit “weakly,” as explained in the online Help.
{$DENYPACKAGEUNIT ON} Prevents unit from being placed in a package.
{$DESIGNONLY ON} Compiles the package for installation in the IDE. (Put in
.dpk file.)
{$RUNONLY ON} Compiles the package as runtime only. (Put in .dpk file.)