xref: /illumos-gate/usr/src/cmd/sendmail/include/sm/config.h (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
1 /*
2  * Copyright (c) 2000-2003 Sendmail, Inc. and its suppliers.
3  *	All rights reserved.
4  *
5  * By using this file, you agree to the terms and conditions set
6  * forth in the LICENSE file which can be found at the top level of
7  * the sendmail distribution.
8  *
9  *	$Id: config.h,v 1.47 2004/10/26 21:41:07 gshapiro Exp $
10  */
11 
12 /*
13 **  libsm configuration macros.
14 **  The values of these macros are platform dependent.
15 **  The default values are given here.
16 **  If the default is incorrect, then the correct value can be specified
17 **  in the m4 configuration file in devtools/OS.
18 */
19 
20 #ifndef SM_CONFIG_H
21 # define SM_CONFIG_H
22 
23 #  include "sm_os.h"
24 
25 /*
26 **  SM_CONF_STDBOOL_H is 1 if <stdbool.h> exists
27 */
28 
29 # ifndef SM_CONF_STDBOOL_H
30 #  if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
31 #   define SM_CONF_STDBOOL_H		1
32 #  else /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
33 #   define SM_CONF_STDBOOL_H		0
34 #  endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
35 # endif /* ! SM_CONF_STDBOOL_H */
36 
37 /*
38 **  Configuration macros that specify how __P is defined.
39 */
40 
41 # ifndef SM_CONF_SYS_CDEFS_H
42 #  define SM_CONF_SYS_CDEFS_H		0
43 # endif /* ! SM_CONF_SYS_CDEFS_H */
44 
45 /*
46 **  SM_CONF_STDDEF_H is 1 if <stddef.h> exists
47 */
48 
49 # ifndef SM_CONF_STDDEF_H
50 #  define SM_CONF_STDDEF_H		1
51 # endif /* ! SM_CONF_STDDEF_H */
52 
53 /*
54 **  Configuration macro that specifies whether strlcpy/strlcat are available.
55 **  Note: this is the default so that the libsm version (optimized) will
56 **  be used by default (sm_strlcpy/sm_strlcat).
57 */
58 
59 # ifndef SM_CONF_STRL
60 #  define SM_CONF_STRL			0
61 # endif /* ! SM_CONF_STRL */
62 
63 /*
64 **  Configuration macro indicating that setitimer is available
65 */
66 
67 # ifndef SM_CONF_SETITIMER
68 #  define SM_CONF_SETITIMER		1
69 # endif /* ! SM_CONF_SETITIMER */
70 
71 /*
72 **  Does <sys/types.h> define uid_t and gid_t?
73 */
74 
75 # ifndef SM_CONF_UID_GID
76 #  define SM_CONF_UID_GID		1
77 # endif /* ! SM_CONF_UID_GID */
78 
79 /*
80 **  Does <sys/types.h> define ssize_t?
81 */
82 # ifndef SM_CONF_SSIZE_T
83 #  define SM_CONF_SSIZE_T		1
84 # endif /* ! SM_CONF_SSIZE_T */
85 
86 /*
87 **  Does the C compiler support long long?
88 */
89 
90 # ifndef SM_CONF_LONGLONG
91 #  if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
92 #   define SM_CONF_LONGLONG		1
93 #  else /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
94 #   if defined(__GNUC__)
95 #    define SM_CONF_LONGLONG		1
96 #   else /* defined(__GNUC__) */
97 #    define SM_CONF_LONGLONG		0
98 #   endif /* defined(__GNUC__) */
99 #  endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
100 # endif /* ! SM_CONF_LONGLONG */
101 
102 /*
103 **  Does <sys/types.h> define quad_t and u_quad_t?
104 **  We only care if long long is not available.
105 */
106 
107 # ifndef SM_CONF_QUAD_T
108 #  define SM_CONF_QUAD_T		0
109 # endif /* ! SM_CONF_QUAD_T */
110 
111 /*
112 **  Configuration macro indicating that shared memory is available
113 */
114 
115 # ifndef SM_CONF_SHM
116 #  define SM_CONF_SHM		0
117 # endif /* ! SM_CONF_SHM */
118 
119 /*
120 **  Does <setjmp.h> define sigsetjmp?
121 */
122 
123 # ifndef SM_CONF_SIGSETJMP
124 #  define SM_CONF_SIGSETJMP	1
125 # endif /* ! SM_CONF_SIGSETJMP */
126 
127 /*
128 **  Does <sysexits.h> exist, and define the EX_* macros with values
129 **  that differ from the default BSD values in <sm/sysexits.h>?
130 */
131 
132 # ifndef SM_CONF_SYSEXITS_H
133 #  define SM_CONF_SYSEXITS_H	0
134 # endif /* ! SM_CONF_SYSEXITS_H */
135 
136 /* has memchr() prototype? (if not: needs memory.h) */
137 # ifndef SM_CONF_MEMCHR
138 #  define SM_CONF_MEMCHR	1
139 # endif /* ! SM_CONF_MEMCHR */
140 
141 /* try LLONG tests in libsm/t-types.c? */
142 # ifndef SM_CONF_TEST_LLONG
143 #  define SM_CONF_TEST_LLONG	1
144 # endif /* !SM_CONF_TEST_LLONG */
145 
146 /* LDAP Checks */
147 # if LDAPMAP
148 #  include <lber.h>
149 #  include <ldap.h>
150 
151 /* Does the LDAP library have ldap_memfree()? */
152 #  ifndef SM_CONF_LDAP_MEMFREE
153 
154 /*
155 **  The new LDAP C API (draft-ietf-ldapext-ldap-c-api-04.txt) includes
156 **  ldap_memfree() in the API.  That draft states to use LDAP_API_VERSION
157 **  of 2004 to identify the API.
158 */
159 
160 #   if USING_NETSCAPE_LDAP || LDAP_API_VERSION >= 2004
161 #    define SM_CONF_LDAP_MEMFREE	1
162 #   else /* USING_NETSCAPE_LDAP || LDAP_API_VERSION >= 2004 */
163 #    define SM_CONF_LDAP_MEMFREE	0
164 #   endif /* USING_NETSCAPE_LDAP || LDAP_API_VERSION >= 2004 */
165 #  endif /* ! SM_CONF_LDAP_MEMFREE */
166 
167 /* Does the LDAP library have ldap_initialize()? */
168 #  ifndef SM_CONF_LDAP_INITIALIZE
169 
170 /*
171 **  Check for ldap_initialize() support for support for LDAP URI's with
172 **  non-ldap:// schemes.
173 */
174 
175 /* OpenLDAP does it with LDAP_OPT_URI */
176 #   ifdef LDAP_OPT_URI
177 #    define SM_CONF_LDAP_INITIALIZE	1
178 #   endif /* LDAP_OPT_URI */
179 #  endif /* !SM_CONF_LDAP_INITIALIZE */
180 # endif /* LDAPMAP */
181 
182 /* don't use strcpy() */
183 # ifndef DO_NOT_USE_STRCPY
184 #  define DO_NOT_USE_STRCPY	1
185 # endif /* ! DO_NOT_USE_STRCPY */
186 
187 #endif /* ! SM_CONFIG_H */
188