1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(Apache Kerberos Module,
4 modauthkerb-developers@lists.sourceforge.net,
9 dnl OS specific options.
20 dnl Custom args we care about.
22 [ --with-api=API api to use (apache1, apache2)],
34 AC_ERROR(You can only specify apache1 or apache2.)
41 [ --with-apxs=PATH path to apxs],
43 if test -e $withval ; then
46 AC_ERROR(Specified apxs path does not exist.)
52 [ --with-static module is to be statically linked],
59 [ --with-krb5=DIR path to Kerberos 5 install],
61 CFLAGS="$CFLAGS -I$withval/include -I$withval/include/kerberosIV"
62 CPPFLAGS="$CPPFLAGS -I$withval/include -I$withval/include/kerberosIV"
63 LDFLAGS="$LDFLAGS -L$withval/lib"
64 if test -n "${need_dash_r}"; then
65 LDFLAGS="$LDFLAGS -R$withval/lib"
70 AC_ARG_WITH(krb5-include,
71 [ --with-krb5-include=DIR include path to Kerberos 5 install],
73 CFLAGS="$CFLAGS -I$withval -I$withval/kerberosIV"
74 CPPFLAGS="$CPPFLAGS -I$withval -I$withval/kerberosIV"
79 [ --with-krb5-lib=DIR lib path to Kerberos 5 install],
81 LDFLAGS="$LDFLAGS -L$withval"
82 if test -n "${need_dash_r}"; then
83 LDFLAGS="$LDFLAGS -R$withval"
89 [ --disable-krb5 force disabling of krb5 support],
91 if test "$enable_krb5" = "no" ; then
98 [ --with-krb4=DIR path to Kerberos 4 install],
100 CFLAGS="$CFLAGS -I$withval/include"
101 CPPFLAGS="$CPPFLAGS -I$withval/include"
102 LDFLAGS="$LDFLAGS -L$withval/lib"
103 if test -n "${need_dash_r}"; then
104 LDFLAGS="$LDFLAGS -R$withval/lib"
109 AC_ARG_WITH(krb4-include,
110 [ --with-krb4-include=DIR include path to Kerberos 4 install],
112 CFLAGS="$CFLAGS -I$withval"
113 CPPFLAGS="$CPPFLAGS -I$withval"
117 AC_ARG_WITH(krb4-lib,
118 [ --with-krb4-lib=DIR lib path to Kerberos 4 install],
120 LDFLAGS="$LDFLAGS -L$withval"
121 if test -n "${need_dash_r}"; then
122 LDFLAGS="$LDFLAGS -R$withval"
128 [ --disable-krb4 force disabling of krb4 support],
130 if test "$enable_krb4" = "no" ; then
131 ac_krb4_disable="yes"
137 [ --with-gssapi=DIR path to GSSAPI install],
139 CFLAGS="$CFLAGS -I$withval/include -I$withval/include/gssapi"
140 CPPFLAGS="$CPPFLAGS -I$withval/include -I$withval/include/gssapi"
141 LDFLAGS="$LDFLAGS -L$withval/lib"
142 if test -n "${need_dash_r}"; then
143 LDFLAGS="$LDFLAGS -R$withval/lib"
148 AC_ARG_WITH(gssapi-include,
149 [ --with-gssapi-include=DIR include path to GSSAPI install],
151 CFLAGS="$CFLAGS -I$withval -I$withval/gssapi"
152 CPPFLAGS="$CPPFLAGS -I$withval -I$withval/gssapi"
156 AC_ARG_WITH(gssapi-lib,
157 [ --with-gssapi-lib=DIR lib path to GSSAPI install],
159 LDFLAGS="$LDFLAGS -L$withval"
160 if test -n "${need_dash_r}"; then
161 LDFLAGS="$LDFLAGS -R$withval"
166 AC_ARG_ENABLE(gssapi,
167 [ --disable-gssapi force disabling of gssapi support],
169 if test "$enable_gssapi" = "no" ; then
170 ac_gssapi_disable="yes"
177 dnl Checks for programs.
180 if test -z "$ac_static" ; then
181 AC_PATH_PROG(APXS, apxs)
182 if test -z "$APXS" ; then
183 echo "No apxs found. Defaulting to static module generation."
189 dnl Checks for libraries.
190 if test -z "$ac_krb5_disable" ; then
191 AC_CHECK_LIB(krb5, krb5_get_in_tkt_with_password, [
195 AC_CHECK_LIB(k5crypto, krb5_string_to_key, [
196 ac_krblibs="$ac_krblibs -lk5crypto"
198 AC_CHECK_LIB(crypto, krb5_string_to_key, [
199 ac_krblibs="$ac_krblibs -lcrypto"
204 ac_krblibs="$ac_krblibs -lcom_err"
206 if test -z "$ac_krb4_disable" ; then
207 if test -n "$ac_krblibs" ; then
208 AC_CHECK_LIB(krb4, krb_get_pw_in_tkt, [
210 ac_krbdefs="$ac_krbdefs -DKRB4"
211 ac_krblibs="-lkrb4 $ac_krblibs"
218 if test -z "$ac_krb4_disable" -a -z "$ac_krb4" ; then
219 AC_CHECK_LIB(krb, krb_get_pw_in_tkt, [
222 ac_krblibs="$ac_krblibs -lkrb -lcom_err"
226 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
227 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
231 dnl Checks for header files.
232 if test -n "$ac_krb5" ; then
233 AC_CHECK_HEADERS(krb5.h, [
238 if test -z "$ac_foundkrb5" ; then
239 AC_MSG_RESULT(krb5.h not found... removing krb5 support.)
244 if test -n "$ac_krb4" ; then
245 AC_CHECK_HEADERS(kerberosIV/krb.h krb.h, [
250 if test -z "$ac_foundkrb4" ; then
251 AC_MSG_RESULT(krb.h not found... removing krb4 support.)
256 if test -z "$ac_krb4" -a -z "$ac_krb5" ; then
257 AC_ERROR(Neither Kerberos 5 nor 4 support available.)
261 dnl Checks for typedefs, structures, and compiler characteristics.
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.*"
268 echo "API autodetected to be Apache 1.*"
275 dnl Checks for library functions.
278 dnl Last minute settings.
279 LIBS="$LIBS $ac_krblibs"
280 DEFS="$DEFS $ac_apidefs $ac_krbdefs"
281 CFLAGS="$CFLAGS $DEFS"
284 dnl Create files necessary to compile mod_auth_kerb.
285 if test "$ac_static" = "yes" ; then
288 echo "This module is to be built statically into Apache. You will need"
289 echo "to place it into the appropriate location in the source tree and"
290 echo "compile Apache accordingly. You can look at the online docs at"
291 echo "http://modauthkerb.sourceforge.net/ or README.static for more"
297 AC_OUTPUT(src/Makefile)