guix.m4 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. dnl GNU Guix --- Functional package management for GNU
  2. dnl Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
  3. dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
  4. dnl
  5. dnl This file is part of GNU Guix.
  6. dnl
  7. dnl GNU Guix is free software; you can redistribute it and/or modify it
  8. dnl under the terms of the GNU General Public License as published by
  9. dnl the Free Software Foundation; either version 3 of the License, or (at
  10. dnl your option) any later version.
  11. dnl
  12. dnl GNU Guix is distributed in the hope that it will be useful, but
  13. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  14. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. dnl GNU General Public License for more details.
  16. dnl
  17. dnl You should have received a copy of the GNU General Public License
  18. dnl along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. dnl GUIX_ASSERT_LIBGCRYPT_USABLE
  20. dnl
  21. dnl Assert that GNU libgcrypt is usable from Guile.
  22. AC_DEFUN([GUIX_ASSERT_LIBGCRYPT_USABLE],
  23. [AC_CACHE_CHECK([whether $LIBGCRYPT can be dynamically loaded],
  24. [guix_cv_libgcrypt_usable_p],
  25. [GUILE_CHECK([retval],
  26. [(dynamic-func \"gcry_md_hash_buffer\" (dynamic-link \"$LIBGCRYPT\"))])
  27. if test "$retval" = 0; then
  28. guix_cv_libgcrypt_usable_p="yes"
  29. else
  30. guix_cv_libgcrypt_usable_p="no"
  31. fi])
  32. if test "x$guix_cv_libgcrypt_usable_p" != "xyes"; then
  33. AC_MSG_ERROR([GNU libgcrypt does not appear to be usable; see `--with-libgcrypt-prefix' and `README'.])
  34. fi])
  35. dnl GUIX_LIBGCRYPT_LIBDIR VAR
  36. dnl
  37. dnl Attempt to determine libgcrypt's LIBDIR; store the result in VAR.
  38. AC_DEFUN([GUIX_LIBGCRYPT_LIBDIR], [
  39. AC_PATH_PROG([LIBGCRYPT_CONFIG], [libgcrypt-config])
  40. AC_CACHE_CHECK([libgcrypt's library directory],
  41. [guix_cv_libgcrypt_libdir],
  42. [if test "x$LIBGCRYPT_CONFIG" != "x"; then
  43. guix_cv_libgcrypt_libdir=`$LIBGCRYPT_CONFIG --libs | grep -e -L | sed -e "s/.*-L\([[^ ]]\+\)[[[:blank:]]]\+-lgcrypt.*/\1/g"`
  44. else
  45. guix_cv_libgcrypt_libdir=""
  46. fi])
  47. $1="$guix_cv_libgcrypt_libdir"
  48. ])