18.4 Tuning Makefile
The
make
(1) program is used to compile and install
sendmail
.
The
makesendmail
script not only created an
obj.
% Makefile is tuned by defining or redefining directives (shown in Table 18.1 that begin lines in that file.
We will discuss each of these macros shortly but first note that, in general, you should never have to modify anything after the "end" line (shown in the following example). The only exception might be special requirements created by porting sendmail to a new platform.
################### end of user configuration flags ###################### Finally, before changing anything inside Makefile , be sure to read src/READ_ME . It always contains the latest information about building sendmail . In this book we are forced to speak in generalities, whereas the src/READ_ME file discusses operating systems, compilers, and hardware in specific detail. 18.4.1 DBMDEF=The DBMDEF= directive defines the database library support you want. The currently available choices are listed in Table 18.2 . Details are given in the indicated section.
Either NDBM or NEWDB must be defined, or sendmail will read the aliases into its symbol table every time it starts. This will make sendmail crawl and is not recommended. External databases can be extremely valuable, especially in providing easy solutions for complex problems. Therefore we recommend that you include a definition for all databases that your system supports, even if you don't immediately foresee a need for them. Below, we illustrate the selection of two forms of database:
DBMDEF= -DNEWDB -DNDBM When these two forms are selected, old databases are read by using NDBM, but new databases are created by using NEWDB. Read src/READ_ME for details about, and exceptions to, this transition process. 18.4.2 ENVDEF=The ENVDEF= directive is used primarily to specify code that should either be specially included or excluded. The following example shows support for identd (8) being excluded from the compiled binary:
ENVDEF= -DIDENTPROTO=0
Note that, once excluded, support cannot
easily be included later by using options. But it may be better to turn
some facilities, such as
identd
(8),
off and on with options rather than compiling
them out (see
Section 34.8.70.10, "Timeout.ident"
for a description of the The ENVDEF= directive can also be used to define operating specific support. For example,
ENVDEF= -DSOLARIS=20501 Here, support for Sun's Solaris 2.5.1 operating system is being included. In general, operating support is already included in the Makefile selected for your system. You will have only to redefine this if you are porting to a completely new operating system. 18.4.3 INCDIRS=
The INCDIRS= directive defines the directories searched (using the compiler's
INCDIRS=-I/usr/local/include/db LIBDIRS=-L/usr/local/lib/
The Many Makefile s specify /usr/sww in these lines. If you don't need local include files or libraries, you can leave the /usr/sww in place without harm. [7]
18.4.4 LDOPTS=The LDOPTS= directive defines operating system-specific loader options. For example, on SunOS machines the following is recommended:
LDOPTS= -Bstatic This tells the loader to exclude dynamic library support for better security. 18.4.5 LIBDIRS=
The LIBDIRS= directive defines the directories searched (using the loader's
18.4.6 LIBS=
The LIBS= directive lists additional libraries by name (using the
loader's
LIBS= -ldb -lresolv -l44bsd
It is likely that you will have to add or change libraries in this list
depending on your architecture and operating system. To discover
which you need, run
make
(1) (see the next section)
and observe which routines the linker reports as missing.
The 18.4.7 BINDIR=The BINDIR= directive defines the location (directory) where the sendmail binary will be installed. It is very unlikely that you will ever have to change this from the value predefined for you in your Makefile . One exception might be if you are installing a new sendmail in parallel with the existing one. In that instance you might use
BINDIR=/usr/tests STDIR=/usr/tests HFDIR=/usr/tests ENVDEF= -D_PATH_SENDMAILCF=/usr/tests/sendmail.cf \ -D_PATH_SENDMAILPID=/usr/tests/sendmail.pid The STDIR= and HFDIR= are described below. The ENVDEF= tells sendmail where its configuration and pid files will be found (see Section 18.8.34, PATH... ). 18.4.8 STDIR=The STDIR= directive defines the location (directory) where the sendmail program's statistics file will be found (see Section 26.2.1, "The sendmail.st File" for a description of this file). It is very unlikely that you will ever have to change this from the value that is predefined for you in your Makefile . 18.4.9 HFDIR=
The HFDIR= directive defines the location (directory) where the
sendmail
program's SMTP-help file will be found (see
Section 34.8.28, HelpFile (H)
for
a description of the 18.4.10 OBJADD=The OBJADD= directive defines additional object files that need to be included in the sendmail program. It is very unlikely that you will ever have to change this from the value that is predefined for you in your Makefile . One exception might be if you need to replace a standard C library function with one that was customized to satisfy some local need. For example, consider a replacement for the syslog (3) routine. First place a copy of syslog.c in the src directory. Then run:
% which will create an obj.* directory and populate it with symbolic links. [8] Finally, edit your Makefile and syslog.o to the OBJADD= directive:
OBJADD=syslog.o This will cause the syslog.c file to be compiled to produce the needed syslog.o and will cause that syslog.o to be linked in with the sendmail binary. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|