README revision 302408
154359Sroberto# Copyright (c) 2000-2002 Proofpoint, Inc. and its suppliers.
254359Sroberto#	All rights reserved.
354359Sroberto#
482498Sroberto# By using this file, you agree to the terms and conditions set
5200576Sroberto# forth in the LICENSE file which can be found at the top level of
6200576Sroberto# the sendmail distribution.
754359Sroberto#
882498Sroberto#	$Id: README,v 1.25 2013-11-22 20:51:42 ca Exp $
982498Sroberto#
1082498Sroberto
1182498SrobertoLibsm is a library of generally useful C abstractions.
1282498SrobertoFor documentation, see index.html.
13200576Sroberto
1482498SrobertoLibsm stands alone; it depends on no other sendmail libraries,
1582498Srobertoand the only sendmail header files it depends on are its own,
1682498Srobertowhich reside in ../include/sm.
1782498Sroberto
18132451SrobertoThe t-*.c files are regression tests.
19132451SrobertoThese tests are incomplete: we do not yet test all of the APIs,
20132451Srobertoand we have not yet converted all tests to use the test harness.
21285612SdelphijIf a test fails read the explanation it generates.  Sometimes it
22285612Sdelphijis sufficient to change a compile time flag, which are also listed
2382498Srobertobelow.  If that does not help, check the sendmail/README files for
2482498Srobertoproblems on your OS.
2582498Sroberto
2682498SrobertoThe b-*.c files are benchmarks that compare system routines with
2782498Srobertothose provided by libsm. By default sendmail uses the routines
2882498Srobertoprovided by the OS. In several cases, the routines provided by
2954359Srobertolibsm are faster than those of the OS. If your OS provides the
3054359Srobertoroutines, you can compare the performance of them with the libsm
3154359Srobertoversions by running the programs with the option -d (by default
3254359Srobertothe programs just issue an explanation when/how to use them).
33285612SdelphijThe programs are:
34285612Sdelphij
35285612Sdelphijb-strcmp.c	tests strcasecmp().
36285612Sdelphij
37285612Sdelphij+----------------------+
38285612Sdelphij| CONFIGURATION MACROS |
39285612Sdelphij+----------------------+
40285612Sdelphij
41285612SdelphijLibsm uses a set of C preprocessor macros to specify platform specific
4254359Srobertofeatures of the C compiler and standard C libraries.
43285612Sdelphij
44285612SdelphijIf you are porting sendmail to a new platform, you may need to tweak
45285612Sdelphijthe values of some of these macros.
4654359Sroberto
47285612SdelphijThe following macros are given default values in <sm/config.h>.
4854359SrobertoIf the default value is wrong for a given platform, then a platform
4954359Srobertospecific value is specified in one of two ways:
5054359Sroberto
5154359Sroberto  - A -D option is added to the confENVDEF macro; this change can be made
52285612Sdelphij    to the platform M4 file in devtools/OS, or to the site.config.m4
53285612Sdelphij    file in devtools/Site.
54285612Sdelphij
55285612Sdelphij  - The confSM_OS_HEADER macro in the platform M4 file defines sm_os_foo,
56285612Sdelphij    which forces "sm/os/sm_os_foo.h" to be included by "sm/config.h" via a
57182007Sroberto    link that is made from "sm_os.h" to "sm/os/sm_os_foo.h".  Platform
58285612Sdelphij    specific configuration macro settings are added to <sm/os/sm_os_foo.h>.
59285612Sdelphij
60285612SdelphijSM_CONF_STDBOOL_H
61285612Sdelphij	Set to 1 if the header file <stdbool.h> exists,
62285612Sdelphij	and defines true, false and bool.
63285612Sdelphij
64285612SdelphijSM_CONF_SYS_CDEFS_H
65285612Sdelphij	Set to 1 if the header file <sys/cdefs.h> exists,
66285612Sdelphij	and defines __P.  You may need to do this to eliminate
67285612Sdelphij	warnings about __P being multiply defined.
68285612Sdelphij
69285612SdelphijSM_CONF_STDDEF_H
70285612Sdelphij	Set to 0 if the header file <stddef.h> does not exist.
71285612Sdelphij
72285612SdelphijSM_CONF_SETITIMER
73285612Sdelphij	Set to 0 if the setitimer function is not available.
74285612Sdelphij
75285612SdelphijSM_CONF_SYSEXITS_H
76285612Sdelphij	Set to 1 if <sysexits.h> exists, and sets the EX_* macros
77285612Sdelphij	to values different from the default BSD values in <sm/sysexits.h>.
7854359Sroberto
79285612SdelphijSM_CONF_UID_GID
80285612Sdelphij	Set to 0 if <sys/types.h> does not define uid_t and gid_t.
81285612Sdelphij
8254359SrobertoSM_CONF_SSIZE_T
83285612Sdelphij	Set to 0 if <sys/types.h> does not define ssize_t.
84285612Sdelphij
8554359SrobertoSM_CONF_BROKEN_SIZE_T
8654359Sroberto	Set to 1 if size_t is not unsigned.
8754359Sroberto
8882498SrobertoSM_CONF_LONGLONG
8982498Sroberto	Set to 1 if your C compiler supports the 'long long' type.
9082498Sroberto	This will be set automatically if you use gcc or a C compiler
9182498Sroberto	that conforms to the 1999 ISO C standard.
9282498Sroberto
9382498SrobertoSM_CONF_QUAD_T
9482498Sroberto	Set to 1 if your C compiler does not support 'long long',
95132451Sroberto	but <sys/types.h> defines quad_t as an integral type.
9682498Sroberto
9782498SrobertoSM_CONF_SHM
9882498Sroberto	Set to 1 if System V shared memory APIs are available.
99182007Sroberto
100182007SrobertoSM_CONF_MSG
101182007Sroberto	Set to 1 if System V message queues are available.
102182007Sroberto
103182007SrobertoSM_CONF_SEM
104182007Sroberto	Set to 1 if semaphores are available.
105182007Sroberto
106182007SrobertoSM_CONF_BROKEN_STRTOD
107182007Sroberto	Set to 1 if your strtod() does not work properly.
108182007Sroberto
109182007SrobertoSM_CONF_GETOPT
110182007Sroberto	Set to 1 if your operating system does not include getopt(3).
11154359Sroberto
112285612SdelphijSM_CONF_LDAP_INITIALIZE
113285612Sdelphij	Set to 1 if your LDAP client libraries include ldap_initialize(3).
11454359Sroberto
115285612SdelphijSM_CONF_LDAP_MEMFREE
116285612Sdelphij	Set to 1 if your LDAP client libraries include ldap_memfree(3).
117285612Sdelphij
11854359SrobertoSM_IO_MAX_BUF_FILE
11954359Sroberto	Set this to a useful buffer size for regular files if stat(2)
120285612Sdelphij	does not return a value for st_blksize that is the
12154359Sroberto	"optimal blocksize for I/O".
12254359Sroberto
12354359SrobertoSM_IO_MAX_BUF
12454359Sroberto	Set this to a useful maximum buffer size for other than
12554359Sroberto	regular files if stat(2) does not return a value for
126200576Sroberto	st_blksize that is the "optimal blocksize for I/O".
12754359Sroberto
12854359SrobertoSM_IO_MIN_BUF
129200576Sroberto	Set this to a useful minimum buffer size for other than
130285612Sdelphij	regular files if stat(2) does not return a value for
131285612Sdelphij	st_blksize that is the "optimal blocksize for I/O".
132200576Sroberto
133285612Sdelphij