configure.in 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.57)
  3. AC_INIT([hermes], [1.9], [juanjo@gutierrezdequevedo.com])
  4. dnl AC_CONFIG_AUX_DIR=([./config])
  5. AM_CONFIG_HEADER([config.h])
  6. AM_INIT_AUTOMAKE([1.7.8 foreign])
  7. AC_PROG_CXX
  8. AC_PROG_INSTALL
  9. dnl
  10. dnl check libraries and functions
  11. dnl
  12. AC_CHECK_FUNCS(getaddrinfo gai_strerror)
  13. PKG_CHECK_MODULES(SQLite3, sqlite3, [], AC_MSG_ERROR("sqlite3 is required"))
  14. PKG_CHECK_MODULES(OpenSSL, openssl, have_ssl=yes, have_ssl=no)
  15. AC_CHECK_LIB(spf2,SPF_server_new, have_spf=yes, have_spf=no)
  16. dnl
  17. dnl end of libraries and functions
  18. dnl
  19. dnl
  20. dnl check parameters
  21. dnl
  22. AC_ARG_WITH(logger-module,
  23. [ --with-logger-module=module Module to log errors with. module is one of unix, file or null. default=unix],
  24. [loggermodule=$withval],
  25. [loggermodule=unix]
  26. )
  27. if test "$loggermodule" = unix; then
  28. AC_DEFINE(LOGGER_CLASS,UnixLogger)
  29. fi
  30. if test "$loggermodule" = file; then
  31. AC_DEFINE(LOGGER_CLASS,FileLogger)
  32. fi
  33. if test "$loggermodule" = null; then
  34. AC_DEFINE(LOGGER_CLASS,NullLogger,[Define what logger we are using])
  35. fi
  36. AC_ARG_ENABLE(openssl,
  37. [ --enable-openssl Enable OpenSSL support ],
  38. [
  39. if test x$enableval = xyes; then
  40. if test x$have_ssl = xno; then
  41. AC_MSG_ERROR("OpenSSL support requested but not detected")
  42. fi
  43. have_ssl=yes
  44. else
  45. have_ssl=no
  46. fi
  47. ]
  48. )
  49. AC_ARG_ENABLE(spf,
  50. [ --enable-spf Enable SPF support ],
  51. [
  52. if test x$enableval = xyes; then
  53. if test x$have_spf = xno; then
  54. AC_MSG_ERROR("SPF support requested but not detected")
  55. fi
  56. have_spf=yes
  57. else
  58. have_spf=no
  59. fi
  60. ]
  61. )
  62. win32_service=no
  63. AC_ARG_ENABLE(win32-service,
  64. [ --enable-win32-service Enable win32 service support ],
  65. [
  66. if test x$enableval = xyes; then
  67. win32_service=yes
  68. fi
  69. ]
  70. )
  71. dnl
  72. dnl end of parameters check
  73. dnl
  74. dnl
  75. dnl config.h variables
  76. dnl
  77. if test x$have_ssl = xyes; then
  78. AC_DEFINE(HAVE_SSL,1,[Defined if using openssl for SSL support])
  79. fi
  80. if test x$have_spf = xyes; then
  81. AC_DEFINE(HAVE_SPF,1,[Defined if system has libspf2])
  82. fi
  83. if test x$win32_service = xyes; then
  84. AC_DEFINE(WIN32_SERVICE,1,[Defined if we want to compile win32 service support])
  85. fi
  86. dnl
  87. dnl end of config.h variables
  88. dnl
  89. dnl
  90. dnl conditionals for makefiles
  91. dnl
  92. AM_CONDITIONAL(HAVE_SPF, test "$have_spf" = yes)
  93. AM_CONDITIONAL(LOGGER_UNIX, test "$loggermodule" = unix)
  94. AM_CONDITIONAL(LOGGER_NULL, test "$loggermodule" = null)
  95. AM_CONDITIONAL(LOGGER_FILE, test "$loggermodule" = file)
  96. AM_CONDITIONAL(WIN32_SERVICE, test "$win32_service" = yes)
  97. dnl
  98. dnl end of conditionals for makefiles
  99. dnl
  100. AC_CONFIG_FILES([Makefile src/Makefile docs/Makefile dists/Makefile dists/hermes.spec])
  101. AC_OUTPUT
  102. echo
  103. echo
  104. echo "Configuration for $PACKAGE_STRING"
  105. echo
  106. echo " SSL: $have_ssl"
  107. echo " SPF: $have_spf"
  108. echo " Logger: $loggermodule"
  109. echo " Win32: $win32_service"
  110. echo