dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT([hermes], [1.7], [juanjo@gutierrezdequevedo.com]) dnl AC_CONFIG_AUX_DIR=([./config]) AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([1.7.8 foreign]) AC_PROG_CXX AC_PROG_INSTALL dnl dnl check libraries and functions dnl AC_CHECK_FUNCS(getaddrinfo gai_strerror) PKG_CHECK_MODULES(SQLite3, sqlite3, [], AC_MSG_ERROR("sqlite3 is required")) PKG_CHECK_MODULES(OpenSSL, openssl, have_ssl=yes, have_ssl=no) AC_CHECK_LIB(spf2,SPF_server_new, have_spf=yes, have_spf=no) dnl dnl end of libraries and functions dnl dnl dnl check parameters dnl AC_ARG_WITH(logger-module, [ --with-logger-module=module Module to log errors with. module is one of unix, file or null. default=unix], [loggermodule=$withval], [loggermodule=unix] ) if test "$loggermodule" = unix; then AC_DEFINE(LOGGER_CLASS,UnixLogger) fi if test "$loggermodule" = file; then AC_DEFINE(LOGGER_CLASS,FileLogger) fi if test "$loggermodule" = null; then AC_DEFINE(LOGGER_CLASS,NullLogger,[Define what logger we are using]) fi AC_ARG_ENABLE(openssl, [ --enable-openssl Enable OpenSSL support ], [ if test x$enableval = xyes; then if test x$have_ssl = xno; then AC_MSG_ERROR("OpenSSL support requested but not detected") fi have_ssl=yes else have_ssl=no fi ] ) AC_ARG_ENABLE(spf, [ --enable-spf Enable SPF support ], [ if test x$enableval = xyes; then if test x$have_spf = xno; then AC_MSG_ERROR("SPF support requested but not detected") fi have_spf=yes else have_spf=no fi ] ) win32_service=no AC_ARG_ENABLE(win32-service, [ --enable-win32-service Enable win32 service support ], [ if test x$enableval = xyes; then win32_service=yes fi ] ) dnl dnl end of parameters check dnl dnl dnl config.h variables dnl if test x$have_ssl = xyes; then AC_DEFINE(HAVE_SSL,1,[Defined if using openssl for SSL support]) fi if test x$have_spf = xyes; then AC_DEFINE(HAVE_SPF,1,[Defined if system has libspf2]) fi if test x$win32_service = xyes; then AC_DEFINE(WIN32_SERVICE,1,[Defined if we want to compile win32 service support]) fi dnl dnl end of config.h variables dnl dnl dnl conditionals for makefiles dnl AM_CONDITIONAL(HAVE_SPF, test "$have_spf" = yes) AM_CONDITIONAL(LOGGER_UNIX, test "$loggermodule" = unix) AM_CONDITIONAL(LOGGER_NULL, test "$loggermodule" = null) AM_CONDITIONAL(LOGGER_FILE, test "$loggermodule" = file) AM_CONDITIONAL(WIN32_SERVICE, test "$win32_service" = yes) dnl dnl end of conditionals for makefiles dnl AC_CONFIG_FILES([Makefile src/Makefile docs/Makefile dists/Makefile dists/hermes.spec]) AC_OUTPUT echo echo echo "Configuration for $PACKAGE_STRING" echo echo " SSL: $have_ssl" echo " SPF: $have_spf" echo " Logger: $loggermodule" echo " Win32: $win32_service" echo