xref: /freebsd/contrib/sendmail/include/sm/config.h (revision 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3)
1 /*
2  * Copyright (c) 2000-2003 Proofpoint, 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.49 2013-11-22 20:51:31 ca 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 **  Note, unlike gcc, clang doesn't apply full prototypes to K&R definitions.
29 */
30 
31 # ifndef SM_CONF_STDBOOL_H
32 #  if !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
33 #   define SM_CONF_STDBOOL_H		1
34 #  else
35 #   define SM_CONF_STDBOOL_H		0
36 #  endif
37 # endif /* ! SM_CONF_STDBOOL_H */
38 
39 /*
40 **  Configuration macros that specify how __P is defined.
41 */
42 
43 # ifndef SM_CONF_SYS_CDEFS_H
44 #  define SM_CONF_SYS_CDEFS_H		0
45 # endif
46 
47 /*
48 **  SM_CONF_STDDEF_H is 1 if <stddef.h> exists
49 */
50 
51 # ifndef SM_CONF_STDDEF_H
52 #  define SM_CONF_STDDEF_H		1
53 # endif
54 
55 /*
56 **  Configuration macro that specifies whether strlcpy/strlcat are available.
57 **  Note: this is the default so that the libsm version (optimized) will
58 **  be used by default (sm_strlcpy/sm_strlcat).
59 */
60 
61 # ifndef SM_CONF_STRL
62 #  define SM_CONF_STRL			0
63 # endif
64 
65 /*
66 **  Configuration macro indicating that setitimer is available
67 */
68 
69 # ifndef SM_CONF_SETITIMER
70 #  define SM_CONF_SETITIMER		1
71 # endif
72 
73 /*
74 **  Does <sys/types.h> define uid_t and gid_t?
75 */
76 
77 # ifndef SM_CONF_UID_GID
78 #  define SM_CONF_UID_GID		1
79 # endif
80 
81 /*
82 **  Does <sys/types.h> define ssize_t?
83 */
84 # ifndef SM_CONF_SSIZE_T
85 #  define SM_CONF_SSIZE_T		1
86 # endif
87 
88 /*
89 **  Does the C compiler support long long?
90 */
91 
92 # ifndef SM_CONF_LONGLONG
93 #  if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
94 #   define SM_CONF_LONGLONG		1
95 #  else /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
96 #   if defined(__GNUC__)
97 #    define SM_CONF_LONGLONG		1
98 #   else
99 #    define SM_CONF_LONGLONG		0
100 #   endif
101 #  endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
102 # endif /* ! SM_CONF_LONGLONG */
103 
104 /*
105 **  Does <sys/types.h> define quad_t and u_quad_t?
106 **  We only care if long long is not available.
107 */
108 
109 # ifndef SM_CONF_QUAD_T
110 #  define SM_CONF_QUAD_T		0
111 # endif
112 
113 /*
114 **  Configuration macro indicating that shared memory is available
115 */
116 
117 # ifndef SM_CONF_SHM
118 #  define SM_CONF_SHM		0
119 # endif
120 
121 /*
122 **  Does <setjmp.h> define sigsetjmp?
123 */
124 
125 # ifndef SM_CONF_SIGSETJMP
126 #  define SM_CONF_SIGSETJMP	1
127 # endif
128 
129 /*
130 **  Does <sysexits.h> exist, and define the EX_* macros with values
131 **  that differ from the default BSD values in <sm/sysexits.h>?
132 */
133 
134 # ifndef SM_CONF_SYSEXITS_H
135 #  define SM_CONF_SYSEXITS_H	0
136 # endif
137 
138 /* has memchr() prototype? (if not: needs memory.h) */
139 # ifndef SM_CONF_MEMCHR
140 #  define SM_CONF_MEMCHR	1
141 # endif
142 
143 /* try LLONG tests in libsm/t-types.c? */
144 # ifndef SM_CONF_TEST_LLONG
145 #  define SM_CONF_TEST_LLONG	1
146 # endif
147 
148 /* LDAP Checks */
149 # if LDAPMAP
150 #  include <lber.h>
151 #  include <ldap.h>
152 
153 /* Does the LDAP library have ldap_memfree()? */
154 #  ifndef SM_CONF_LDAP_MEMFREE
155 
156 /*
157 **  The new LDAP C API (draft-ietf-ldapext-ldap-c-api-04.txt) includes
158 **  ldap_memfree() in the API.  That draft states to use LDAP_API_VERSION
159 **  of 2004 to identify the API.
160 */
161 
162 #   if USING_NETSCAPE_LDAP || LDAP_API_VERSION >= 2004
163 #    define SM_CONF_LDAP_MEMFREE	1
164 #   else
165 #    define SM_CONF_LDAP_MEMFREE	0
166 #   endif
167 #  endif /* ! SM_CONF_LDAP_MEMFREE */
168 
169 /* Does the LDAP library have ldap_initialize()? */
170 #  ifndef SM_CONF_LDAP_INITIALIZE
171 
172 /*
173 **  Check for ldap_initialize() support for support for LDAP URI's with
174 **  non-ldap:// schemes.
175 */
176 
177 /* OpenLDAP does it with LDAP_OPT_URI */
178 #   ifdef LDAP_OPT_URI
179 #    define SM_CONF_LDAP_INITIALIZE	1
180 #   endif
181 #  endif /* !SM_CONF_LDAP_INITIALIZE */
182 # endif /* LDAPMAP */
183 
184 /* don't use strcpy() */
185 # ifndef DO_NOT_USE_STRCPY
186 #  define DO_NOT_USE_STRCPY	1
187 # endif
188 
189 #endif /* ! SM_CONFIG_H */
190