4 AC_INIT([shibboleth], [0.1], [mace-shib-users@internet2.edu], [shibboleth])
5 AM_CONFIG_HEADER(config.h)
8 sinclude(acx_pthread.m4)
10 AC_PROG_CC([gcc3 gcc cc])
11 AC_PROG_CXX([g++3 g++ c++ CC])
17 # Checks for typedefs, structures, and compiler characteristics.
22 # Checks for library functions.
24 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r])
25 AC_CHECK_HEADERS([dlfcn.h])
32 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
33 if test $enable_threads != "pthread"; then
34 AC_MSG_ERROR([unable to find pthreads, currently this is required])
36 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
37 LIBS="$PTHREAD_LIBS $LIBS"
38 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
39 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
43 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
44 [if test x_$with_xerces != x_/usr; then
45 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
46 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
51 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
52 [if test x_$with_openssl != x_/usr; then
53 LDFLAGS="-L${with_openssl}/lib $LDFLAGS"
54 CPPFLAGS="-I${with_openssl}/include $CPPFLAGS"
58 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
59 [if test x_$with_log4cpp != x_/usr; then
60 LDFLAGS="-L${with_log4cpp}/lib $LDFLAGS"
61 CPPFLAGS="-I${with_log4cpp}/include $CPPFLAGS"
65 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
66 [if test x_$with_saml != x_/usr; then
67 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
68 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
71 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
72 AC_MSG_ERROR([unable to find xerces header files]))
74 LIBS="-lxerces-c $LIBS"
76 [#include <xercesc/util/PlatformUtils.hpp>],
77 [XMLPlatformUtils::Initialize()],
78 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
79 [AC_MSG_ERROR([unable to link with Xerces])
83 AC_CHECK_HEADER([openssl/ssl.h],,
84 AC_MSG_ERROR([unable to find openssl header files]))
85 AC_CHECK_LIB([crypto], [ERR_load_CRYPTO_strings],,
86 AC_MSG_ERROR([unable to link with openssl libraries]))
87 AC_CHECK_LIB([ssl], [SSL_library_init],,
88 AC_MSG_ERROR([unable to link with openssl libraries]))
90 AC_CHECK_HEADER([log4cpp/Category.hh],,
91 AC_MSG_ERROR([unable to find log4cpp header files]))
93 AC_CHECK_HEADER([saml/saml.h],,
94 AC_MSG_ERROR([unable to find saml header files]))
97 LIBS="-llog4cpp $LIBS"
99 [#include <log4cpp/Category.hh>],
100 [log4cpp::Category::getInstance("foo")],
101 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
102 [AC_MSG_ERROR([unable to link with log4cpp])
109 [#include <saml/saml.h>],
110 [saml::SAMLConfig::getConfig()],
111 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
112 [AC_MSG_ERROR([unable to link with saml])
116 # output the underlying makefiles
117 WANT_SUBDIRS="shib schemas eduPerson shib-target shar test"
118 AC_CONFIG_FILES([Makefile shib/Makefile schemas/Makefile eduPerson/Makefile \
119 shib-target/Makefile shar/Makefile test/Makefile])
121 # Much of this is taken from mod_dav.
122 # The basic idea is to use configure options to control whether/which types
123 # of web server modules get built. We assume there may eventually be multiple
124 # types (Apache 1/2, iPlanet, others).
126 # Apache 1.3 (mod_shire/mod_shibrm)
127 # --with-apache (static build, no idea how to do this yet, so not supported)
128 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
129 # --without-apxs (DSO build, you tell us how to build using the environment)
131 AC_MSG_CHECKING([for dynamic Apache module support (w/ or w/o APXS)])
133 [ --with-apxs[=FILE] Build shared Apache module(s). FILE is the optional
134 pathname to the Apache apxs tool; defaults to "apxs".],
136 if test "$withval" = "yes"; then
137 for i in /usr/sbin /usr/local/apache/bin ; do
138 if test -f "$i/apxs"; then
142 if test -z "$APXS"; then
150 if test "$APXS" = "no"; then
152 # --without-apxs means you want the modules,
153 # but want to tell us how to build them
154 AC_MSG_RESULT(yes, but use environment, not apxs)
156 echo "Did you set one or more of these?"
158 echo "APXS_CFLAGS APXS_PREFIX APXS_INCLUDE APXS_LIBEXEC APXS_SYSCONFDIR"
161 AC_MSG_NOTICE([APXS_CFLAGS is $APXS_CFLAGS])
163 # try and find the Apache root
164 if test -z "$APXS_PREFIX"; then
165 if test -d "/usr/local/apache"; then
166 APXS_PREFIX="/usr/local/apache"
168 AC_MSG_ERROR([You MUST set APXS_PREFIX so the right Apache can be located!])
170 elif test ! -d "$APXS_PREFIX"; then
171 AC_MSG_ERROR([APXS_PREFIX of $APXS_PREFIX cannot be found])
173 AC_MSG_NOTICE([APXS_PREFIX is $APXS_PREFIX])
176 # other subfolders might be derived from APXS_PREFIX
177 if test -z "$APXS_INCLUDE"; then
178 if test -f "$APXS_PREFIX/include/httpd.h"; then
179 APXS_INCLUDE="$APXS_PREFIX/include"
181 AC_MSG_ERROR([can't find Apache include files beneath $APXS_PREFIX])
183 elif ! test -f "$APXS_INCLUDE/httpd.h"; then
184 AC_MSG_ERROR([APXS_INCLUDE of $APXS_INCLUDE does not contain Apache headers])
186 AC_MSG_NOTICE([APXS_INCLUDE is $APXS_INCLUDE])
188 if test -z "$APXS_LIBEXEC"; then
189 if test -d "$APXS_PREFIX/libexec"; then
190 APXS_LIBEXEC="$APXS_PREFIX/libexec"
191 elif test -d "$APXS_PREFIX/modules"; then
192 APXS_LIBEXEC="$APXS_PREFIX/modules"
194 AC_MSG_ERROR([can't find Apache libexec/module directory beneath $APXS_PREFIX])
196 elif ! test -d "$APXS_LIBEXEC"; then
197 AC_MSG_ERROR([APXS_LIBEXEC of $APXS_LIBEXEC does not exist])
199 AC_MSG_NOTICE([APXS_LIBEXEC is $APXS_LIBEXEC])
201 if test -z "$APXS_SYSCONFDIR"; then
202 if test -d "$APXS_PREFIX/conf"; then
203 APXS_SYSCONFDIR="$APXS_PREFIX/conf"
205 AC_MSG_ERROR([can't find Apache conf directory beneath $APXS_PREFIX])
207 elif ! test -d "$APXS_SYSCONFDIR"; then
208 AC_MSG_ERROR([APXS_SYSCONFDIR of $APXS_SYSCONFDIR does not exist])
210 AC_MSG_NOTICE([APXS_SYSCONFDIR is $APXS_SYSCONFDIR])
214 elif test -n "$APXS"; then
216 # extract settings we need from APXS -q
217 APXS_CC="`$APXS -q CC`"
218 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
219 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
220 APXS_LIBEXEC="`$APXS -q LIBEXECDIR`"
221 APXS_SYSCONFDIR="`$APXS -q SYSCONFDIR`"
224 AC_MSG_RESULT(found at $APXS)
226 if test -z "`$APXS -q LD_SHLIB`" || test "$APXS_LIBEXEC" = "modules"; then
228 [Your APXS installation is broken and cannot be used.
229 Please see http://www.webdav.org/mod_dav/install.html#apxs for
236 # guess we're not doing Apache 1.3
241 AM_CONDITIONAL(HAVE_APXS,test -n "$APXS")
243 if test "$WANT_APACHE" = "yes"; then
245 AC_HELP_STRING([--with-apreq=PATH], [where libapreq is installed]),
246 [if test x_$with_apreq != x_/usr; then
247 LDFLAGS="-L${with_apreq}/lib $LDFLAGS"
248 CPPFLAGS="-I${with_apreq}/include $CPPFLAGS"
251 AC_SUBST(APXS_CFLAGS)
252 AC_SUBST(APXS_INCLUDE)
253 AC_SUBST(APXS_LIBEXEC)
254 AC_SUBST(APXS_SYSCONFDIR)
256 # output the Apache 1.3 makefiles
257 WANT_SUBDIRS="$WANT_SUBDIRS mod_shire mod_shibrm"
258 AC_CONFIG_FILES([mod_shire/Makefile mod_shibrm/Makefile])
261 AC_SUBST(WANT_SUBDIRS)
263 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
264 echo "=================================================================="
265 echo "WARNING: You have chosen to compile Apache modules with a different"
266 echo " compiler than the one used to compile Apache."
268 echo " Current compiler: $CC"
269 echo " Apache's compiler: $APXS_CC"
271 echo "This could cause some problems."
272 echo "=================================================================="