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 normally 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 environment variables such as CCARGS. The INSTALL file that comes with the Postfix distribution 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 ...

Get Postfix: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.