pandora_sasl.m4 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. dnl Copyright (C) 2009 Sun Microsystems, Inc.
  2. dnl This file is free software; Sun Microsystems, Inc.
  3. dnl gives unlimited permission to copy and/or distribute it,
  4. dnl with or without modifications, as long as this notice is preserved.
  5. AC_DEFUN([_PANDORA_SEARCH_SASL],[
  6. AC_REQUIRE([AC_LIB_PREFIX])
  7. dnl --------------------------------------------------------------------
  8. dnl Check for sasl
  9. dnl --------------------------------------------------------------------
  10. AC_ARG_ENABLE([sasl],
  11. [AS_HELP_STRING([--disable-sasl],
  12. [Build with sasl support @<:@default=on@:>@])],
  13. [ac_enable_sasl="$enableval"],
  14. [ac_enable_sasl="yes"])
  15. AS_IF([test "x$ac_enable_sasl" = "xyes"],
  16. [
  17. AC_LIB_HAVE_LINKFLAGS(sasl,,[
  18. #include <stdlib.h>
  19. #include <sasl/sasl.h>
  20. ],[
  21. sasl_server_init(NULL, NULL);
  22. ])
  23. AS_IF([test "x${ac_cv_libsasl}" != "xyes" ],
  24. [
  25. AC_LIB_HAVE_LINKFLAGS(sasl2,,[
  26. #include <stdlib.h>
  27. #include <sasl/sasl.h>
  28. ],[
  29. sasl_server_init(NULL, NULL);
  30. ])
  31. HAVE_LIBSASL="$HAVE_LIBSASL2"
  32. LIBSASL="$LIBSASL2"
  33. LIBSASL_PREFIX="$LIBSASL2_PREFIX"
  34. LTLIBSASL="$LT_LIBSASL2"
  35. ])
  36. ])
  37. AS_IF([test "x${ac_cv_libsasl}" = "xyes" -o "x${ac_cv_libsasl2}" = "xyes"],
  38. [ac_cv_sasl=yes],
  39. [ac_cv_sasl=no])
  40. AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
  41. AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
  42. AM_CONDITIONAL(HAVE_SASL, [test "x${ac_cv_sasl}" = "xyes"])
  43. ])
  44. AC_DEFUN([PANDORA_HAVE_SASL],[
  45. AC_REQUIRE([_PANDORA_SEARCH_SASL])
  46. ])
  47. AC_DEFUN([PANDORA_REQUIRE_SASL],[
  48. AC_REQUIRE([_PANDORA_SEARCH_SASL])
  49. AS_IF([test "x${ac_cv_sasl}" = "xno"],
  50. PANDORA_MSG_ERROR([SASL (libsasl or libsasl2) is required for ${PACKAGE}]))
  51. ])
  52. AC_DEFUN([_PANDORA_SEARCH_LIBSASL],[
  53. AC_REQUIRE([AC_LIB_PREFIX])
  54. dnl --------------------------------------------------------------------
  55. dnl Check for libsasl
  56. dnl --------------------------------------------------------------------
  57. AC_ARG_ENABLE([libsasl],
  58. [AS_HELP_STRING([--disable-libsasl],
  59. [Build with libsasl support @<:@default=on@:>@])],
  60. [ac_enable_libsasl="$enableval"],
  61. [ac_enable_libsasl="yes"])
  62. AS_IF([test "x$ac_enable_libsasl" = "xyes"],[
  63. AC_LIB_HAVE_LINKFLAGS(sasl,,[
  64. #include <stdlib.h>
  65. #include <sasl/sasl.h>
  66. ],[
  67. sasl_server_init(NULL, NULL);
  68. ])
  69. ],[
  70. ac_cv_libsasl="no"
  71. ])
  72. AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
  73. ])
  74. AC_DEFUN([PANDORA_HAVE_LIBSASL],[
  75. AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
  76. ])
  77. AC_DEFUN([PANDORA_REQUIRE_LIBSASL],[
  78. AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
  79. AS_IF([test "x${ac_cv_libsasl}" = "xno"],
  80. PANDORA_MSG_ERROR([libsasl is required for ${PACKAGE}]))
  81. ])
  82. AC_DEFUN([_PANDORA_SEARCH_LIBSASL2],[
  83. AC_REQUIRE([AC_LIB_PREFIX])
  84. dnl --------------------------------------------------------------------
  85. dnl Check for libsasl2
  86. dnl --------------------------------------------------------------------
  87. AC_ARG_ENABLE([libsasl2],
  88. [AS_HELP_STRING([--disable-libsasl2],
  89. [Build with libsasl2 support @<:@default=on@:>@])],
  90. [ac_enable_libsasl2="$enableval"],
  91. [ac_enable_libsasl2="yes"])
  92. AS_IF([test "x$ac_enable_libsasl2" = "xyes"],[
  93. AC_LIB_HAVE_LINKFLAGS(sasl2,,[
  94. #include <stdlib.h>
  95. #include <sasl2/sasl2.h>
  96. ],[
  97. sasl2_server_init(NULL, NULL);
  98. ])
  99. ],[
  100. ac_cv_libsasl2="no"
  101. ])
  102. AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
  103. ])
  104. AC_DEFUN([PANDORA_HAVE_LIBSASL2],[
  105. AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
  106. ])
  107. AC_DEFUN([PANDORA_REQUIRE_LIBSASL2],[
  108. AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
  109. AS_IF([test "x${ac_cv_libsasl2}" = "xno"],
  110. PANDORA_MSG_ERROR([libsasl2 is required for ${PACKAGE}]))
  111. ])