4
AC_CONFIG_AUX_DIR(config)
7
dnl Should we enable SASLAUTHd at all?
8
AC_ARG_WITH(saslauthd, [ --with-saslauthd=DIR enable use of the saslauth daemon using state dir DIR ],
9
with_saslauthd=$withval,
11
if test "$with_saslauthd" = yes; then
12
with_saslauthd="/var/state/saslauthd"
14
AC_DEFINE(HAVE_SASLAUTHD,[],[Include support for saslauthd?])
15
AC_DEFINE_UNQUOTED(PATH_SASLAUTHD_RUNDIR, "$with_saslauthd",[Location of saslauthd socket])
16
AM_CONDITIONAL(SASLAUTHD, test "$with_saslauthd" != no)
18
AM_INIT_AUTOMAKE(saslauthd,2.1.24)
21
dnl Checks for programs.
30
dnl Checks for build foo
32
CMU_GUESS_RUNPATH_SWITCH
34
dnl Checks for libraries.
38
AC_MSG_CHECKING(for OpenSSL)
39
AC_MSG_RESULT($with_openssl)
43
dnl mechanism-related checking
47
if test "$gssapi" != no; then
48
if test "$gss_impl" = "heimdal"; then
49
AC_DEFINE(KRB5_HEIMDAL,[],[Using Heimdal])
51
AC_DEFINE(HAVE_GSSAPI,[],[Include GSSAPI/Kerberos 5 Support])
56
AC_ARG_ENABLE(sia, [ --enable-sia enable SIA authentication [no] ],
60
if test "$sia" != no; then
61
if test -f /etc/sia/matrix.conf; then
62
AC_DEFINE(HAVE_SIA,[],[Include SIA Support])
63
LIB_SIA="-lsecurity -ldb -lm -laud"
65
AC_ERROR([No support for SIA found])
70
AC_ARG_ENABLE(auth-sasldb, [ --enable-auth-sasldb enable experimental SASLdb authentication module [no] ],
71
authsasldb=$enableval,
73
if test "$authsasldb" != no; then
74
if test ! -d "../sasldb"; then
75
echo "ERROR: Cannot build sasldb module outside of the full SASL source tree."
78
AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support])
81
SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.a"
84
AC_ARG_ENABLE(httpform, [ --enable-httpform enable HTTP form authentication [[no]] ],
87
if test "$httpform" != no; then
88
AC_DEFINE(HAVE_HTTPFORM,[],[Include HTTP form Support])
91
AC_ARG_WITH(pam, [ --with-pam=DIR use PAM (rooted in DIR) [yes] ],
94
if test "$with_pam" != no; then
95
if test -d $with_pam; then
96
CPPFLAGS="$CPPFLAGS -I${with_pam}/include"
97
LDFLAGS="$LDFLAGS -L${with_pam}/lib"
100
AC_CHECK_LIB(pam, pam_start, [
101
AC_CHECK_HEADER(security/pam_appl.h,,
103
with_pam=no, $SASL_DL_LIB)
104
LIBS="$cmu_save_LIBS"
107
AC_ARG_WITH(ipctype, [ --with-ipctype={unix,doors} use ipctype [unix] ],
108
with_ipctype=$withval,
110
MAIN_COMPAT_OBJ="saslauthd-${with_ipctype}.o"
111
AC_SUBST(MAIN_COMPAT_OBJ)
112
if test "$with_ipctype" = "doors"; then
113
AC_DEFINE(USE_DOORS,[],[Use the doors IPC API])
114
AC_DEFINE(SASLAUTHD_THREADED,[],[Saslauthd runs threaded?])
115
LIBS="$LIBS -ldoor -lpthread"
118
AC_MSG_CHECKING(for PAM support)
119
AC_MSG_RESULT($with_pam)
121
if test "$with_pam" != no; then
122
AC_DEFINE(HAVE_PAM,[],[Support for PAM?])
127
AC_CHECK_LIB(resolv, inet_aton)
129
AC_MSG_CHECKING(to include LDAP support)
130
AC_ARG_WITH(ldap, [ --with-ldap=DIR use LDAP (in DIR) [no] ],
133
AC_MSG_RESULT($with_ldap)
135
if test -d $with_ldap; then
136
CPPFLAGS="$CPPFLAGS -I${with_ldap}/include"
137
CMU_ADD_LIBPATH(${with_ldap}/lib)
141
if test "$with_ldap" != no; then
142
AC_CHECK_LIB(ldap, ldap_initialize, [ AC_DEFINE(HAVE_LDAP,[],[Support for LDAP?])
143
LDAP_LIBS="-lldap -llber"
144
if test "$with_openssl" != "no"; then
145
LDAP_LIBS="$LDAP_LIBS -lcrypto $LIB_RSAREF"
152
dnl Checks for header files.
156
AC_CHECK_HEADERS(crypt.h fcntl.h krb5.h strings.h syslog.h unistd.h sys/time.h sys/uio.h)
158
dnl Checks for typedefs, structures, and compiler characteristics.
162
LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
165
dnl Checks for which function macros exist
166
AC_MSG_CHECKING(whether $CC implements __func__)
167
AC_CACHE_VAL(have_func,
168
[AC_TRY_LINK([#include <stdio.h>],[printf("%s", __func__);],
171
AC_MSG_RESULT($have_func)
172
if test "$have_func" = yes; then
173
AC_DEFINE(HAVE_FUNC,[],[Does the compiler understand __func__])
175
AC_MSG_CHECKING(whether $CC implements __PRETTY_FUNCTION__)
176
AC_CACHE_VAL(have_pretty_function,
177
[AC_TRY_LINK([#include <stdio.h>],[printf("%s", __PRETTY_FUNCTION__);],
178
have_pretty_function=yes,
179
have_pretty_function=no)])
180
AC_MSG_RESULT($have_pretty_function)
181
if test "$have_pretty_function" = yes; then
182
AC_DEFINE(HAVE_PRETTY_FUNCTION,[],[Does compiler understand __PRETTY_FUNCTION__])
184
AC_MSG_CHECKING(whether $CC implements __FUNCTION__)
185
AC_CACHE_VAL(have_function,
186
[AC_TRY_LINK([#include <stdio.h>],[printf("%s", __FUNCTION__);],
189
AC_MSG_RESULT($have_function)
190
if test "$have_function" = yes; then
191
AC_DEFINE(HAVE_FUNCTION,[],[Does compiler understand __FUNCTION__])
196
dnl Checks for library functions.
198
AC_CHECK_FUNCS(gethostname mkdir socket strdup)
199
AC_CHECK_FUNCS(getspnam getuserpw, break)
200
AC_CHECK_FUNCS(strlcat strlcpy)
202
if test $ac_cv_func_getspnam = yes; then
203
AC_MSG_CHECKING(if getpwnam_r/getspnam_r take 5 arguments)
206
#include <sys/types.h>
214
(void) getpwnam_r("bin", &pwbuf, pwdata, sizeof(pwdata), &pw);
217
AC_DEFINE(GETXXNAM_R_5ARG, 1,
218
[Define if your getpwnam_r()/getspnam_r()
219
functions take 5 arguments])],
224
dnl Check for getaddrinfo
226
sasl_cv_getaddrinfo=no
227
IPv6_CHECK_FUNC(getaddrinfo,
228
[AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo() function?])], [sasl_cv_getaddrinfo=yes])
229
if test $sasl_cv_getaddrinfo = yes; then
230
AC_LIBOBJ(getaddrinfo)
233
dnl Check for getnameinfo
235
sasl_cv_getnameinfo=no
236
IPv6_CHECK_FUNC(getnameinfo,
237
[AC_DEFINE(HAVE_GETNAMEINFO,[],[Do we have a getnameinfo() function?])], [sasl_cv_getnameinfo=yes])
238
if test $sasl_cv_getnameinfo = yes; then
239
AC_LIBOBJ(getnameinfo)
242
IPv6_CHECK_SS_FAMILY()
244
IPv6_CHECK_SOCKLEN_T()
246
AC_EGREP_HEADER(sockaddr_storage, sys/socket.h,
247
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE,[],[Do we have a sockaddr_storage struct?]))
258
#ifndef HAVE___ATTRIBUTE__
259
/* Can't use attributes... */
260
#define __attribute__(foo)
264
#include <sys/types.h>
265
#include <sys/socket.h>
268
# include <sys/param.h>
270
# include <winsock2.h>
274
#include <netinet/in.h>
276
#ifndef HAVE_SOCKLEN_T
277
typedef unsigned int socklen_t;
278
#endif /* HAVE_SOCKLEN_T */
280
#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
281
#define _SS_MAXSIZE 128 /* Implementation specific max size */
282
#define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
284
struct sockaddr_storage {
285
struct sockaddr ss_sa;
286
char __ss_pad2[_SS_PADSIZE];
288
# define ss_family ss_sa.sa_family
289
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
292
/* Define it to something that should never appear */
293
#define AF_INET6 AF_MAX
296
/* Create a struct iovec if we need one */
297
#if !defined(HAVE_SYS_UIO_H)
303
#include <sys/types.h>
307
#ifndef HAVE_GETADDRINFO
308
#define getaddrinfo sasl_getaddrinfo
309
#define freeaddrinfo sasl_freeaddrinfo
310
#define getnameinfo sasl_getnameinfo
311
#define gai_strerror sasl_gai_strerror
315
#ifndef AI_NUMERICHOST /* support glibc 2.0.x */
316
#define AI_NUMERICHOST 4
317
#define NI_NUMERICHOST 2
318
#define NI_NAMEREQD 4
319
#define NI_NUMERICSERV 8
322
/* handy string manipulation functions */
324
extern size_t saslauthd_strlcpy(char *dst, const char *src, size_t len);
325
#define strlcpy(x,y,z) saslauthd_strlcpy((x),(y),(z))
328
extern size_t saslauthd_strlcat(char *dst, const char *src, size_t len);
329
#define strlcat(x,y,z) saslauthd_strlcat((x),(y),(z))
335
AC_CONFIG_HEADERS(saslauthd.h)