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.

43 lines
1.3 KiB

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