1 dnl ####################
2 dnl ## Initialization ##
3 dnl ####################
7 dnl ####################
8 dnl ## Config Options ##
9 dnl ####################
11 [ --with-api=API api to use (apache1, apache2)],
21 AC_ERROR(You can only specify apache1 or apache2.)
28 [ --with-apxs=PATH path to apxs],
30 if test -e $withval ; then
33 AC_ERROR(Specified apxs path does not exist.)
39 [ --with-static module is to be statically linked],
46 [ --with-krb5=DIR path to Kerberos 5 install],
48 if test -d $withval ; then
49 CFLAGS="$CFLAGS -I$withval/include -I$withval/include/kerberosIV"
50 CPPFLAGS="$CPPFLAGS -I$withval/include -I$withval/include/kerberosIV"
51 LDFLAGS="$LDFLAGS -L$withval/lib"
55 LDFLAGS="$LDFLAGS -R$withval/lib"
59 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
64 AC_ARG_WITH(krb5-include,
65 [ --with-krb5-include=DIR include path to Kerberos 5 install],
67 if test -d $withval ; then
68 CFLAGS="$CFLAGS -I$withval -I$withval/include/kerberosIV"
69 CPPFLAGS="$CPPFLAGS -I$withval -I$withval/include/kerberosIV"
71 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
77 [ --with-krb5-lib=DIR lib path to Kerberos 5 install],
79 if test -d $withval ; then
80 LDFLAGS="$LDFLAGS -L$withval"
84 LDFLAGS="$LDFLAGS -R$withval"
88 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
94 [ --disable-krb5 force disabling of krb5 support],
96 if test "$enable_krb5" = "no" ; then
103 [ --with-krb4=DIR path to Kerberos 4 install],
105 if test -d $withval ; then
106 CFLAGS="$CFLAGS -I$withval/include"
107 CPPFLAGS="$CPPFLAGS -I$withval/include"
108 LDFLAGS="$LDFLAGS -L$withval/lib"
112 LDFLAGS="$LDFLAGS -R$withval/lib"
116 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
121 AC_ARG_WITH(krb4-include,
122 [ --with-krb4-include=DIR include path to Kerberos 4 install],
124 if test -d $withval ; then
125 CFLAGS="$CFLAGS -I$withval"
126 CPPFLAGS="$CPPFLAGS -I$withval"
128 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
133 AC_ARG_WITH(krb4-lib,
134 [ --with-krb4-lib=DIR lib path to Kerberos 4 install],
136 if test -d $withval ; then
137 LDFLAGS="$LDFLAGS -L$withval"
141 LDFLAGS="$LDFLAGS -R$withval"
145 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
151 [ --disable-krb4 force disabling of krb4 support],
153 if test "$enable_krb4" = "no" ; then
154 ac_krb4_disable="yes"
160 dnl ####################
161 dnl ## Program Checks ##
162 dnl ####################
164 if test -z "$ac_static" ; then
165 AC_PATH_PROG(APXS, apxs)
166 if test -z "$APXS" ; then
167 echo "No apxs found. Defaulting to static module generation."
176 if test -z "$ac_krb5_disable" ; then
177 AC_CHECK_LIB(krb5, krb5_get_in_tkt_with_password, [
181 AC_CHECK_LIB(k5crypto, krb5_string_to_key, [
182 ac_krblibs="$ac_krblibs -lk5crypto"
184 AC_CHECK_LIB(crypto, krb5_string_to_key, [
185 ac_krblibs="$ac_krblibs -lcrypto"
190 ac_krblibs="$ac_krblibs -lcom_err"
192 if test -z "$ac_krb4_disable" ; then
193 if test -n "$ac_krblibs" ; then
194 AC_CHECK_LIB(krb4, krb_get_pw_in_tkt, [
197 ac_krblibs="-lkrb4 $ac_krblibs"
204 if test -z "$ac_krb4_disable" -a -z "$ac_krb4" ; then
205 AC_CHECK_LIB(krb, krb_get_pw_in_tkt, [
208 ac_krblibs="$ac_krblibs -lkrb -lcom_err"
212 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
213 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
220 if test -n "$ac_krb5" ; then
221 AC_CHECK_HEADERS(krb5.h, [
226 if test -z "$ac_foundkrb5" ; then
227 AC_MSG_RESULT(krb5.h not found... removing krb5 support.)
232 if test -n "$ac_krb4" ; then
233 AC_CHECK_HEADERS(kerberosIV/krb.h krb.h, [
238 if test -z "$ac_foundkrb4" ; then
239 AC_MSG_RESULT(krb.h not found... removing krb4 support.)
244 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
245 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
259 dnl ##############################
260 dnl ## Compiler Characteristics ##
261 dnl ##############################
262 if test -z "$ac_api" ; then
263 if test -n "`$APXS -q bindir 2> /dev/null`" ; then
264 echo "API autodetected to be Apache 2.*"
267 echo "API autodetected to be Apache 1.*"
273 dnl #######################
274 dnl ## Library Functions ##
275 dnl #######################
278 dnl #####################
279 dnl ## System Services ##
280 dnl #####################
283 dnl ##########################
284 dnl ## Last Minute Settings ##
285 dnl ##########################
286 LIBS="$LIBS $ac_krblibs"
287 DEFS="$DEFS $ac_krbdefs"
292 GENHEADERS="$GENHEADERS apache1/api_inc.h"
293 GENHEADERS="$GENHEADERS apache1/auth_config.h"
294 GENSOURCES="$GENSOURCES apache1/auth_user.c"
295 GENSOURCES="$GENSOURCES apache1/auth_cmds.c"
296 GENSOURCES="$GENSOURCES apache1/dir_config.c"
297 GENSOURCES="$GENSOURCES apache1/module.c"
300 GENHEADERS="$GENHEADERS apache2/api_inc.h"
301 GENHEADERS="$GENHEADERS apache2/auth_config.h"
302 GENSOURCES="$GENSOURCES apache2/auth_user.c"
303 GENSOURCES="$GENSOURCES apache2/auth_cmds.c"
304 GENSOURCES="$GENSOURCES apache2/dir_config.c"
305 GENSOURCES="$GENSOURCES apache2/hooks.c"
306 GENSOURCES="$GENSOURCES apache2/module.c"
310 if test "$ac_krb5" = "yes" ; then
311 GENHEADERS="$GENHEADERS krb5/krb5_inc.h"
312 GENSOURCES="krb5/validate.c $GENSOURCES"
315 if test "$ac_krb4" = "yes" ; then
316 GENHEADERS="$GENHEADERS krb4/krb4_inc.h"
317 GENSOURCES="krb4/validate.c $GENSOURCES"
321 dnl #########################
322 dnl ## Create Output Files ##
323 dnl #########################
324 echo "Generating mod_auth_kerb.c ..."
325 echo "/* Automatically generated by configure. */" > mod_auth_kerb.c
326 if test "$ac_krb5" = "yes" ; then
327 echo "#define KRB5 1" >> mod_auth_kerb.c
329 if test "$ac_krb4" = "yes" ; then
330 echo "#define KRB4 1" >> mod_auth_kerb.c
332 for f in $GENHEADERS $GENSOURCES ; do
334 echo "" >> mod_auth_kerb.c
335 cat $f >> mod_auth_kerb.c
338 if test "$ac_static" = "yes" ; then
341 echo "This module is to be built statically into Apache. You will need"
342 echo "to place it into the appropriate location in the source tree and"
343 echo "compile Apache accordingly. You can look at the online docs at"
344 echo "http://modauthkerb.sourceforge.net/ or README.static for more"