2.4 Building with m4The make(1) program is used to compile and install sendmail,[4] a site that provides precompiled compilers that you can easily install. The Build script creates not only an object working directory, but also an appropriate Makefile in that directory using m4(1). Unless you tell Build to do otherwise, the Makefile it creates will be based solely on information it finds in the appropriate devtools/OS and devtools/Site subdirectories.
For most sites this default behavior will produce the desired result. For other sites different defaults are needed. In this section we discuss those m4 directives necessary for building a Makefile. To understand m4(1), leap ahead to Chapter 4, review the information there, then return here. Creating a Makefile with Build is simplicity itself. First decide whether you wish to maintain your m4 file inside the sendmail source tree, or outside it. If you choose to maintain your m4 file inside the source tree, just name it devtools/Site/site.config.m4 (see Section 2.5 for details) and run Build like this: % ./Build Note, here we have chosen to maintain all our Build m4 files inside the sendmail source tree. This approach allows administrators to rebuild sendmail without needing to remember where the m4 file is located. If you choose to maintain your m4 file outside the source tree, use the -f command-line switch with Build to specify the location of that file: % ./Build -f /usr/local/configs/sendmail/oursite.m4 Note that here, we have chosen to maintain all our Build m4 files in a directory that is outside the sendmail distribution. This approach allows you to upgrade to new releases of sendmail without having to remember to copy the devtools/Site directory each time. The downside to this approach is that you must remember to use the -f command-line switch every time you build. If you fail to remember, or if someone else builds without knowing the need for -f, the created sendmail binary may not work as you expect or might lack the abilities you require. Your m4 file is built using the directives shown in Table 2-3, which are described more fully in the sections that follow. One example of an m4 file might look like this: define(`confOPTIMIZE', `-g') define(`confENVDEF', `-DMATCHGECOS=0') APPENDDEF(`confMAPDEF', `-DNIS') Here we compile with -g to help debug new code we added, and with -DMATCHGECOS=0 to turn off support for fuzzy name matching (MATCHGECOS). Then we declare that we want to use nis(3) for aliases (with -DNIS).
Before creating your own m4 files, be sure to read devtools/README. That file always contains the latest information about building sendmail with m4(1). |