2
0

libgcrypt.m4 940 B

123456789101112131415161718192021222324252627282930313233
  1. dnl Check to find the libgcrypt headers/libraries
  2. AC_DEFUN([tinc_LIBGCRYPT],
  3. [
  4. AC_ARG_WITH(libgcrypt,
  5. AS_HELP_STRING([--with-libgcrypt=DIR], [libgcrypt base directory, or:]),
  6. [libgcrypt="$withval"
  7. CPPFLAGS="$CPPFLAGS -I$withval/include"
  8. LDFLAGS="$LDFLAGS -L$withval/lib"]
  9. )
  10. AC_ARG_WITH(libgcrypt-include,
  11. AS_HELP_STRING([--with-libgcrypt-include=DIR], [libgcrypt headers directory (without trailing /libgcrypt)]),
  12. [libgcrypt_include="$withval"
  13. CPPFLAGS="$CPPFLAGS -I$withval"]
  14. )
  15. AC_ARG_WITH(libgcrypt-lib,
  16. AS_HELP_STRING([--with-libgcrypt-lib=DIR], [libgcrypt library directory]),
  17. [libgcrypt_lib="$withval"
  18. LDFLAGS="$LDFLAGS -L$withval"]
  19. )
  20. AC_CHECK_HEADERS([gcrypt.h],
  21. [],
  22. [AC_MSG_ERROR([libgcrypt header files not found.]); break]
  23. )
  24. AC_CHECK_LIB(gcrypt, gcry_cipher_encrypt,
  25. [LIBS="-lgcrypt $LIBS"],
  26. [AC_MSG_ERROR([libgcrypt libraries not found.])]
  27. )
  28. ])