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.

56 lines
1.6 KiB

11 years ago
11 years ago
  1. dnl Check to find the OpenSSL headers/libraries
  2. AC_DEFUN([ss_OPENSSL],
  3. [
  4. case $host_os in
  5. *mingw*)
  6. ;;
  7. *)
  8. AC_CHECK_FUNC(dlopen,
  9. [],
  10. [AC_CHECK_LIB(dl, dlopen,
  11. [LIBS="$LIBS -ldl"],
  12. [AC_MSG_ERROR([OpenSSL depends on libdl.]); break]
  13. )]
  14. )
  15. ;;
  16. esac
  17. AC_ARG_WITH(openssl,
  18. AS_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]),
  19. [openssl="$withval"
  20. CFLAGS="$CFLAGS -I$withval/include"
  21. LDFLAGS="$LDFLAGS -L$withval/lib"]
  22. )
  23. AC_ARG_WITH(openssl-include,
  24. AS_HELP_STRING([--with-openssl-include=DIR], [OpenSSL headers directory (without trailing /openssl)]),
  25. [openssl_include="$withval"
  26. CFLAGS="$CFLAGS -I$withval"]
  27. )
  28. AC_ARG_WITH(openssl-lib,
  29. AS_HELP_STRING([--with-openssl-lib=DIR], [OpenSSL library directory]),
  30. [openssl_lib="$withval"
  31. LDFLAGS="$LDFLAGS -L$withval"]
  32. )
  33. AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h openssl/engine.h,
  34. [],
  35. [AC_MSG_ERROR([OpenSSL header files not found.]); break]
  36. )
  37. AC_CHECK_LIB(crypto, EVP_EncryptInit_ex,
  38. [LIBS="-lcrypto $LIBS"],
  39. [AC_MSG_ERROR([OpenSSL libraries not found.])]
  40. )
  41. AC_CHECK_FUNCS([RAND_pseudo_bytes EVP_EncryptInit_ex], ,
  42. [AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
  43. )
  44. AC_CHECK_DECL([OpenSSL_add_all_algorithms], ,
  45. [AC_MSG_ERROR([Missing OpenSSL functionality, make sure you have installed the latest version.]); break],
  46. [#include <openssl/evp.h>]
  47. )
  48. ])