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.
 
 
 
 
 
 

137 lines
3.8 KiB

  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.68)
  4. AC_INIT([GNU Guix], [0.4], [bug-guix@gnu.org], [guix],
  5. [http://www.gnu.org/software/guix/])
  6. AC_CONFIG_AUX_DIR([build-aux])
  7. AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects \
  8. color-tests parallel-tests -Woverride])
  9. AC_CONFIG_SRCDIR([guix.scm])
  10. AC_CONFIG_MACRO_DIR([m4])
  11. dnl For the C++ code. This must be used early.
  12. AC_USE_SYSTEM_EXTENSIONS
  13. AM_GNU_GETTEXT([external])
  14. AM_GNU_GETTEXT_VERSION([0.18.1])
  15. guilemoduledir="${datarootdir}/guile/site/2.0"
  16. AC_SUBST([guilemoduledir])
  17. GUIX_SYSTEM_TYPE
  18. GUIX_ASSERT_SUPPORTED_SYSTEM
  19. AC_ARG_WITH(store-dir,
  20. AC_HELP_STRING([--with-store-dir=PATH],
  21. [path of the store (defaults to /nix/store)]),
  22. [storedir="$withval"],
  23. [storedir="/nix/store"])
  24. AC_SUBST(storedir)
  25. AC_ARG_ENABLE([daemon],
  26. [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
  27. [guix_build_daemon="$enableval"],
  28. [guix_build_daemon="yes"])
  29. # Prepare a version of $localstatedir that does not contain references
  30. # to shell variables.
  31. guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`"
  32. AC_SUBST([guix_localstatedir])
  33. PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
  34. AC_PATH_PROG([GUILE], [guile])
  35. AC_PATH_PROG([GUILD], [guild])
  36. if test "x$GUILD" = "x"; then
  37. AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
  38. fi
  39. dnl Make sure we have a full-fledged Guile.
  40. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  41. dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
  42. GUIX_CHECK_SRFI_37
  43. AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
  44. AC_ARG_WITH([nix-prefix],
  45. [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
  46. [case "$withval" in
  47. yes|no) ;;
  48. *)
  49. NIX_PREFIX="$withval"
  50. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  51. AC_SUBST([NIX_PREFIX])
  52. ;;
  53. esac],
  54. [])
  55. AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
  56. AC_PATH_PROG([NIX_HASH], [nix-hash])
  57. if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
  58. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  59. fi
  60. if test "x$NIX_INSTANTIATE" = "x"; then
  61. # This program is an optional dependency, so we just want it to be
  62. # taken from $PATH if it's not available right now.
  63. NIX_INSTANTIATE="nix-instantiate"
  64. fi
  65. AC_ARG_WITH([nixpkgs],
  66. [AS_HELP_STRING([--with-nixpkgs=DIR], [search for Nixpkgs in DIR])],
  67. [case "$withval" in
  68. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  69. *) NIXPKGS="$withval";;
  70. esac],
  71. [])
  72. AC_MSG_CHECKING([for Nixpkgs source tree])
  73. if test -f "$NIXPKGS/default.nix"; then
  74. AC_MSG_RESULT([$NIXPKGS])
  75. AC_SUBST([NIXPKGS])
  76. else
  77. AC_MSG_RESULT([not found])
  78. fi
  79. AC_ARG_WITH([libgcrypt-prefix],
  80. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  81. [case "$withval" in
  82. yes|no)
  83. LIBGCRYPT="libgcrypt"
  84. LIBGCRYPT_PREFIX="no"
  85. ;;
  86. *)
  87. LIBGCRYPT="$withval/lib/libgcrypt"
  88. LIBGCRYPT_PREFIX="$withval"
  89. ;;
  90. esac],
  91. [LIBGCRYPT="libgcrypt"])
  92. dnl Library name suitable for `dynamic-link'.
  93. AC_MSG_CHECKING([for libgcrypt shared library name])
  94. AC_MSG_RESULT([$LIBGCRYPT])
  95. AC_SUBST([LIBGCRYPT])
  96. AC_SUBST([LIBGCRYPT_PREFIX])
  97. GUIX_ASSERT_LIBGCRYPT_USABLE
  98. AC_CACHE_SAVE
  99. m4_include([config-daemon.ac])
  100. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  101. dnl See `HACKING' for more info.
  102. AM_MISSING_PROG([DOT], [dot])
  103. AC_CONFIG_FILES([Makefile
  104. po/Makefile.in
  105. guix/config.scm])
  106. AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
  107. AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
  108. AC_CONFIG_FILES([test-env], [chmod +x test-env])
  109. AC_OUTPUT