1 | AC_INIT(mechanisms.h) |
---|
2 | AC_CONFIG_AUX_DIR(config) |
---|
3 | AM_CONFIG_HEADER(saslauthd.h) |
---|
4 | AC_CANONICAL_HOST |
---|
5 | |
---|
6 | dnl Should we enable SASLAUTHd at all? |
---|
7 | AC_ARG_WITH(saslauthd, [ --with-saslauthd=DIR enable use of the saslauth daemon using state dir DIR ], |
---|
8 | with_saslauthd=$withval, |
---|
9 | with_saslauthd=yes) |
---|
10 | if test "$with_saslauthd" = yes; then |
---|
11 | with_saslauthd="/var/state/saslauthd" |
---|
12 | fi |
---|
13 | AC_DEFINE(HAVE_SASLAUTHD) |
---|
14 | AC_DEFINE_UNQUOTED(PATH_SASLAUTHD_RUNDIR, "$with_saslauthd") |
---|
15 | AM_CONDITIONAL(SASLAUTHD, test "$with_saslauthd" != no) |
---|
16 | |
---|
17 | AM_INIT_AUTOMAKE(saslauthd,2.1.12) |
---|
18 | CMU_INIT_AUTOMAKE |
---|
19 | |
---|
20 | dnl Checks for programs. |
---|
21 | AC_PROG_CC |
---|
22 | AC_PROG_CPP |
---|
23 | AC_PROG_AWK |
---|
24 | AC_PROG_MAKE_SET |
---|
25 | AC_PROG_LN_S |
---|
26 | AC_PROG_INSTALL |
---|
27 | |
---|
28 | dnl Checks for build foo |
---|
29 | CMU_C___ATTRIBUTE__ |
---|
30 | CMU_GUESS_RUNPATH_SWITCH |
---|
31 | |
---|
32 | dnl Checks for libraries. |
---|
33 | CMU_SOCKETS |
---|
34 | |
---|
35 | CMU_HAVE_OPENSSL |
---|
36 | AC_MSG_CHECKING(for OpenSSL) |
---|
37 | AC_MSG_RESULT($with_openssl) |
---|
38 | |
---|
39 | dnl mechanism-related checking |
---|
40 | SASL_KERBEROS_V4_CHK |
---|
41 | SASL_GSSAPI_CHK |
---|
42 | |
---|
43 | if test "$gssapi" != no; then |
---|
44 | AC_DEFINE(AUTH_KRB5) |
---|
45 | if test "$gss_impl" = "heimdal"; then |
---|
46 | AC_DEFINE(KRB5_HEIMDAL) |
---|
47 | fi |
---|
48 | fi |
---|
49 | |
---|
50 | SASL_CRYPT_CHK |
---|
51 | |
---|
52 | AC_ARG_ENABLE(sia, [ --enable-sia enable SIA authentication [no] ], |
---|
53 | sia=$enableval, |
---|
54 | sia=no) |
---|
55 | LIB_SIA="" |
---|
56 | if test "$sia" != no; then |
---|
57 | if test -f /etc/sia/matrix.conf; then |
---|
58 | AC_DEFINE(HAVE_SIA) |
---|
59 | LIB_SIA="-lsecurity -ldb -lm -laud" |
---|
60 | else |
---|
61 | AC_ERROR([No support for SIA found]) |
---|
62 | fi |
---|
63 | fi |
---|
64 | AC_SUBST(LIB_SIA) |
---|
65 | |
---|
66 | AC_ARG_ENABLE(auth-sasldb, [ --enable-auth-sasldb enable experimental SASLdb authentication module [no] ], |
---|
67 | authsasldb=$enableval, |
---|
68 | authsasldb=no) |
---|
69 | if test "$authsasldb" != no; then |
---|
70 | if test ! -d "../sasldb"; then |
---|
71 | echo "ERROR: Cannot build sasldb module outside of the full SASL source tree." |
---|
72 | exit 0; |
---|
73 | fi |
---|
74 | AC_DEFINE(AUTH_SASLDB) |
---|
75 | SASL_DB_PATH_CHECK() |
---|
76 | SASL_DB_CHECK() |
---|
77 | SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al" |
---|
78 | fi |
---|
79 | |
---|
80 | AC_ARG_WITH(pam, [ --with-pam=DIR use PAM (rooted in DIR) [yes] ], |
---|
81 | with_pam=$withval, |
---|
82 | with_pam=yes) |
---|
83 | if test "$with_pam" != no; then |
---|
84 | if test -d $with_pam; then |
---|
85 | CPPFLAGS="$CPPFLAGS -I${with_pam}/include" |
---|
86 | LDFLAGS="$LDFLAGS -L${with_pam}/lib" |
---|
87 | fi |
---|
88 | cmu_save_LIBS="$LIBS" |
---|
89 | AC_CHECK_LIB(pam, pam_start, [ |
---|
90 | AC_CHECK_HEADER(security/pam_appl.h,, |
---|
91 | with_pam=no)], |
---|
92 | with_pam=no, $SASL_DL_LIB) |
---|
93 | LIBS="$cmu_save_LIBS" |
---|
94 | fi |
---|
95 | |
---|
96 | AC_ARG_WITH(ipctype, [ --with-ipctype={unix,doors} use ipctype [unix] ], |
---|
97 | with_ipctype=$withval, |
---|
98 | with_ipctype="unix") |
---|
99 | MAIN_COMPAT_OBJ="saslauthd-${with_ipctype}.o" |
---|
100 | AC_SUBST(MAIN_COMPAT_OBJ) |
---|
101 | if test "$with_ipctype" = "doors"; then |
---|
102 | AC_DEFINE(USE_DOORS) |
---|
103 | AC_DEFINE(SASLAUTHD_THREADED) |
---|
104 | LIBS="$LIBS -ldoor -lpthread" |
---|
105 | fi |
---|
106 | |
---|
107 | AC_MSG_CHECKING(for PAM support) |
---|
108 | AC_MSG_RESULT($with_pam) |
---|
109 | LIB_PAM="" |
---|
110 | if test "$with_pam" != no; then |
---|
111 | AC_DEFINE(HAVE_PAM) |
---|
112 | LIB_PAM="-lpam" |
---|
113 | fi |
---|
114 | AC_SUBST(LIB_PAM) |
---|
115 | |
---|
116 | AC_CHECK_LIB(resolv, inet_aton) |
---|
117 | |
---|
118 | AC_MSG_CHECKING(to include experimental LDAP support) |
---|
119 | AC_ARG_WITH(ldap, [ --with-ldap=DIR use LDAP (in DIR) (experimental) [no] ], |
---|
120 | with_ldap=$withval, |
---|
121 | with_ldap=no) |
---|
122 | AC_MSG_RESULT($with_ldap) |
---|
123 | |
---|
124 | if test -d $with_ldap; then |
---|
125 | CPPFLAGS="$CPPFLAGS -I${with_ldap}/include" |
---|
126 | CMU_ADD_LIBPATH(${with_ldap}/lib) |
---|
127 | fi |
---|
128 | |
---|
129 | LDAP_LIBS="" |
---|
130 | if test "$with_ldap" != no; then |
---|
131 | AC_CHECK_LIB(ldap, ldap_initialize, [ AC_DEFINE(HAVE_LDAP) |
---|
132 | LDAP_LIBS="-lldap -llber" |
---|
133 | if test "$with_openssl" != "no"; then |
---|
134 | LDAP_LIBS="$LDAP_LIBS -lcrypto $LIB_RSAREF" |
---|
135 | fi],,-llber) |
---|
136 | |
---|
137 | fi |
---|
138 | AC_SUBST(LDAP_LIBS) |
---|
139 | |
---|
140 | |
---|
141 | dnl Checks for header files. |
---|
142 | AC_HEADER_STDC |
---|
143 | AC_HEADER_SYS_WAIT |
---|
144 | AC_HEADER_TIME |
---|
145 | AC_CHECK_HEADERS(crypt.h fcntl.h strings.h syslog.h unistd.h sys/time.h sys/uio.h) |
---|
146 | |
---|
147 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
148 | AC_C_CONST |
---|
149 | AC_TYPE_PID_T |
---|
150 | |
---|
151 | dnl Checks for library functions. |
---|
152 | AC_TYPE_SIGNAL |
---|
153 | AC_CHECK_FUNCS(gethostname mkdir socket strdup) |
---|
154 | AC_CHECK_FUNCS(getspnam getuserpw, break) |
---|
155 | |
---|
156 | dnl Check for getaddrinfo |
---|
157 | GETADDRINFOOBJS="" |
---|
158 | sasl_cv_getaddrinfo=no |
---|
159 | IPv6_CHECK_FUNC(getaddrinfo, |
---|
160 | [AC_DEFINE(HAVE_GETADDRINFO)], [sasl_cv_getaddrinfo=yes]) |
---|
161 | if test $sasl_cv_getaddrinfo = yes; then |
---|
162 | COMPAT_OBJ="$COMPAT_OBJ getaddrinfo.o" |
---|
163 | fi |
---|
164 | |
---|
165 | dnl Check for getnameinfo |
---|
166 | GETNAMEINFOOBJS="" |
---|
167 | sasl_cv_getnameinfo=no |
---|
168 | IPv6_CHECK_FUNC(getnameinfo, |
---|
169 | [AC_DEFINE(HAVE_GETNAMEINFO)], [sasl_cv_getnameinfo=yes]) |
---|
170 | if test $sasl_cv_getnameinfo = yes; then |
---|
171 | COMPAT_OBJ="$COMPAT_OBJ getnameinfo.o" |
---|
172 | fi |
---|
173 | |
---|
174 | AC_SUBST(COMPAT_OBJ) |
---|
175 | |
---|
176 | IPv6_CHECK_SS_FAMILY() |
---|
177 | IPv6_CHECK_SA_LEN() |
---|
178 | IPv6_CHECK_SOCKLEN_T() |
---|
179 | |
---|
180 | AC_EGREP_HEADER(sockaddr_storage, sys/socket.h, |
---|
181 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)) |
---|
182 | |
---|
183 | AC_OUTPUT(Makefile) |
---|