dnl $Id: configure.ac,v 1.4 2003/04/25 00:18:03 warlord Exp $ AC_PREREQ([2.50]) AC_INIT([shib-mysql-ccache], [0.9], [mace-shib-users@internet2.edu], [shib-mysql-ccache]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(shib-mysql-ccache, 0.9) sinclude(acx_pthread.m4) 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 strcasecmp]) 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 #################################################################### # Begin MySQL searches. mysql_dir="" AC_ARG_WITH(mysql, AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]), [if test "$with_mysql" = no ; then AC_MSG_ERROR(you need MySQL for this package. Sorry.) elif test "$with_mysql" != yes ; then mysql_dir="$with_mysql/bin" fi ]) # Try to find the mysql_config program AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH ) if test "$MYSQL_CONFIG" = no ; then AC_MSG_ERROR([cannot find mysql_config]) fi # Check to make sure we have MySQL >= 4.x.y mysql_version=`$MYSQL_CONFIG --version` mysql_major_version=`echo $mysql_version | awk -F. '{print $1}'` if test $mysql_major_version -lt 4 ; then AC_MSG_ERROR(You need MySQL version >= 4, found $mysql_version) fi # Now make sure we've got mysqld MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs` if test $? != 0 ; then AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.) fi MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags` MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS` MYSQL_LIBS=`eval echo $MYSQL_LIBS` # Now test that we can actually build with MySQL save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS" AC_CHECK_HEADER([mysql.h],,AC_MSG_ERROR([unable to find MySQL header files])) save_LIBS="$LIBS" LIBS="$LIBS $MYSQL_LIBS" AC_TRY_LINK( [#include ], [mysql_server_init(0, NULL, NULL)], [AC_DEFINE(HAVE_MYSQLD,1,[Define if MySQL Embedded Server library was found])], [AC_MSG_ERROR([unable to link with MySQL Embedded Server Library]) ]) CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" AC_SUBST(MYSQL_CFLAGS) AC_SUBST(MYSQL_LIBS) #################################################################### AC_ARG_WITH(dmalloc, AC_HELP_STRING([--with-dmalloc=PATH], [where dmalloc is installed]), [if test x_$with_dmalloc != x_/usr; then LDFLAGS="-L${with_dmalloc}/lib $LDFLAGS" CPPFLAGS="-I${with_dmalloc}/include $CPPFLAGS" fi AC_CHECK_LIB(dmallocxx, dmalloc_shutdown,, AC_MSG_ERROR([unable to find dmallocxx library])) ]) 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(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_ARG_WITH(saml, AC_HELP_STRING([--with-saml=PATH], [where saml is installed]), [if test x_$with_saml != x_/usr; then LDFLAGS="-L${with_saml}/lib $LDFLAGS" CPPFLAGS="-I${with_saml}/include $CPPFLAGS" fi]) AC_ARG_WITH(shibboleth, AC_HELP_STRING([--with-shibboleth=PATH], [where shibboleth is installed]), [if test x_$with_shibboleth != x_/usr; then LDFLAGS="-L${with_shibboleth}/lib $LDFLAGS" CPPFLAGS="-I${with_shibboleth}/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([log4cpp/Category.hh],, AC_MSG_ERROR([unable to find log4cpp header files])) AC_CHECK_HEADER([saml/saml.h],, AC_MSG_ERROR([unable to find saml header files])) AC_CHECK_HEADER([shib/shib.h],, AC_MSG_ERROR([unable to find shib header files])) AC_CHECK_HEADER([shib-target/shib-target.h],, AC_MSG_ERROR([unable to find shib-target 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" ]) 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" ]) saved_LIBS="$LIBS" LIBS="-lsaml $LIBS" AC_TRY_LINK( [#include ], [saml::SAMLConfig::getConfig()], [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])], [AC_MSG_ERROR([unable to link with saml]) LIBS="$saved_LIBS" ]) saved_LIBS="$LIBS" LIBS="-lshib $LIBS" AC_TRY_LINK( [#include ], [shibboleth::ShibConfig::getConfig()], [AC_DEFINE(HAVE_SHIB,1,[Define if shib library was found])], [AC_MSG_ERROR([unable to link with shibboleth]) LIBS="$saved_LIBS" ]) saved_LIBS="$LIBS" LIBS="-lshib-target $LIBS" AC_TRY_LINK( [#include ], [shibtarget::ShibTargetConfig::preinit()], [AC_DEFINE(HAVE_SHIB,1,[Define if shib-target library was found])], [AC_MSG_ERROR([unable to link with shib-target]) LIBS="$saved_LIBS" ]) # output the underlying makefiles AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT