1 dnl ####################
2 dnl ## Initialization ##
3 dnl ####################
4 AC_INIT(Apache Kerberos Module,
6 modauthkerb-developers@lists.sourceforge.net,
10 dnl ####################
11 dnl ## Config Options ##
12 dnl ####################
14 [ --with-api=API api to use (apache1, apache2)],
26 AC_ERROR(You can only specify apache1 or apache2.)
33 [ --with-apxs=PATH path to apxs],
35 if test -e $withval ; then
38 AC_ERROR(Specified apxs path does not exist.)
44 [ --with-static module is to be statically linked],
51 [ --with-krb5=DIR path to Kerberos 5 install],
53 if test -d $withval ; then
54 CFLAGS="$CFLAGS -I$withval/include -I$withval/include/kerberosIV"
55 CPPFLAGS="$CPPFLAGS -I$withval/include -I$withval/include/kerberosIV"
56 LDFLAGS="$LDFLAGS -L$withval/lib"
60 LDFLAGS="$LDFLAGS -R$withval/lib"
64 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
69 AC_ARG_WITH(krb5-include,
70 [ --with-krb5-include=DIR include path to Kerberos 5 install],
72 if test -d $withval ; then
73 CFLAGS="$CFLAGS -I$withval -I$withval/include/kerberosIV"
74 CPPFLAGS="$CPPFLAGS -I$withval -I$withval/include/kerberosIV"
76 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
82 [ --with-krb5-lib=DIR lib path to Kerberos 5 install],
84 if test -d $withval ; then
85 LDFLAGS="$LDFLAGS -L$withval"
89 LDFLAGS="$LDFLAGS -R$withval"
93 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
99 [ --disable-krb5 force disabling of krb5 support],
101 if test "$enable_krb5" = "no" ; then
102 ac_krb5_disable="yes"
108 [ --with-krb4=DIR path to Kerberos 4 install],
110 if test -d $withval ; then
111 CFLAGS="$CFLAGS -I$withval/include"
112 CPPFLAGS="$CPPFLAGS -I$withval/include"
113 LDFLAGS="$LDFLAGS -L$withval/lib"
117 LDFLAGS="$LDFLAGS -R$withval/lib"
121 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
126 AC_ARG_WITH(krb4-include,
127 [ --with-krb4-include=DIR include path to Kerberos 4 install],
129 if test -d $withval ; then
130 CFLAGS="$CFLAGS -I$withval"
131 CPPFLAGS="$CPPFLAGS -I$withval"
133 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
138 AC_ARG_WITH(krb4-lib,
139 [ --with-krb4-lib=DIR lib path to Kerberos 4 install],
141 if test -d $withval ; then
142 LDFLAGS="$LDFLAGS -L$withval"
146 LDFLAGS="$LDFLAGS -R$withval"
150 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
156 [ --disable-krb4 force disabling of krb4 support],
158 if test "$enable_krb4" = "no" ; then
159 ac_krb4_disable="yes"
165 dnl ####################
166 dnl ## Program Checks ##
167 dnl ####################
169 if test -z "$ac_static" ; then
170 AC_PATH_PROG(APXS, apxs)
171 if test -z "$APXS" ; then
172 echo "No apxs found. Defaulting to static module generation."
181 if test -z "$ac_krb5_disable" ; then
182 AC_CHECK_LIB(krb5, krb5_get_in_tkt_with_password, [
186 AC_CHECK_LIB(k5crypto, krb5_string_to_key, [
187 ac_krblibs="$ac_krblibs -lk5crypto"
189 AC_CHECK_LIB(crypto, krb5_string_to_key, [
190 ac_krblibs="$ac_krblibs -lcrypto"
195 ac_krblibs="$ac_krblibs -lcom_err"
197 if test -z "$ac_krb4_disable" ; then
198 if test -n "$ac_krblibs" ; then
199 AC_CHECK_LIB(krb4, krb_get_pw_in_tkt, [
201 ac_krbdefs="$ac_krbdefs -DKRB4"
202 ac_krblibs="$ac_krblibs -lkrb4 $ac_krblibs"
209 if test -z "$ac_krb4_disable" -a -z "$ac_krb4" ; then
210 AC_CHECK_LIB(krb, krb_get_pw_in_tkt, [
213 ac_krblibs="$ac_krblibs -lkrb -lcom_err"
217 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
218 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
225 if test -n "$ac_krb5" ; then
226 AC_CHECK_HEADERS(krb5.h, [
231 if test -z "$ac_foundkrb5" ; then
232 AC_MSG_RESULT(krb5.h not found... removing krb5 support.)
237 if test -n "$ac_krb4" ; then
238 AC_CHECK_HEADERS(kerberosIV/krb.h krb.h, [
243 if test -z "$ac_foundkrb4" ; then
244 AC_MSG_RESULT(krb.h not found... removing krb4 support.)
249 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
250 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
264 dnl ##############################
265 dnl ## Compiler Characteristics ##
266 dnl ##############################
267 if test -z "$ac_api" ; then
268 if test -n "`$APXS -q bindir 2> /dev/null`" ; then
269 echo "API autodetected to be Apache 2.*"
273 echo "API autodetected to be Apache 1.*"
280 dnl #######################
281 dnl ## Library Functions ##
282 dnl #######################
285 dnl #####################
286 dnl ## System Services ##
287 dnl #####################
290 dnl ##########################
291 dnl ## Last Minute Settings ##
292 dnl ##########################
293 LIBS="$LIBS $ac_krblibs"
294 DEFS="$DEFS $ac_apidefs $ac_krbdefs"
295 CFLAGS="$CFLAGS $DEFS"
298 dnl #########################
299 dnl ## Create Output Files ##
300 dnl #########################
301 if test "$ac_static" = "yes" ; then
304 echo "This module is to be built statically into Apache. You will need"
305 echo "to place it into the appropriate location in the source tree and"
306 echo "compile Apache accordingly. You can look at the online docs at"
307 echo "http://modauthkerb.sourceforge.net/ or README.static for more"
313 AC_OUTPUT(src/Makefile)