2 AC_INIT([mod_auth_gssapi], [1.0.0], [simo@redhat.com])
3 AC_CONFIG_SRCDIR([src/mod_auth_gssapi.c])
4 AM_INIT_AUTOMAKE([-Wall foreign subdir-objects tar-pax])
5 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
6 AC_CONFIG_MACRO_DIR([m4])
7 AC_CONFIG_HEADERS([src/config.h])
16 AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes])
18 AC_CHECK_HEADERS([stdint.h])
20 # Checks for typedefs, structures, and compiler characteristics.
21 AC_CHECK_HEADER_STDBOOL
25 # Checks for library functions.
26 AC_CHECK_FUNCS([strcasecmp])
29 [AC_HELP_STRING([--with-apxs=PATH/NAME], [path to the apxs binary [[apxs]]])],
30 [AC_SUBST(APXS, $with_apxs)],
31 [AC_PATH_PROGS(APXS, [apxs2 apxs])])
32 AS_IF([test "x${APXS}" != "x" -a -x "${APXS}"],
33 [AC_MSG_NOTICE([apxs found at $APXS])
34 APXS_LIBEXECDIR=`${APXS} -q LIBEXECDIR`
35 AC_SUBST(APXS_LIBEXECDIR)],
36 [AC_MSG_FAILURE(["apxs not found. Use --with-apxs"])])
39 [AC_HELP_STRING([--with-apr=PATH/NAME], [path to the apr binary [[apr]]])],
40 [AC_SUBST(APR, $with_apr)],
41 [AC_PATH_PROGS(APR, [apr-1-config])])
42 AS_IF([test "x${APR}" != "x" -a -x "${APR}"],
43 [AC_MSG_NOTICE([apr found at $APR])
44 APR_CPPFLAGS=`${APR} --cppflags`
45 AC_SUBST(APR_CPPFLAGS)
46 APR_INCLUDES=`${APR} --includes`
47 AC_SUBST(APR_INCLUDES)
48 APR_LDFLAGS=`${APR} --link-libtool --libs`
49 AC_SUBST(APR_LDFLAGS)],
50 [AC_MSG_FAILURE(["apr-1-config not found. Use --with-apr"])])
52 PKG_CHECK_MODULES([OPENSSL], [openssl])
53 AC_SUBST([OPENSSL_CFLAGS])
54 AC_SUBST([OPENSSL_LIBS])
56 AC_CHECK_HEADERS([gssapi/gssapi.h],,[AC_MSG_ERROR([Could not find GSSAPI headers])])
57 AC_PATH_PROG(KRB5_CONFIG, krb5-config, failed)
58 if test x$KRB5_CONFIG = xfailed; then
59 AC_MSG_ERROR([Could not find GSSAPI development libraries])
61 GSSAPI_CFLAGS="`$KRB5_CONFIG --cflags gssapi`"
62 GSSAPI_LIBS="`$KRB5_CONFIG --libs gssapi`"
64 AC_CHECK_LIB([gssapi_krb5], [gss_accept_sec_context], [],
65 [AC_MSG_ERROR([GSSAPI library check failed])])
66 AC_CHECK_FUNCS(gss_acquire_cred_from)
67 AC_CHECK_FUNCS(gss_store_cred_into)
69 AC_SUBST([GSSAPI_CFLAGS])
70 AC_SUBST([GSSAPI_LIBS])
72 CFLAGS="`${APXS} -q CFLAGS` `${APR} --cflags` ${GSSAPI_CFLAGS} ${OPENSSL_CFLAGS} -I`${APXS} -q INCLUDEDIR` -I`${APR} --includes`"
73 LIBS="`${APR} --link-libtool --libs` ${GSSAPI_LIBS} ${OPENSSL_LIBS}"
75 AC_CONFIG_FILES([Makefile src/Makefile])