configure.ac 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. AC_INIT([Guile-Gcrypt], [0.4.0], [guile-user@gnu.org],
  2. [guile-gcrypt], [https://notabug.org/cwebber/guile-gcrypt])
  3. AC_CONFIG_AUX_DIR([build-aux])
  4. AC_CONFIG_MACRO_DIR([m4])
  5. AM_INIT_AUTOMAKE([-Wall -Werror gnu])
  6. AM_SILENT_RULES([yes])
  7. dnl We require guile.m4, from Guile. Make sure it's available.
  8. m4_pattern_forbid([^GUILE_P])
  9. m4_pattern_allow([^GUILE_PKG_ERRORS])
  10. GUILE_PKG([3.0 2.2 2.0])
  11. GUILE_PROGS
  12. AC_CONFIG_FILES([Makefile gcrypt/package-config.scm])
  13. AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
  14. dnl Prepare a version of $datadir that does not contain references to
  15. dnl shell variables. (Borrowed from Sly, which borrowed from Guix...)
  16. guile_gcrypt_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
  17. guile_gcrypt_datadir="`eval eval echo $datadir | sed -e "s|NONE|$guile_gcrypt_prefix|g"`"
  18. AC_SUBST([guile_gcrypt_datadir])
  19. LIBGCRYPT="libgcrypt"
  20. LIBGCRYPT_LIBDIR="no"
  21. LIBGCRYPT_PREFIX="no"
  22. AC_ARG_WITH([libgcrypt-prefix],
  23. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  24. [case "$withval" in
  25. yes|no)
  26. ;;
  27. *)
  28. LIBGCRYPT="$withval/lib/libgcrypt"
  29. LIBGCRYPT_PREFIX="$withval"
  30. LIBGCRYPT_LIBDIR="$withval/lib"
  31. ;;
  32. esac])
  33. AC_ARG_WITH([libgcrypt-libdir],
  34. [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
  35. [search for GNU libgcrypt's shared library in DIR])],
  36. [case "$withval" in
  37. yes|no)
  38. LIBGCRYPT="libgcrypt"
  39. LIBGCRYPT_LIBDIR="no"
  40. ;;
  41. *)
  42. LIBGCRYPT="$withval/libgcrypt"
  43. LIBGCRYPT_LIBDIR="$withval"
  44. ;;
  45. esac])
  46. dnl If none of the --with-libgcrypt-* options was used, try to determine the
  47. dnl absolute file name of libgcrypt.so.
  48. case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
  49. xnono)
  50. GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
  51. if test "x$LIBGCRYPT_LIBDIR" != x; then
  52. LIBGCRYPT="$LIBGCRYPT_LIBDIR/libgcrypt"
  53. else
  54. dnl 'config-daemon.ac' expects "no" in this case.
  55. LIBGCRYPT_LIBDIR="no"
  56. fi
  57. ;;
  58. esac
  59. dnl Library name suitable for `dynamic-link'.
  60. AC_MSG_CHECKING([for libgcrypt shared library name])
  61. AC_MSG_RESULT([$LIBGCRYPT])
  62. AC_SUBST([LIBGCRYPT])
  63. AC_SUBST([LIBGCRYPT_PREFIX])
  64. AC_SUBST([LIBGCRYPT_LIBDIR])
  65. if test "$cross_compiling" = "no"; then
  66. GUIX_ASSERT_LIBGCRYPT_USABLE
  67. else
  68. GUILE_TARGET="--target=$host_alias"
  69. AC_SUBST([GUILE_TARGET])
  70. fi
  71. AC_OUTPUT