1 dnl ####################
2 dnl ## Initialization ##
3 dnl ####################
7 dnl ####################
8 dnl ## Config Options ##
9 dnl ####################
11 [ --with-api=API api to use (apache1, apache2)],
23 AC_ERROR(You can only specify apache1 or apache2.)
30 [ --with-apxs=PATH path to apxs],
32 if test -e $withval ; then
35 AC_ERROR(Specified apxs path does not exist.)
41 [ --with-static module is to be statically linked],
48 [ --with-krb5=DIR path to Kerberos 5 install],
50 if test -d $withval ; then
51 CFLAGS="$CFLAGS -I$withval/include -I$withval/include/kerberosIV"
52 CPPFLAGS="$CPPFLAGS -I$withval/include -I$withval/include/kerberosIV"
53 LDFLAGS="$LDFLAGS -L$withval/lib"
57 LDFLAGS="$LDFLAGS -R$withval/lib"
61 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
66 AC_ARG_WITH(krb5-include,
67 [ --with-krb5-include=DIR include path to Kerberos 5 install],
69 if test -d $withval ; then
70 CFLAGS="$CFLAGS -I$withval -I$withval/include/kerberosIV"
71 CPPFLAGS="$CPPFLAGS -I$withval -I$withval/include/kerberosIV"
73 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
79 [ --with-krb5-lib=DIR lib path to Kerberos 5 install],
81 if test -d $withval ; then
82 LDFLAGS="$LDFLAGS -L$withval"
86 LDFLAGS="$LDFLAGS -R$withval"
90 AC_ERROR(Specified Kerberos 5 directory doesn't exist.)
96 [ --disable-krb5 force disabling of krb5 support],
98 if test "$enable_krb5" = "no" ; then
105 [ --with-krb4=DIR path to Kerberos 4 install],
107 if test -d $withval ; then
108 CFLAGS="$CFLAGS -I$withval/include"
109 CPPFLAGS="$CPPFLAGS -I$withval/include"
110 LDFLAGS="$LDFLAGS -L$withval/lib"
114 LDFLAGS="$LDFLAGS -R$withval/lib"
118 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
123 AC_ARG_WITH(krb4-include,
124 [ --with-krb4-include=DIR include path to Kerberos 4 install],
126 if test -d $withval ; then
127 CFLAGS="$CFLAGS -I$withval"
128 CPPFLAGS="$CPPFLAGS -I$withval"
130 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
135 AC_ARG_WITH(krb4-lib,
136 [ --with-krb4-lib=DIR lib path to Kerberos 4 install],
138 if test -d $withval ; then
139 LDFLAGS="$LDFLAGS -L$withval"
143 LDFLAGS="$LDFLAGS -R$withval"
147 AC_ERROR(Specified Kerberos 4 directory doesn't exist.)
153 [ --disable-krb4 force disabling of krb4 support],
155 if test "$enable_krb4" = "no" ; then
156 ac_krb4_disable="yes"
162 dnl ####################
163 dnl ## Program Checks ##
164 dnl ####################
166 if test -z "$ac_static" ; then
167 AC_PATH_PROG(APXS, apxs)
168 if test -z "$APXS" ; then
169 echo "No apxs found. Defaulting to static module generation."
178 if test -z "$ac_krb5_disable" ; then
179 AC_CHECK_LIB(krb5, krb5_get_in_tkt_with_password, [
183 AC_CHECK_LIB(k5crypto, krb5_string_to_key, [
184 ac_krblibs="$ac_krblibs -lk5crypto"
186 AC_CHECK_LIB(crypto, krb5_string_to_key, [
187 ac_krblibs="$ac_krblibs -lcrypto"
192 ac_krblibs="$ac_krblibs -lcom_err"
194 if test -z "$ac_krb4_disable" ; then
195 if test -n "$ac_krblibs" ; then
196 AC_CHECK_LIB(krb4, krb_get_pw_in_tkt, [
198 ac_krbdefs="$ac_krbdefs -DKRB4"
199 ac_krblibs="$ac_krblibs -lkrb4 $ac_krblibs"
206 if test -z "$ac_krb4_disable" -a -z "$ac_krb4" ; then
207 AC_CHECK_LIB(krb, krb_get_pw_in_tkt, [
210 ac_krblibs="$ac_krblibs -lkrb -lcom_err"
214 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
215 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
222 if test -n "$ac_krb5" ; then
223 AC_CHECK_HEADERS(krb5.h, [
228 if test -z "$ac_foundkrb5" ; then
229 AC_MSG_RESULT(krb5.h not found... removing krb5 support.)
234 if test -n "$ac_krb4" ; then
235 AC_CHECK_HEADERS(kerberosIV/krb.h krb.h, [
240 if test -z "$ac_foundkrb4" ; then
241 AC_MSG_RESULT(krb.h not found... removing krb4 support.)
246 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
247 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
261 dnl ##############################
262 dnl ## Compiler Characteristics ##
263 dnl ##############################
264 if test -z "$ac_api" ; then
265 if test -n "`$APXS -q bindir 2> /dev/null`" ; then
266 echo "API autodetected to be Apache 2.*"
270 echo "API autodetected to be Apache 1.*"
277 dnl #######################
278 dnl ## Library Functions ##
279 dnl #######################
282 dnl #####################
283 dnl ## System Services ##
284 dnl #####################
287 dnl ##########################
288 dnl ## Last Minute Settings ##
289 dnl ##########################
290 LIBS="$LIBS $ac_krblibs"
291 DEFS="$DEFS $ac_apidefs $ac_krbdefs"
292 CFLAGS="$CFLAGS $DEFS"
295 dnl #########################
296 dnl ## Create Output Files ##
297 dnl #########################
298 if test "$ac_static" = "yes" ; then
301 echo "This module is to be built statically into Apache. You will need"
302 echo "to place it into the appropriate location in the source tree and"
303 echo "compile Apache accordingly. You can look at the online docs at"
304 echo "http://modauthkerb.sourceforge.net/ or README.static for more"
310 AC_OUTPUT(src/Makefile)