1 # Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision$)
4 AC_INIT(mod_auth_gssapi, 0.1, modauthkerb-developers@lists.sourceforge.net)
5 AC_CONFIG_SRCDIR([mod_auth_gssapi.c])
6 AC_CONFIG_HEADER([config.h])
12 # Checks for header files.
14 AC_CHECK_HEADERS([limits.h netdb.h stddef.h stdlib.h string.h unistd.h])
16 # Checks for typedefs, structures, and compiler characteristics.
27 AC_HELP_STRING([--with-gss=dir],[use gss in dir]),
28 [ with_gss="$withval" ])
29 if test "x$with_gss" = "xyes" ; then
33 ac_save_CPPFLAGS="$CPPFLAGS"
34 ac_save_LDFLAGS="$LDFLAGS"
37 if test -z "$GSS_CPPFLAGS"; then
39 if test -n "with_gss"; then
40 TMP_GSS_CPPFLAGS="-I$with_gss/include"
42 CPPFLAGS="$CPPFLAGS $TMP_GSS_CPPFLAGS"
43 AC_CHECK_HEADERS(gssapi.h,
44 [ GSS_CPPFLAGS="$TMP_GSS_CPPFLAGS" ])
45 if test -z "$GSS_CPPFLAGS"; then
46 AC_CHECK_HEADERS(gssapi/gssapi.h,
47 [ GSS_CPPFLAGS="$TMP_GSS_CPPFLAGS" ])
49 CPPFLAGS="$ac_save_CPPFLAGS"
52 #if test "x$with_gss"="x"; then
57 if test -z "$GSS_LDFLAGS"; then
59 if test -n "$with_gss"; then
60 # XXX think about lib64, etc
61 TMP_GSS_LDFLAGS="-L $with_gss/lib"
64 LIBS="$LIBS $TMP_GSS_LDFLAGS"
65 AC_CHECK_LIB(gssapi, gss_accept_sec_context, [ GSS_LDFLAGS="$TMP_GSS_LDFLAGS" ])
68 if test -z "$GSS_LDFLAGS"; then
69 AC_MSG_ERROR([failed to find a GSS-API library])
72 # If SPNEGO is supported by the gssapi libraries, we shouln't build our support.
73 # SPNEGO is supported as of Heimdal 0.7, and MIT 1.5.
74 gssapi_supports_spnego=""
75 AC_MSG_CHECKING(whether the GSSAPI libraries support SPNEGO)
77 ac_save_CFLAGS="$CFLAGS"
78 CFLAGS="$GSS_CPPFLAGS"
80 ac_save_LDFLAGS=$LDFLAGS
81 LDFLAGS="$GSS_LDFLAGS"
82 # to make sure the testing binary can be launched:
83 if test -n "$with_gss"; then
84 LDFLAGS="$LDFLAGS -Wl,-rpath -Wl,$with_gss/lib"
86 #XXX schovat nebo dat primo do LDFLAGS:
91 int main(int argc, char** argv)
93 OM_uint32 major_status, minor_status;
95 gss_OID_desc spnego_oid_desc = {6, (void *)"\x2b\x06\x01\x05\x05\x02"};
98 major_status = gss_indicate_mechs(&minor_status, &mech_set);
99 if (GSS_ERROR(major_status))
103 for (i=0; i < mech_set->count && !SPNEGO; i++) {
104 gss_OID tmp_oid = &mech_set->elements[i];
105 if (tmp_oid->length == spnego_oid_desc.length &&
106 !memcmp(tmp_oid->elements, spnego_oid_desc.elements,
112 gss_release_oid_set(&minor_status, &mech_set);
116 [ if test $? -eq 0; then
118 AC_DEFINE(GSSAPI_SUPPORTS_SPNEGO)
119 gssapi_supports_spnego=yes
126 CFLAGS="$ac_save_CFLAGS"
127 LDFLAGS="$ac_save_LDFLAGS"
129 if test -z "$gssapi_supports_spnego"; then
131 spnegokrb5/asn1_MechType.c \
132 spnegokrb5/asn1_MechTypeList.c \
133 spnegokrb5/asn1_ContextFlags.c \
134 spnegokrb5/asn1_NegTokenInit.c \
135 spnegokrb5/asn1_NegTokenTarg.c \
136 spnegokrb5/der_get.c \
137 spnegokrb5/der_put.c \
138 spnegokrb5/der_free.c \
139 spnegokrb5/der_length.c \
140 spnegokrb5/der_copy.c \
141 spnegokrb5/timegm.c \
142 spnegokrb5/init_sec_context.c \
143 spnegokrb5/accept_sec_context.c \
144 spnegokrb5/encapsulate.c \
145 spnegokrb5/decapsulate.c \
146 spnegokrb5/external.c"
148 AC_SUBST(GSS_CPPFLAGS)
149 AC_SUBST(GSS_LDFLAGS)
150 AC_SUBST(SPNEGO_SRCS)
156 AC_HELP_STRING([--with-apache=dir],[use apache in dir]),
157 [ with_apache="$withval" ])
159 AC_PATH_PROG([APXS], [apxs], [], [$with_apache/bin:$with_apache/sbin:$PATH])
160 if test -z "$APXS"; then
161 AC_PATH_PROG([APXS], [apxs2], [], [$with_apache/bin:$with_apache/sbin:$PATH])
162 if test -z "$APXS"; then
163 AC_MSG_ERROR([failed to find apache apxs executable])
168 AC_CONFIG_FILES([Makefile])