configure.ac 2.3 KB

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