You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

  1. dnl Check to find the PolarSSL headers/libraries
  2. AC_DEFUN([ss_POLARSSL],
  3. [
  4. AC_ARG_WITH(polarssl,
  5. AS_HELP_STRING([--with-polarssl=DIR], [PolarSSL base directory, or:]),
  6. [polarssl="$withval"
  7. CFLAGS="$CFLAGS -I$withval/include"
  8. LDFLAGS="$LDFLAGS -L$withval/lib"]
  9. )
  10. AC_ARG_WITH(polarssl-include,
  11. AS_HELP_STRING([--with-polarssl-include=DIR], [PolarSSL headers directory (without trailing /polarssl)]),
  12. [polarssl_include="$withval"
  13. CFLAGS="$CFLAGS -I$withval"]
  14. )
  15. AC_ARG_WITH(polarssl-lib,
  16. AS_HELP_STRING([--with-polarssl-lib=DIR], [PolarSSL library directory]),
  17. [polarssl_lib="$withval"
  18. LDFLAGS="$LDFLAGS -L$withval"]
  19. )
  20. AC_CHECK_LIB(polarssl, cipher_init_ctx,
  21. [LIBS="-lpolarssl $LIBS"],
  22. [AC_MSG_ERROR([PolarSSL libraries not found.])]
  23. )
  24. AC_MSG_CHECKING([polarssl version])
  25. AC_COMPILE_IFELSE(
  26. [AC_LANG_PROGRAM(
  27. [[
  28. #include <polarssl/version.h>
  29. ]],
  30. [[
  31. #if POLARSSL_VERSION_NUMBER < 0x01020500
  32. #error invalid version
  33. #endif
  34. ]]
  35. )],
  36. [AC_MSG_RESULT([ok])],
  37. [AC_MSG_ERROR([PolarSSL 1.2.5 or newer required])]
  38. )
  39. ])