1261194Sgshapiro# Copyright (c) 2000-2002 Proofpoint, Inc. and its suppliers.
290792Sgshapiro#	All rights reserved.
390792Sgshapiro#
490792Sgshapiro# By using this file, you agree to the terms and conditions set
590792Sgshapiro# forth in the LICENSE file which can be found at the top level of
690792Sgshapiro# the sendmail distribution.
790792Sgshapiro#
8266527Sgshapiro#	$Id: README,v 1.25 2013-11-22 20:51:42 ca Exp $
990792Sgshapiro#
1090792Sgshapiro
1190792SgshapiroLibsm is a library of generally useful C abstractions.
1290792SgshapiroFor documentation, see index.html.
1390792Sgshapiro
1490792SgshapiroLibsm stands alone; it depends on no other sendmail libraries,
1590792Sgshapiroand the only sendmail header files it depends on are its own,
1690792Sgshapirowhich reside in ../include/sm.
1790792Sgshapiro
1890792SgshapiroThe t-*.c files are regression tests.
1990792SgshapiroThese tests are incomplete: we do not yet test all of the APIs,
2090792Sgshapiroand we have not yet converted all tests to use the test harness.
2190792SgshapiroIf a test fails read the explanation it generates.  Sometimes it
2290792Sgshapirois sufficient to change a compile time flag, which are also listed
2390792Sgshapirobelow.  If that does not help, check the sendmail/README files for
2490792Sgshapiroproblems on your OS.
2590792Sgshapiro
2690792SgshapiroThe b-*.c files are benchmarks that compare system routines with
2790792Sgshapirothose provided by libsm. By default sendmail uses the routines
2890792Sgshapiroprovided by the OS. In several cases, the routines provided by
2990792Sgshapirolibsm are faster than those of the OS. If your OS provides the
3090792Sgshapiroroutines, you can compare the performance of them with the libsm
3190792Sgshapiroversions by running the programs with the option -d (by default
3290792Sgshapirothe programs just issue an explanation when/how to use them).
3390792SgshapiroThe programs are:
3490792Sgshapiro
3590792Sgshapirob-strcmp.c	tests strcasecmp().
3690792Sgshapiro
3790792Sgshapiro+----------------------+
3890792Sgshapiro| CONFIGURATION MACROS |
3990792Sgshapiro+----------------------+
4090792Sgshapiro
4190792SgshapiroLibsm uses a set of C preprocessor macros to specify platform specific
4290792Sgshapirofeatures of the C compiler and standard C libraries.
4390792Sgshapiro
4490792SgshapiroIf you are porting sendmail to a new platform, you may need to tweak
4590792Sgshapirothe values of some of these macros.
4690792Sgshapiro
4790792SgshapiroThe following macros are given default values in <sm/config.h>.
4890792SgshapiroIf the default value is wrong for a given platform, then a platform
4990792Sgshapirospecific value is specified in one of two ways:
5090792Sgshapiro
5190792Sgshapiro  - A -D option is added to the confENVDEF macro; this change can be made
5290792Sgshapiro    to the platform M4 file in devtools/OS, or to the site.config.m4
5390792Sgshapiro    file in devtools/Site.
5490792Sgshapiro
5590792Sgshapiro  - The confSM_OS_HEADER macro in the platform M4 file defines sm_os_foo,
5690792Sgshapiro    which forces "sm/os/sm_os_foo.h" to be included by "sm/config.h" via a
5790792Sgshapiro    link that is made from "sm_os.h" to "sm/os/sm_os_foo.h".  Platform
5890792Sgshapiro    specific configuration macro settings are added to <sm/os/sm_os_foo.h>.
5990792Sgshapiro
6090792SgshapiroSM_CONF_STDBOOL_H
6190792Sgshapiro	Set to 1 if the header file <stdbool.h> exists,
6290792Sgshapiro	and defines true, false and bool.
6390792Sgshapiro
6490792SgshapiroSM_CONF_SYS_CDEFS_H
6590792Sgshapiro	Set to 1 if the header file <sys/cdefs.h> exists,
6690792Sgshapiro	and defines __P.  You may need to do this to eliminate
6790792Sgshapiro	warnings about __P being multiply defined.
6890792Sgshapiro
6990792SgshapiroSM_CONF_STDDEF_H
7090792Sgshapiro	Set to 0 if the header file <stddef.h> does not exist.
7190792Sgshapiro
7290792SgshapiroSM_CONF_SETITIMER
7390792Sgshapiro	Set to 0 if the setitimer function is not available.
7490792Sgshapiro
7590792SgshapiroSM_CONF_SYSEXITS_H
7690792Sgshapiro	Set to 1 if <sysexits.h> exists, and sets the EX_* macros
7790792Sgshapiro	to values different from the default BSD values in <sm/sysexits.h>.
7890792Sgshapiro
7990792SgshapiroSM_CONF_UID_GID
8090792Sgshapiro	Set to 0 if <sys/types.h> does not define uid_t and gid_t.
8190792Sgshapiro
8290792SgshapiroSM_CONF_SSIZE_T
8390792Sgshapiro	Set to 0 if <sys/types.h> does not define ssize_t.
8490792Sgshapiro
8590792SgshapiroSM_CONF_BROKEN_SIZE_T
8690792Sgshapiro	Set to 1 if size_t is not unsigned.
8790792Sgshapiro
8890792SgshapiroSM_CONF_LONGLONG
8990792Sgshapiro	Set to 1 if your C compiler supports the 'long long' type.
9090792Sgshapiro	This will be set automatically if you use gcc or a C compiler
9190792Sgshapiro	that conforms to the 1999 ISO C standard.
9290792Sgshapiro
9390792SgshapiroSM_CONF_QUAD_T
9490792Sgshapiro	Set to 1 if your C compiler does not support 'long long',
9590792Sgshapiro	but <sys/types.h> defines quad_t as an integral type.
9690792Sgshapiro
9790792SgshapiroSM_CONF_SHM
9890792Sgshapiro	Set to 1 if System V shared memory APIs are available.
9990792Sgshapiro
10090792SgshapiroSM_CONF_MSG
10190792Sgshapiro	Set to 1 if System V message queues are available.
10290792Sgshapiro
10390792SgshapiroSM_CONF_SEM
10490792Sgshapiro	Set to 1 if semaphores are available.
10590792Sgshapiro
10690792SgshapiroSM_CONF_BROKEN_STRTOD
10790792Sgshapiro	Set to 1 if your strtod() does not work properly.
10890792Sgshapiro
10990792SgshapiroSM_CONF_GETOPT
11090792Sgshapiro	Set to 1 if your operating system does not include getopt(3).
11190792Sgshapiro
112132943SgshapiroSM_CONF_LDAP_INITIALIZE
113132943Sgshapiro	Set to 1 if your LDAP client libraries include ldap_initialize(3).
114132943Sgshapiro
11594334SgshapiroSM_CONF_LDAP_MEMFREE
11694334Sgshapiro	Set to 1 if your LDAP client libraries include ldap_memfree(3).
11794334Sgshapiro
11890792SgshapiroSM_IO_MAX_BUF_FILE
11990792Sgshapiro	Set this to a useful buffer size for regular files if stat(2)
12090792Sgshapiro	does not return a value for st_blksize that is the
12190792Sgshapiro	"optimal blocksize for I/O".
12290792Sgshapiro
12390792SgshapiroSM_IO_MAX_BUF
12490792Sgshapiro	Set this to a useful maximum buffer size for other than
12590792Sgshapiro	regular files if stat(2) does not return a value for
12690792Sgshapiro	st_blksize that is the "optimal blocksize for I/O".
12790792Sgshapiro
12890792SgshapiroSM_IO_MIN_BUF
12990792Sgshapiro	Set this to a useful minimum buffer size for other than
13090792Sgshapiro	regular files if stat(2) does not return a value for
13190792Sgshapiro	st_blksize that is the "optimal blocksize for I/O".
13290792Sgshapiro
133