ax_check_wolfssl.m4 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # ===========================================================================
  2. # http://www.gnu.org/software/autoconf-archive/ax_check_wolfssl.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_WOLFSSL([action-if-found],[action-if-not-found])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Look for WolfSSL (formerly CyaSSL) in a number of default spots, or in a
  12. # user-selected spot (via --with-wolfssl). Sets
  13. #
  14. # WOLFSSL_CPPFLAGS
  15. # WOLFSSL_LIB
  16. # WOLFSSL_LDFLAGS
  17. #
  18. # and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
  19. #
  20. # LICENSE
  21. #
  22. # Copyright (c) 2013 Brian Aker. <brian@tangent.com>
  23. #
  24. # Copying and distribution of this file, with or without modification, are
  25. # permitted in any medium without royalty provided the copyright notice
  26. # and this notice are preserved. This file is offered as-is, without any
  27. # warranty.
  28. #serial 1
  29. AC_DEFUN([AX_CHECK_WOLFSSL],
  30. [AC_PREREQ([2.63])dnl
  31. m4_define([_WOLFSSL_ENABLE_DEFAULT], [m4_if($1, yes, yes, yes)])dnl
  32. AC_ARG_ENABLE([wolfssl],
  33. [AS_HELP_STRING([--enable-wolfssl],
  34. [Enable ssl support for Gearman @<:@default=]_WOLFSSL_ENABLE_DEFAULT[@:>@])],
  35. [AS_CASE([$enableval],
  36. [yes],[enable_wolfssl=yes],
  37. [no],[enable_wolfssl=no],
  38. [enable_wolfssl=no])
  39. ],
  40. [enable_wolfssl=]_WOLFSSL_ENABLE_DEFAULT)
  41. AS_IF([test "x${enable_wolfssl}" = "xyes"],
  42. [AX_CHECK_LIBRARY([WOLFSSL],[wolfssl/ssl.h],[wolfssl],[],
  43. [enable_wolfssl=no])])
  44. AS_IF([test "x${enable_wolfssl}" = "xyes"],
  45. [AC_MSG_RESULT([yes])
  46. $1],
  47. [AC_MSG_RESULT([no])
  48. $2
  49. ])
  50. ])