sendmail: Update vendor branch to v8.14.4
[dragonfly.git] / contrib / sendmail-8.14 / devtools / README
1 This directory contains tools.  Do not attempt to actually build
2 anything in this directory.
3
4 The Build script allows you to specify a base location for the object
5 files by using the -O flag:
6
7         ./Build -O /tmp
8
9 will put the object files in /tmp/obj.*/.  Also, if the SENDMAIL_SUFFIX
10 environment variable is set, its value will be used in the obj.* directory
11 name.
12
13 The Build script allows you to specify a site configuration file by using
14 the -f flag:
15
16         ./Build -f siteconfig.m4
17
18 You can put such site configuration files in the Site sub-directory;
19 see Site/README for details.
20
21 If you need to support multiple build configurations from the same tree,
22 you can use prefixes to differentiate your configurations.  Use the -Q
23 flag to Build:
24
25         ./Build -Q prefix
26
27 Build will select a prefix.*.m4 file instead of the site.*.m4 file according
28 to the conventions in Site/README, and use it to modify the build
29 configuration.  The object directory used will be obj.prefix.*/.  Your
30 prefix.*.m4 files should reside in the Site directory.  You may not use
31 -Q and -f simultaneously.
32
33 While building a site configuration file, beyond using define() to set
34 variables, you can also add to a definition using the APPENDDEF() and
35 PREPENDDEF() macros.  For example:
36
37         APPENDDEF(`confINCDIRS', `-I/usr/local/bind/include')
38
39 will add -I/usr/local/bind/include to the already existing confINCDIRS.
40 Note: There must be no trailing spaces after the last quote mark and
41 before the closing parenthesis.  Also you may need to properly quote
42 m4 reserved words as specified by your vendor's m4 command.
43
44 By default, sendmail will search your system for include and library
45 directories as well as certain libraries (libdb.* for Berkeley DB and
46 libbind.a or libresolv.* for name resolution).  You can turn off this
47 configuration step by specifying the -S flag with the Build command.
48
49 The OS subtree contains definitions for variations on a standard
50 model for system installation.  The M4 variables that can be defined
51 and their defaults before referencing the appropriate OS definitions
52 are listed below.  Note that variables preceded by an asterisk (*)
53 are currently not used in the open source distribution.
54
55 confBEFORE          [empty]             Files to create before sendmail is
56                                         compiled.  The methods must be defined
57                                         in the Makefile using PUSHDIVERT(3).
58 confBLDVARIANT      OPTIMIZED           This controls which object variant will
59                                         be built and is controlled with the
60                                         -v flag to the Build
61                                         script. Internally, this macro is
62                                         used to select compiler options in
63                                         the devtools/OS/*.m4 files.  Valid
64                                         arguments for the Build -v flag are
65                                         "optimized", "debug", and "purify"
66                                         which map to confBLDVARIANT values
67                                         of "OPTIMIZED", "DEBUG", and
68                                         "PURIFY".  This is a work in
69                                         progress, and as such not all
70                                         devtools/OS/*.m4 have been updated
71                                         yet. (See Linux for an example of
72                                         one that has.)  Also, in the future
73                                         it may be desirable to append a
74                                         variant identifier to the object
75                                         directory name to allow different
76                                         variants to independently co-exist
77                                         on a given target platform.  Note:
78                                         the PURIFY variant has not been
79                                         fully implemented on any platforms
80                                         yet. Other variants can be added as
81                                         needed in the future. Changing this
82                                         macro from its default will affect
83                                         other default values.
84 confBUILDBIN        ../../devtools/bin  The location of the build support
85                                         binaries, relative to the obj.*
86                                         directory.
87 confCC              cc                  The C compiler to use.
88 confCCOPTS          [empty]             Additional options to pass to confCC.
89 *confCCOPTS_SO      [empty]             Additional options for compiling
90                                         shared object libraries.
91 confCCLINK          confCC              Linker to use (for executables).
92 confCOPY            cp                  A program that copies files.
93 confMKDIR           [empty]             A program that creates directories
94                                         (mkdir) and takes the -p parameter
95                                         to create also intermediate directories
96                                         as required.  If this macro is set,
97                                         then it used by "make install" to
98                                         create the required installation
99                                         directories.
100 confDEPEND_TYPE     generic             How to build dependencies.  This should
101                                         be the name of a file in
102                                         devtools/M4/depend
103 confDEPLIBS         [empty]             Dependent libraries when building 
104                                         shared objects. 
105 confDONT_INSTALL_CATMAN  [undefined]    Don't install the formatted manual
106                                         pages.
107 confEBINDIR         /usr/libexec        The location for binaries executed
108                                         from other binaries, e.g., mail.local
109                                         or smrsh.
110 confENVDEF          [empty]             -D flags passed to C compiler.
111 confFORCE_RMAIL     [undefined]         If defined, install the rmail program
112                                         without question.
113 confGBINGRP         smmsp               The group for set-group-ID binaries.
114 confGBINMODE        2555                The mode for set-group-ID binaries.
115 confGBINOWN         root                The owner for set-group-ID binaries.
116 confMSPQOWN         smmsp               The owner of the MSP queue.
117 confMSP_QUEUE_DIR   /var/spool/clientmqueue   The MSP queue directory.
118 confMSP_STFILE      sm-client.st        Name of the MSP statistics file.
119 confHFDIR           /etc/mail           Location of the sendmail helpfile.
120 confHFFILE          helpfile            Name of the installed helpfile.
121 confINCDIRS         [empty]             -I flags passed to C compiler.
122 confINCGRP          bin                 The group for include files.
123 confINCMODE         444                 The mode of installed include files.
124 confINCOWN          root                The owner for include files.
125 confINCLUDEDIR      /usr/include        Where to install include files.
126 confINSTALL         install             The BSD-compatible install program.
127                                         Use ${BUILDBIN}/install.sh if none
128                                         is available on your system.
129 confINSTALL_RAWMAN  [undefined]         Install the unformatted manual pages.
130 *confLD             confCC              Linker to use (for libraries).
131 confLDOPTS          [empty]             Linker options.
132 *confLDOPTS_SO      [empty]             Additional linker options for
133                                         linking shared object libraries.
134 confLIBDIR          /usr/lib            Where to install library files.
135 confLIBDIRS         [empty]             -L flags passed to ld.
136 confLIBGRP          bin                 The group for libraries.
137 confLIBMODE         444                 The mode of installed libraries.
138 confLIBOWN          root                The owner for libraries.
139 confLIBS            [varies]            -l flags passed to ld.
140 confLIBSEARCH       db bind resolv 44bsd
141                                         Search for these libraries for
142                                         linking with programs.
143 confLIBSEARCHPATH   /lib /usr/lib /usr/shlib
144                                         Locations to search for the
145                                         libraries specified by confLIBSEARCH.
146 confLINKS           ${UBINDIR}/newaliases ${UBINDIR}/mailq \
147                     ${UBINDIR}/hoststat ${UBINDIR}/purgestat
148                                         Names of links to sendmail.
149 confLN              ln                  The command used to create links.
150 confLNOPTS          -f -s               The parameters for confLN.
151 confMAN1            confMANROOT 1       The location of man1 files.
152 confMAN1EXT         1                   The extension on files in confMAN1.
153 confMAN1SRC         0                   The source for man pages installed
154                                         in confMAN1.
155 confMAN3            confMANROOT 3       The location of man3 files.
156 confMAN3EXT         3                   The extension on files in confMAN3.
157 confMAN3SRC         0                   The source for man pages installed
158                                         in confMAN3.
159 confMAN4            confMANROOT 4       The location of man4 files.
160 confMAN4EXT         4                   The extension on files in confMAN4.
161 confMAN4SRC         0                   The source for man pages installed
162                                         in confMAN4.
163 confMAN5            confMANROOT 5       The location of man5 files.
164 confMAN5EXT         5                   The extension on files in confMAN5.
165 confMAN5SRC         0                   The source for man pages installed
166                                         in confMAN5.
167 confMAN8            confMANROOT 8       The location of man8 files.
168 confMAN8EXT         8                   The extension on files in confMAN8.
169 confMAN8SRC         0                   The source for man pages installed
170                                         in confMAN8.
171 confMANDOC          -man                The macros used to format man pages.
172 confMANGRP          bin                 The group of installed man pages.
173 confMANMODE         444                 The mode of installed man pages.
174 confMANOWN          bin                 The owner of installed man pages.
175 confMANROOT         /usr/share/man/cat  The root of the man subtree.
176 confMANROOTMAN      /usr/share/man/man  The root of the man subtree, for
177                                         unformatted manual pages.
178 confMAPDEF          [varies]            The map definitions, e.g.,
179                                         -DNDBM -DNEWDB.  -DNEWDB is always
180                                         added if libdb.* can be found.
181 confMBINDIR         /usr/sbin           The location of the MTA (sm-mta,
182                                         sendmail) binary.
183 confMBINGRP         bin                 The group of the MTA binary (sm-mta).
184 confMBINMODE        550                 The mode of the MTA binary (sm-mta).
185 confMBINOWN         root                The owner of the MTA binary (sm-mta).
186 confMTCCOPTS        [empty]             Additional options for compiling
187                                         multi-threaded object files.
188 confMTLDOPTS        [empty]             Additional linker options for
189                                         linking multithreaded binaries.
190 confNO_HELPFILE_INSTALL  [undefined]    If defined, don't install the sendmail
191                                         helpfile by default.
192 confNO_MAN_BUILD    [undefined]         If defined, don't build the man
193                                         pages.
194 confNO_MAN_INSTALL  [undefined]         If defined, don't install the man
195                                         pages by default.
196 confNO_STATISTICS_INSTALL  [undefined]  If defined, don't install the sendmail
197                                         statistics file by default.
198 confNROFF           groff -Tascii       The command to format man pages.
199 confOBJADD          [empty]             Objects that should be included in
200                                         when linking sendmail and the
201                                         associated utilities.  See also
202                                         confSRCADD.
203 confOPTIMIZE        -O                  Flags passed to C compiler as ${O}.
204 confRANLIB          echo                The path to the program to use
205                                         as ranlib.
206 confRANLIBOPTS      [empty]             Options to pass to ranlib.
207 confREQUIRE_LIBSM   [empty]             Define if libsm is required.
208 confSBINDIR         /usr/sbin           The location of root-oriented
209                                         commands, such as makemap.
210 confSBINGRP         bin                 The group for set-user-ID binaries.
211 confSBINMODE        4555                The mode for set-user-ID binaries.
212 confSBINOWN         root                The owner for set-user-ID binaries.
213 confSETUSERID_INSTALL   [undefined]     Needs to be defined to enable the
214                                         install-set-user-id target for
215                                         sendmail.  See sendmail/SECURITY.
216 confSHAREDLIB_EXT   .so                 Shared library file extenion name.
217 confSHAREDLIB_SUFFIX [empty]            Shared object version suffix.   
218 confSHAREDLIBDIR    /usr/lib/           Directory for installing shared 
219                                         library.  Note: if the value is
220                                         not empty, it must end with a
221                                         slash ('/') otherwise it will not
222                                         be taken as a directory (but as
223                                         the beginning of a path).
224 confSHELL           /bin/sh             The shell to use inside make.
225 confSM_OS_HEADER    [varies]            The name of the platform specific
226                                         include file.  Undefine this if
227                                         libsm is not used.
228 confSMOBJADD        [empty]             Objects that should be included in
229                                         when linking sendmail.  See also
230                                         confSMSRCADD.
231 confSMSRCADD        [empty]             C source files which correspond to
232                                         objects listed in confSMOBJADD.
233 confSMSRCDIR        [varies]            The sendmail source directory
234                                         relative to support program obj.*
235                                         directories.  If not set, the
236                                         Makefile will use a path set by the
237                                         Build script.
238 confSRCADD          [empty]             C source files which correspond to
239                                         objects listed in confOBJADD.
240 confSRCDIR          [varies]            The root of the source directories
241                                         relative to support program obj.*
242                                         directories.  If not set, the
243                                         Makefile will use a path set by the
244                                         Build script.
245 confSONAME          [empty]             ld flag for recording the shared object
246                                         name into shared object.
247 confSTDIR           /etc/mail           The directory in which to store the
248                                         sendmail statistics file.
249 confSTFILE          statistics          Name of the installed statistics file.
250 confSTMODE          0600                Mode of the installed statistics file.
251 confSTRIP           strip               What program to use for stripping
252                                         executables.
253 confSTRIPOPTS       [empty]             Options to pass to the strip program.
254 confUBINDIR         /usr/bin            The directory for user-executable
255                                         binaries.
256 confUBINGRP         bin                 The group for user-executable binaries.
257 confUBINMODE        555                 The mode for user-executable binaries.
258 confUBINOWN         bin                 The owner for user-executable binaries.
259
260 There are also program specific variables for each of the programs
261 in the sendmail distribution.  Each has the form `conf_prog_ENVDEF',
262 for example, `conf_sendmail_ENVDEF'.  If the program name contains
263 a '.' it must be replaced by '_' first, e.g., use `conf_mail_local_LIBS'
264 instead of `conf_mail.local_LIBS'.  The variables are:
265
266 conf_prog_ENVDEF    [empty]             -D flags passed to C compiler when
267                                         compiling prog.
268 conf_prog_LIB_POST  [empty]             -l flags passed to ld when linking
269                                         prog (after other libraries).
270 conf_prog_LIBS      [varies]            -l flags passed to ld when linking
271                                         prog (before other libraries).
272 conf_prog_OBJADD    [empty]             Additional object files given to ld
273                                         when linking prog.
274 conf_prog_SRCADD    [empty]             C source files to compile and link
275                                         for prog.
276
277 The order of the different conf*LIBS* is as follows:
278 conf_prog_LIBS confLIBS conf_prog_LIB_POST
279
280 ----------------------------------------------------------------
281
282 ----------------
283 New build system
284 ----------------
285
286 Sendmail's build system has undergone some rearrangement to accommodate
287 future development.  To the end user building sendmail from a distribution,
288 this should have little effect.  All the same configuration files and macros
289 should still behave the same.
290
291 If you need to make some radical changes to a Makefile.m4 or are adding new
292 libraries or utilities, you may want to read the rest of this document on
293 how to work with the new system.
294
295
296 --------
297 Overview
298 --------
299
300 The purpose of the redesign is twofold.  First, it cuts down massively on
301 replicated information.  Second, the new design should lend itself better to
302 working on platforms with somewhat different build tools than on standard
303 unix.
304
305 The main idea is to have the Makefile.m4 in each subdirectory contain the
306 minimum amount of information needed to describe the elements needed for
307 the build process and the products produced.
308
309 Each product has a type and each type has a template that provides a basic
310 makefile for that type.  Right now the templates are organized by the broad
311 type of the operating system. The two existing types are UNIX and NT.
312
313
314 ------------------
315 Makefile.m4 basics
316 ------------------
317
318 Each Makefile.m4 is split into separate products.  For the most part, the
319 products are considered totally separate from other products in the
320 Makefile.m4.  Each products is delineated by two macros: bldPRODUCT_START and
321 bldPRODUCT_END.
322
323 The form for bldPRODUCT_START is:
324 bldPRODUCT_START(<product_type>, <product_name>)
325 where <product_type> is the type of product to be produced (e.g., executable,
326 library, manpage) and <product_name> is a unique identifier within the
327 product_type name space for this Makefile.m4
328
329 The form for bldPRODUCT_END is:
330 bldPRODUCT_END
331
332 This is marks the end of all the information for the current product.
333
334 There is one other macro required in any Makefile.m4 and that is bldFINISH
335 which takes no arguments and must appear after all the products have been
336 defined.
337
338 When the actual makefile is generated each product appears in two sections.
339 The first is where makefile variables are set (e.g., CFLAGS=-O).  The second
340 is where the targets appear (e.g., foo.o: foo.c).  Anything diverted to
341 bldTARGETS_SECTION ends up in the second part of the makefile.  Anything
342 else turns up in the header part where variables are defined.
343
344 As always, any straight text put into Makefile.m4 will just show up as is
345 in the finished makefile.
346
347
348 -------------
349 Product Types
350 -------------
351
352 executable
353 ----------
354
355 This means an executable created from C sources.  The name of the executable
356 is derived from the product_name in the bldPRODUCT_START macro.
357
358 bldSOURCES - This should be defined to a space separated list of source
359 files that make up the executable.
360
361 bldBIN_TYPE - This determines where the binaries will be installed and what
362 permissions they will have.  Available types are `M', `U', `K', `S', and `E'.
363 See M4/UNIX/make/executable.m4 for what the different types mean.
364
365 bldTARGET_LINKS - This determines where additional symbolic links to the
366 executable are placed.  These should be full pathnames, separated by
367 spaces.
368
369
370 test
371 ----
372
373 This is just like 'executable', but is used for test programs.
374 The program cannot be installed.  Each time it is built, it is executed
375 by make with no arguments.
376
377
378 manpage
379 -------
380
381 This builds manpages from source using *roff.
382
383 bldSOURCES - This should be defined to a space separated list of man source
384 files.
385
386
387 library
388 -------
389
390 This builds a static library from C sources.
391
392 bldSOURCES - This should be defined to a space separated list of C source
393 files that make up the library.
394
395 bldINSTALLABLE - This should be set if the library should be installed in
396 confLIBDIR.
397
398 $Revision: 8.103 $, Last updated $Date: 2009/01/22 02:15:07 $