Collection of DPF-based plugins for packaging
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.

76 lines
2.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_lib_beecrypt.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_LIB_BEECRYPT([yes|no|auto])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Searches for the 'beecrypt' library with the --with... option.
  12. #
  13. # If found, define HAVE_BEECRYPT and macro BEECRYPT_LIBS. Also defines
  14. # BEECRYPT_WITH_<algo> for the algorithms found available. Possible
  15. # algorithms: BASE64 AES BF MD5 SHA1 SHA256 SHA384 SHA512.
  16. #
  17. # The argument is used if no --with...-beecrypt option is set. Value "yes"
  18. # requires the configuration by default. Value "no" does not require it by
  19. # default. Value "auto" configures the library only if available.
  20. #
  21. # See also AX_LIB_CRYPTO and AX_LIB_GCRYPT.
  22. #
  23. # LICENSE
  24. #
  25. # Copyright (c) 2009 Fabien Coelho <autoconf.archive@coelho.net>
  26. #
  27. # Copying and distribution of this file, with or without modification, are
  28. # permitted in any medium without royalty provided the copyright notice
  29. # and this notice are preserved. This file is offered as-is, without any
  30. # warranty.
  31. #serial 10
  32. # AX_CHECK_BEECRYPT_ALGO([name],[function])
  33. AC_DEFUN([AX_CHECK_BEECRYPT_ALGO],[
  34. AC_CHECK_LIB([beecrypt], [$2],
  35. AC_DEFINE([BEECRYPT_WITH_$1],[1],[Algorithm $1 in beecrypt library]))
  36. ])
  37. # AX_LIB_BEECRYPT([yes|no|auto])
  38. AC_DEFUN([AX_LIB_BEECRYPT],[
  39. AC_MSG_CHECKING([whether beecrypt is enabled])
  40. AC_ARG_WITH([beecrypt],[ --with-beecrypt require beecrypt library
  41. --without-beecrypt disable beecrypt library],[
  42. AC_MSG_RESULT([$withval])
  43. ac_with_beecrypt=$withval
  44. ],[
  45. AC_MSG_RESULT([$1])
  46. ac_with_beecrypt=$1
  47. ])
  48. if test "$ac_with_beecrypt" = "yes" -o "$ac_with_beecrypt" = "auto" ; then
  49. AC_CHECK_HEADERS([beecrypt/beecrypt.h],[
  50. AC_CHECK_LIB([beecrypt],[blockCipherFind],[
  51. AC_DEFINE([HAVE_BEECRYPT],[1],[Beecrypt library is available])
  52. HAVE_BEECRYPT=1
  53. AC_SUBST([BEECRYPT_LIBS],[-lbeecrypt])
  54. # encoding
  55. AX_CHECK_BEECRYPT_ALGO([BASE64],[b64encode])
  56. # ciphers
  57. AX_CHECK_BEECRYPT_ALGO([AES],[aesSetup])
  58. AX_CHECK_BEECRYPT_ALGO([BF],[blowfishSetup])
  59. # digests
  60. AX_CHECK_BEECRYPT_ALGO([MD5],[md5Digest])
  61. AX_CHECK_BEECRYPT_ALGO([SHA1],[sha1Digest])
  62. AX_CHECK_BEECRYPT_ALGO([SHA256],[sha256Digest])
  63. AX_CHECK_BEECRYPT_ALGO([SHA384],[sha384Digest])
  64. AX_CHECK_BEECRYPT_ALGO([SHA512],[sha512Digest])
  65. ])
  66. ])
  67. # complain only if explicitly required
  68. if test "$ac_with_beecrypt" = "yes" -a "x$HAVE_BEECRYPT" = "x" ; then
  69. AC_MSG_ERROR([cannot configure required beecrypt library])
  70. fi
  71. fi
  72. ])