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