AC_PREREQ([2.50]) AC_INIT([opensaml], [0.9.1], [mace-opensaml-users@internet2.edu], [saml]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(opensaml, 0.9.1) sinclude(acx_pthread.m4) # check for sun's compiler first AC_PROG_CC([gcc3 gcc cc]) AC_PROG_CXX([g++3 g++ c++ CC]) AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_LANG(C++) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM # Checks for library functions. AC_FUNC_STRFTIME AC_CHECK_FUNCS([strchr strdup strstr gmtime_r]) AC_CHECK_HEADERS([dlfcn.h]) # C++ requirements AC_CXX_REQUIRE_STL AC_CXX_NAMESPACES # checks for pthreads ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"]) if test $enable_threads != "pthread"; then AC_MSG_ERROR([unable to find pthreads, currently this is required]) else AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]) LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$PTHREAD_CFLAGS $CFLAGS" CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS" fi AC_ARG_WITH(xerces, AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]), [if test x_$with_xerces != x_/usr; then LDFLAGS="-L${with_xerces}/lib $LDFLAGS" CPPFLAGS="-I${with_xerces}/include $CPPFLAGS" fi]) AC_ARG_WITH(openssl, AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]), [if test x_$with_openssl != x_/usr; then LDFLAGS="-L${with_openssl}/lib $LDFLAGS" CPPFLAGS="-I${with_openssl}/include $CPPFLAGS" fi]) AC_ARG_WITH(curl, AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]), [if test x_$with_curl != x_/usr; then LDFLAGS="-L${with_curl}/lib $LDFLAGS" CPPFLAGS="-I${with_curl}/include $CPPFLAGS" fi]) AC_ARG_WITH(log4cpp, AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]), [if test x_$with_log4cpp != x_/usr; then LDFLAGS="-L${with_log4cpp}/lib $LDFLAGS" CPPFLAGS="-I${with_log4cpp}/include $CPPFLAGS" fi]) AC_ARG_WITH(xmlsec, AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]), [if test x_$with_xmlsec != x_/usr; then LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS" CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS" fi]) AC_CHECK_HEADER([xercesc/dom/DOM.hpp],, AC_MSG_ERROR([unable to find xerces header files])) saved_LIBS="$LIBS" LIBS="-lxerces-c $LIBS" AC_TRY_LINK( [#include ], [xercesc::XMLPlatformUtils::Initialize()], [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])], [AC_MSG_ERROR([unable to link with Xerces]) LIBS="$saved_LIBS" ]) AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR([unable to find openssl header files])) AC_CHECK_LIB([crypto], [ERR_load_CRYPTO_strings],, AC_MSG_ERROR([unable to link with openssl libraries])) AC_CHECK_LIB([ssl], [SSL_library_init],, AC_MSG_ERROR([unable to link with openssl libraries])) AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],, AC_MSG_ERROR([unable to find xsec header files])) saved_LIBS="$LIBS" LIBS="-lxml-security-c $LIBS" AC_TRY_LINK( [#include ], [XSECPlatformUtils::Initialise()], [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])], [AC_MSG_ERROR([unable to link with XML-Sec]) LIBS="$saved_LIBS" ]) AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR([unable to find libcurl header files])) AC_CHECK_LIB([curl], [curl_global_init],, AC_MSG_ERROR([unable to link with libcurl])) AC_MSG_CHECKING([for CURLOPT_NOSIGNAL in curl.h]) AC_EGREP_HEADER([CURLOPT_NOSIGNAL], [curl/curl.h], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_CURLOPT_NOSIGNAL, 1, [Define if Curl has CURLOPT_NOSIGNAL])], [AC_MSG_RESULT(no)]) AC_CHECK_HEADER([log4cpp/Category.hh],, AC_MSG_ERROR([unable to find log4cpp header files])) saved_LIBS="$LIBS" LIBS="-llog4cpp $LIBS" AC_TRY_LINK( [#include ], [log4cpp::Category::getInstance("foo")], [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])], [AC_MSG_ERROR([unable to link with log4cpp]) LIBS="$saved_LIBS" ]) # output makefiles AC_OUTPUT(Makefile doc/Makefile saml/Makefile test/Makefile schemas/Makefile)