sasl.m4 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # BEGIN COPYRIGHT BLOCK
  2. # Copyright (C) 2007 Red Hat, Inc.
  3. # All rights reserved.
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License
  7. # as published by the Free Software Foundation; either version 2
  8. # of the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. #
  19. # END COPYRIGHT BLOCK
  20. # -*- tab-width: 4; -*-
  21. # Configure paths for SASL
  22. dnl ========================================================
  23. dnl = sasl is used to support various authentication mechanisms
  24. dnl = such as DIGEST-MD5 and GSSAPI.
  25. dnl ========================================================
  26. dnl ========================================================
  27. dnl = Use the sasl libraries on the system (assuming it exists)
  28. dnl ========================================================
  29. AC_CHECKING(for sasl)
  30. AC_MSG_CHECKING(for --with-sasl)
  31. AC_ARG_WITH(sasl,
  32. [[ --with-sasl=PATH Use sasl from supplied path]],
  33. dnl = Look in the standard system locations
  34. [
  35. if test "$withval" = "yes"; then
  36. AC_MSG_RESULT(yes)
  37. dnl = Check for sasl.h in the normal locations
  38. if test -f /usr/include/sasl/sasl.h; then
  39. sasl_inc="-I/usr/include/sasl"
  40. elif test -f /usr/include/sasl.h; then
  41. sasl_inc="-I/usr/include"
  42. else
  43. AC_MSG_ERROR(sasl.h not found)
  44. fi
  45. dnl = Check the user provided location
  46. elif test -d "$withval" -a -d "$withval/lib" -a -d "$withval/include" ; then
  47. AC_MSG_RESULT([using $withval])
  48. if test -f "$withval/include/sasl/sasl.h"; then
  49. sasl_inc="-I$withval/include/sasl"
  50. elif test -f "$withval/include/sasl.h"; then
  51. sasl_inc="-I$withval/include"
  52. else
  53. AC_MSG_ERROR(sasl.h not found)
  54. fi
  55. sasl_lib="-L$withval/lib"
  56. sasl_libdir="$withval/lib"
  57. else
  58. AC_MSG_RESULT(yes)
  59. AC_MSG_ERROR([sasl not found in $withval])
  60. fi
  61. ],
  62. AC_MSG_RESULT(no))
  63. AC_MSG_CHECKING(for --with-sasl-inc)
  64. AC_ARG_WITH(sasl-inc,
  65. [[ --with-sasl-inc=PATH SASL include file directory]],
  66. [
  67. if test -f "$withval"/sasl.h; then
  68. AC_MSG_RESULT([using $withval])
  69. sasl_inc="-I$withval"
  70. else
  71. echo
  72. AC_MSG_ERROR([$withval/sasl.h not found])
  73. fi
  74. ],
  75. AC_MSG_RESULT(no))
  76. AC_MSG_CHECKING(for --with-sasl-lib)
  77. AC_ARG_WITH(sasl-lib,
  78. [[ --with-sasl-lib=PATH SASL library directory]],
  79. [
  80. if test -d "$withval"; then
  81. AC_MSG_RESULT([using $withval])
  82. sasl_lib="-L$withval"
  83. sasl_libdir="$withval"
  84. else
  85. echo
  86. AC_MSG_ERROR([$withval not found])
  87. fi
  88. ],
  89. AC_MSG_RESULT(no))
  90. if test -z "$sasl_inc"; then
  91. AC_MSG_CHECKING(for sasl.h)
  92. dnl - Check for sasl in standard system locations
  93. if test -f /usr/include/sasl/sasl.h; then
  94. AC_MSG_RESULT([using /usr/include/sasl/sasl.h])
  95. sasl_inc="-I/usr/include/sasl"
  96. elif test -f /usr/include/sasl.h; then
  97. AC_MSG_RESULT([using /usr/include/sasl.h])
  98. sasl_inc="-I/usr/include"
  99. else
  100. AC_MSG_RESULT(no)
  101. AC_MSG_ERROR([sasl not found, specify with --with-sasl.])
  102. fi
  103. fi