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