190792Sgshapiro/*
2132943Sgshapiro * Copyright (c) 2000-2003 Sendmail, Inc. and its suppliers.
390792Sgshapiro *	All rights reserved.
490792Sgshapiro *
590792Sgshapiro * By using this file, you agree to the terms and conditions set
690792Sgshapiro * forth in the LICENSE file which can be found at the top level of
790792Sgshapiro * the sendmail distribution.
890792Sgshapiro *
9249729Sgshapiro *	$Id: config.h,v 1.48 2013/03/22 22:48:57 gshapiro Exp $
1090792Sgshapiro */
1190792Sgshapiro
1290792Sgshapiro/*
1390792Sgshapiro**  libsm configuration macros.
1490792Sgshapiro**  The values of these macros are platform dependent.
1590792Sgshapiro**  The default values are given here.
1690792Sgshapiro**  If the default is incorrect, then the correct value can be specified
1790792Sgshapiro**  in the m4 configuration file in devtools/OS.
1890792Sgshapiro*/
1990792Sgshapiro
2090792Sgshapiro#ifndef SM_CONFIG_H
2190792Sgshapiro# define SM_CONFIG_H
2290792Sgshapiro
2390792Sgshapiro#  include "sm_os.h"
2490792Sgshapiro
2590792Sgshapiro/*
2690792Sgshapiro**  SM_CONF_STDBOOL_H is 1 if <stdbool.h> exists
27249729Sgshapiro**
28249729Sgshapiro**  Note, unlike gcc, clang doesn't apply full prototypes to K&R definitions.
2990792Sgshapiro*/
3090792Sgshapiro
3190792Sgshapiro# ifndef SM_CONF_STDBOOL_H
32249729Sgshapiro#  if !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
3390792Sgshapiro#   define SM_CONF_STDBOOL_H		1
34249729Sgshapiro#  else /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
3590792Sgshapiro#   define SM_CONF_STDBOOL_H		0
36249729Sgshapiro#  endif /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
3790792Sgshapiro# endif /* ! SM_CONF_STDBOOL_H */
3890792Sgshapiro
3990792Sgshapiro/*
4090792Sgshapiro**  Configuration macros that specify how __P is defined.
4190792Sgshapiro*/
4290792Sgshapiro
4390792Sgshapiro# ifndef SM_CONF_SYS_CDEFS_H
4490792Sgshapiro#  define SM_CONF_SYS_CDEFS_H		0
4590792Sgshapiro# endif /* ! SM_CONF_SYS_CDEFS_H */
4690792Sgshapiro
4790792Sgshapiro/*
4890792Sgshapiro**  SM_CONF_STDDEF_H is 1 if <stddef.h> exists
4990792Sgshapiro*/
5090792Sgshapiro
5190792Sgshapiro# ifndef SM_CONF_STDDEF_H
5290792Sgshapiro#  define SM_CONF_STDDEF_H		1
5390792Sgshapiro# endif /* ! SM_CONF_STDDEF_H */
5490792Sgshapiro
5590792Sgshapiro/*
5690792Sgshapiro**  Configuration macro that specifies whether strlcpy/strlcat are available.
5790792Sgshapiro**  Note: this is the default so that the libsm version (optimized) will
5890792Sgshapiro**  be used by default (sm_strlcpy/sm_strlcat).
5990792Sgshapiro*/
6090792Sgshapiro
6190792Sgshapiro# ifndef SM_CONF_STRL
6290792Sgshapiro#  define SM_CONF_STRL			0
6390792Sgshapiro# endif /* ! SM_CONF_STRL */
6490792Sgshapiro
6590792Sgshapiro/*
6690792Sgshapiro**  Configuration macro indicating that setitimer is available
6790792Sgshapiro*/
6890792Sgshapiro
6990792Sgshapiro# ifndef SM_CONF_SETITIMER
7090792Sgshapiro#  define SM_CONF_SETITIMER		1
7190792Sgshapiro# endif /* ! SM_CONF_SETITIMER */
7290792Sgshapiro
7390792Sgshapiro/*
7490792Sgshapiro**  Does <sys/types.h> define uid_t and gid_t?
7590792Sgshapiro*/
7690792Sgshapiro
7790792Sgshapiro# ifndef SM_CONF_UID_GID
7890792Sgshapiro#  define SM_CONF_UID_GID		1
7990792Sgshapiro# endif /* ! SM_CONF_UID_GID */
8090792Sgshapiro
8190792Sgshapiro/*
8290792Sgshapiro**  Does <sys/types.h> define ssize_t?
8390792Sgshapiro*/
8490792Sgshapiro# ifndef SM_CONF_SSIZE_T
8590792Sgshapiro#  define SM_CONF_SSIZE_T		1
8690792Sgshapiro# endif /* ! SM_CONF_SSIZE_T */
8790792Sgshapiro
8890792Sgshapiro/*
8990792Sgshapiro**  Does the C compiler support long long?
9090792Sgshapiro*/
9190792Sgshapiro
9290792Sgshapiro# ifndef SM_CONF_LONGLONG
9390792Sgshapiro#  if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
9490792Sgshapiro#   define SM_CONF_LONGLONG		1
9590792Sgshapiro#  else /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
9690792Sgshapiro#   if defined(__GNUC__)
9790792Sgshapiro#    define SM_CONF_LONGLONG		1
9890792Sgshapiro#   else /* defined(__GNUC__) */
9990792Sgshapiro#    define SM_CONF_LONGLONG		0
10090792Sgshapiro#   endif /* defined(__GNUC__) */
10190792Sgshapiro#  endif /* defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */
10290792Sgshapiro# endif /* ! SM_CONF_LONGLONG */
10390792Sgshapiro
10490792Sgshapiro/*
10590792Sgshapiro**  Does <sys/types.h> define quad_t and u_quad_t?
10690792Sgshapiro**  We only care if long long is not available.
10790792Sgshapiro*/
10890792Sgshapiro
10990792Sgshapiro# ifndef SM_CONF_QUAD_T
11090792Sgshapiro#  define SM_CONF_QUAD_T		0
11190792Sgshapiro# endif /* ! SM_CONF_QUAD_T */
11290792Sgshapiro
11390792Sgshapiro/*
11490792Sgshapiro**  Configuration macro indicating that shared memory is available
11590792Sgshapiro*/
11690792Sgshapiro
11790792Sgshapiro# ifndef SM_CONF_SHM
11890792Sgshapiro#  define SM_CONF_SHM		0
11990792Sgshapiro# endif /* ! SM_CONF_SHM */
12090792Sgshapiro
12190792Sgshapiro/*
12290792Sgshapiro**  Does <setjmp.h> define sigsetjmp?
12390792Sgshapiro*/
12490792Sgshapiro
12590792Sgshapiro# ifndef SM_CONF_SIGSETJMP
12690792Sgshapiro#  define SM_CONF_SIGSETJMP	1
12790792Sgshapiro# endif /* ! SM_CONF_SIGSETJMP */
12890792Sgshapiro
12990792Sgshapiro/*
13090792Sgshapiro**  Does <sysexits.h> exist, and define the EX_* macros with values
13190792Sgshapiro**  that differ from the default BSD values in <sm/sysexits.h>?
13290792Sgshapiro*/
13390792Sgshapiro
13490792Sgshapiro# ifndef SM_CONF_SYSEXITS_H
13590792Sgshapiro#  define SM_CONF_SYSEXITS_H	0
13690792Sgshapiro# endif /* ! SM_CONF_SYSEXITS_H */
13790792Sgshapiro
13890792Sgshapiro/* has memchr() prototype? (if not: needs memory.h) */
13990792Sgshapiro# ifndef SM_CONF_MEMCHR
14090792Sgshapiro#  define SM_CONF_MEMCHR	1
14190792Sgshapiro# endif /* ! SM_CONF_MEMCHR */
14290792Sgshapiro
14390792Sgshapiro/* try LLONG tests in libsm/t-types.c? */
14490792Sgshapiro# ifndef SM_CONF_TEST_LLONG
14590792Sgshapiro#  define SM_CONF_TEST_LLONG	1
14690792Sgshapiro# endif /* !SM_CONF_TEST_LLONG */
14790792Sgshapiro
148132943Sgshapiro/* LDAP Checks */
149132943Sgshapiro# if LDAPMAP
150141858Sgshapiro#  include <lber.h>
151132943Sgshapiro#  include <ldap.h>
15294334Sgshapiro
153132943Sgshapiro/* Does the LDAP library have ldap_memfree()? */
154132943Sgshapiro#  ifndef SM_CONF_LDAP_MEMFREE
155132943Sgshapiro
15694334Sgshapiro/*
15794334Sgshapiro**  The new LDAP C API (draft-ietf-ldapext-ldap-c-api-04.txt) includes
15894334Sgshapiro**  ldap_memfree() in the API.  That draft states to use LDAP_API_VERSION
15994334Sgshapiro**  of 2004 to identify the API.
16094334Sgshapiro*/
16194334Sgshapiro
162132943Sgshapiro#   if USING_NETSCAPE_LDAP || LDAP_API_VERSION >= 2004
163132943Sgshapiro#    define SM_CONF_LDAP_MEMFREE	1
164132943Sgshapiro#   else /* USING_NETSCAPE_LDAP || LDAP_API_VERSION >= 2004 */
165132943Sgshapiro#    define SM_CONF_LDAP_MEMFREE	0
166132943Sgshapiro#   endif /* USING_NETSCAPE_LDAP || LDAP_API_VERSION >= 2004 */
167132943Sgshapiro#  endif /* ! SM_CONF_LDAP_MEMFREE */
16894334Sgshapiro
169132943Sgshapiro/* Does the LDAP library have ldap_initialize()? */
170132943Sgshapiro#  ifndef SM_CONF_LDAP_INITIALIZE
171132943Sgshapiro
172132943Sgshapiro/*
173132943Sgshapiro**  Check for ldap_initialize() support for support for LDAP URI's with
174132943Sgshapiro**  non-ldap:// schemes.
175132943Sgshapiro*/
176132943Sgshapiro
177132943Sgshapiro/* OpenLDAP does it with LDAP_OPT_URI */
178132943Sgshapiro#   ifdef LDAP_OPT_URI
179132943Sgshapiro#    define SM_CONF_LDAP_INITIALIZE	1
180132943Sgshapiro#   endif /* LDAP_OPT_URI */
181132943Sgshapiro#  endif /* !SM_CONF_LDAP_INITIALIZE */
182132943Sgshapiro# endif /* LDAPMAP */
183132943Sgshapiro
184132943Sgshapiro/* don't use strcpy() */
185132943Sgshapiro# ifndef DO_NOT_USE_STRCPY
186132943Sgshapiro#  define DO_NOT_USE_STRCPY	1
187132943Sgshapiro# endif /* ! DO_NOT_USE_STRCPY */
188132943Sgshapiro
18990792Sgshapiro#endif /* ! SM_CONFIG_H */
190