sasl.m4 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # -*- tab-width: 4; -*-
  2. # Configure paths for SASL
  3. # Public domain - Nathan Kinder <[email protected]> 2006-06-26
  4. # Based upon svrcore.m4 (also PD) by Rich Megginson <[email protected]>
  5. dnl ========================================================
  6. dnl = sasl is used to support various authentication mechanisms
  7. dnl = such as DIGEST-MD5 and GSSAPI.
  8. dnl ========================================================
  9. dnl ========================================================
  10. dnl = Use the sasl libraries on the system (assuming it exists)
  11. dnl ========================================================
  12. AC_CHECKING(for sasl)
  13. AC_MSG_CHECKING(for --with-sasl)
  14. AC_ARG_WITH(sasl,
  15. [[ --with-sasl=PATH Use sasl from supplied path]],
  16. dnl = Look in the standard system locations
  17. [
  18. if test "$withval" = "yes"; then
  19. AC_MSG_RESULT(yes)
  20. dnl = Check for sasl.h in the normal locations
  21. if test -f /usr/include/sasl/sasl.h; then
  22. sasl_inc="-I/usr/include/sasl"
  23. elif test -f /usr/include/sasl.h; then
  24. sasl_inc="-I/usr/include"
  25. else
  26. AC_MSG_ERROR(sasl.h not found)
  27. fi
  28. dnl = Check the user provided location
  29. elif test -d "$withval" -a -d "$withval/lib" -a -d "$withval/include" ; then
  30. AC_MSG_RESULT([using $withval])
  31. if test -f "$withval/include/sasl/sasl.h"; then
  32. sasl_inc="-I$withval/include/sasl"
  33. elif test -f "$withval/include/sasl.h"; then
  34. sasl_inc="-I$withval/include"
  35. else
  36. AC_MSG_ERROR(sasl.h not found)
  37. fi
  38. sasl_lib="-L$withval/lib"
  39. sasl_libdir="$withval/lib"
  40. else
  41. AC_MSG_RESULT(yes)
  42. AC_MSG_ERROR([sasl not found in $withval])
  43. fi
  44. ],
  45. AC_MSG_RESULT(no))
  46. AC_MSG_CHECKING(for --with-sasl-inc)
  47. AC_ARG_WITH(sasl-inc,
  48. [[ --with-sasl-inc=PATH SASL include file directory]],
  49. [
  50. if test -f "$withval"/sasl.h; then
  51. AC_MSG_RESULT([using $withval])
  52. sasl_inc="-I$withval"
  53. else
  54. echo
  55. AC_MSG_ERROR([$withval/sasl.h not found])
  56. fi
  57. ],
  58. AC_MSG_RESULT(no))
  59. AC_MSG_CHECKING(for --with-sasl-lib)
  60. AC_ARG_WITH(sasl-lib,
  61. [[ --with-sasl-lib=PATH SASL library directory]],
  62. [
  63. if test -d "$withval"; then
  64. AC_MSG_RESULT([using $withval])
  65. sasl_lib="-L$withval"
  66. sasl_libdir="$withval"
  67. else
  68. echo
  69. AC_MSG_ERROR([$withval not found])
  70. fi
  71. ],
  72. AC_MSG_RESULT(no))
  73. if test -z "$sasl_inc"; then
  74. AC_MSG_CHECKING(for sasl.h)
  75. dnl - Check for sasl in standard system locations
  76. if test -f /usr/include/sasl/sasl.h; then
  77. AC_MSG_RESULT([using /usr/include/sasl/sasl.h])
  78. sasl_inc="-I/usr/include/sasl"
  79. elif test -f /usr/include/sasl.h; then
  80. AC_MSG_RESULT([using /usr/include/sasl.h])
  81. sasl_inc="-I/usr/include"
  82. else
  83. AC_MSG_RESULT(no)
  84. AC_MSG_ERROR([sasl not found, specify with --with-sasl.])
  85. fi
  86. fi