Postfix Compiling Primer--《Postfix The Definitive Guide》
Postfix Compiling Primer
Before we move on to the specifics of building Postfix, let’s take a look at some of the basics when compiling C code.
The options for a particular build are usually contained within a description file nor- mally called Makefile. The make utility uses the Makefile to determine prerequisites, dependencies, and options to use when building a package. Using this information, make calls a compiler to create object files, and then a linker (usually called ld ) to link them together into executables.
Since the Postfix distribution creates its own Makefile, you don’t have to worry about editing that (and you shouldn’t edit it, since any changes you make would likely get overwritten later). Options that Postfix needs in its Makefile are defined in environ- ment variables such as CCARGS . The INSTALL file that comes with the Postfix distri- bution discusses all of the available options. We’ll look at some of the more common ones here.
The following environment variables are available to set compile-time options. You should use quotes around the values to retain spaces or other shell metacharacters:
AUXLIBS
Tells the linker where to look for additional libraries that are not in the standard locations. For example, if you build support for an add-on package, you may have to indicate where the libraries are for that package.
CC
Specifies a particular compiler to use. If you want to use a compiler other than the one Postfix selects, set this variable to your compiler. Postfix normally uses gcc except on platforms where the native compiler is known to work better. You can check the makedefs file to see which compiler Postfix uses by default on your system.
CCARGS
Provides additional arguments to the compiler. If your compiler allows special options or your supporting files are not located in default directories, indicate those options with this variable.
DEBUG
The DEBUG parameter specifies debugging levels for the compiler to use when building the Postfix binaries. Turning on debugging produces extra information that a debugger can use. You can also turn off debugging features completely to build Postfix for a production system.
OPT
The OPT parameter specifies optimization levels for the compiler to use when building Postfix binaries. Additional optimization may increase performance but at the cost of longer compilation and more memory. You can probably accept the defaults that Postfix selects for your platform.