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.
 
 
 
 
 
 

205 lines
5.9 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.8.2], [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. # Enable silent rules by default.
  10. AM_SILENT_RULES([yes])
  11. AC_CONFIG_SRCDIR([guix.scm])
  12. AC_CONFIG_MACRO_DIR([m4])
  13. dnl For the C++ code. This must be used early.
  14. AC_USE_SYSTEM_EXTENSIONS
  15. AM_GNU_GETTEXT([external])
  16. AM_GNU_GETTEXT_VERSION([0.18.1])
  17. guilemoduledir="${datarootdir}/guile/site/2.0"
  18. AC_SUBST([guilemoduledir])
  19. GUIX_SYSTEM_TYPE
  20. GUIX_ASSERT_SUPPORTED_SYSTEM
  21. AC_ARG_WITH(store-dir,
  22. AC_HELP_STRING([--with-store-dir=PATH],
  23. [file name of the store (defaults to /gnu/store)]),
  24. [storedir="$withval"],
  25. [storedir="/gnu/store"])
  26. AC_SUBST(storedir)
  27. AC_ARG_WITH([bash-completion-dir],
  28. AC_HELP_STRING([--with-bash-completion-dir=DIR],
  29. [name of the Bash completion directory]),
  30. [bashcompletiondir="$withval"],
  31. [bashcompletiondir='${sysconfdir}/bash_completion.d'])
  32. AC_SUBST([bashcompletiondir])
  33. dnl Better be verbose.
  34. AC_MSG_CHECKING([for the store directory])
  35. AC_MSG_RESULT([$storedir])
  36. AC_ARG_ENABLE([daemon],
  37. [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
  38. [guix_build_daemon="$enableval"],
  39. [guix_build_daemon="yes"])
  40. # Prepare a version of $localstatedir & co. that does not contain references
  41. # to shell variables.
  42. guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
  43. guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
  44. guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
  45. guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
  46. AC_SUBST([guix_localstatedir])
  47. AC_SUBST([guix_sysconfdir])
  48. AC_SUBST([guix_sbindir])
  49. GUIX_CHECK_FILE_NAME_LIMITS
  50. dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
  51. dnl Make sure they are available.
  52. m4_pattern_forbid([PKG_CHECK_MODULES])
  53. m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
  54. PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
  55. AC_PATH_PROG([GUILE], [guile])
  56. AC_PATH_PROG([GUILD], [guild])
  57. if test "x$GUILD" = "x"; then
  58. AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
  59. fi
  60. dnl guile-json is used for the PyPI package importer
  61. GUILE_MODULE_AVAILABLE([have_guile_json], [(json)])
  62. AM_CONDITIONAL([HAVE_GUILE_JSON], [test "x$have_guile_json" = "xyes"])
  63. dnl Make sure we have a full-fledged Guile.
  64. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  65. dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
  66. GUIX_CHECK_SRFI_37
  67. AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
  68. AC_ARG_WITH([nix-prefix],
  69. [AS_HELP_STRING([--with-nix-prefix=DIR],
  70. [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
  71. [case "$withval" in
  72. yes|no) ;;
  73. *)
  74. NIX_PREFIX="$withval"
  75. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  76. AC_SUBST([NIX_PREFIX])
  77. ;;
  78. esac],
  79. [])
  80. AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
  81. AC_PATH_PROG([NIX_HASH], [nix-hash])
  82. if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
  83. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  84. fi
  85. if test "x$NIX_INSTANTIATE" = "x"; then
  86. # This program is an optional dependency, so we just want it to be
  87. # taken from $PATH if it's not available right now.
  88. NIX_INSTANTIATE="nix-instantiate"
  89. fi
  90. AC_ARG_WITH([nixpkgs],
  91. [AS_HELP_STRING([--with-nixpkgs=DIR],
  92. [search for Nixpkgs in DIR (for testing purposes only)])],
  93. [case "$withval" in
  94. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  95. *) NIXPKGS="$withval";;
  96. esac],
  97. [])
  98. AC_MSG_CHECKING([for Nixpkgs source tree])
  99. if test -f "$NIXPKGS/default.nix"; then
  100. AC_MSG_RESULT([$NIXPKGS])
  101. AC_SUBST([NIXPKGS])
  102. else
  103. AC_MSG_RESULT([not found])
  104. fi
  105. AC_ARG_WITH([libgcrypt-prefix],
  106. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  107. [case "$withval" in
  108. yes|no)
  109. LIBGCRYPT="libgcrypt"
  110. LIBGCRYPT_PREFIX="no"
  111. LIBGCRYPT_LIBDIR="no"
  112. ;;
  113. *)
  114. LIBGCRYPT="$withval/lib/libgcrypt"
  115. LIBGCRYPT_PREFIX="$withval"
  116. LIBGCRYPT_LIBDIR="$withval/lib"
  117. ;;
  118. esac],
  119. [LIBGCRYPT="libgcrypt"
  120. LIBGCRYPT_PREFIX="no"
  121. LIBGCRYPT_LIBDIR="no"])
  122. AC_ARG_WITH([libgcrypt-libdir],
  123. [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
  124. [search for GNU libgcrypt's shared library in DIR])],
  125. [case "$withval" in
  126. yes|no)
  127. LIBGCRYPT="libgcrypt"
  128. LIBGCRYPT_LIBDIR="no"
  129. ;;
  130. *)
  131. LIBGCRYPT="$withval/libgcrypt"
  132. LIBGCRYPT_LIBDIR="$withval"
  133. ;;
  134. esac],
  135. [if test "x$LIBGCRYPT" = x; then
  136. LIBGCRYPT="libgcrypt"
  137. fi
  138. if test "x$LIBGCRYPT_LIBDIR" = x; then
  139. LIBGCRYPT_LIBDIR="no"
  140. fi])
  141. dnl Library name suitable for `dynamic-link'.
  142. AC_MSG_CHECKING([for libgcrypt shared library name])
  143. AC_MSG_RESULT([$LIBGCRYPT])
  144. AC_SUBST([LIBGCRYPT])
  145. AC_SUBST([LIBGCRYPT_PREFIX])
  146. AC_SUBST([LIBGCRYPT_LIBDIR])
  147. GUIX_ASSERT_LIBGCRYPT_USABLE
  148. AC_CACHE_SAVE
  149. m4_include([config-daemon.ac])
  150. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  151. dnl See `HACKING' for more info.
  152. AM_MISSING_PROG([DOT], [dot])
  153. AC_CONFIG_FILES([Makefile
  154. po/guix/Makefile.in
  155. po/packages/Makefile.in
  156. guix/config.scm])
  157. AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
  158. AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
  159. AC_CONFIG_FILES([test-env], [chmod +x test-env])
  160. dnl Emacs interface.
  161. AM_PATH_LISPDIR
  162. AM_CONDITIONAL([HAVE_EMACS], [test "x$EMACS" != "xno"])
  163. emacsuidir="${guilemoduledir}/guix/emacs"
  164. AC_SUBST([emacsuidir])
  165. AC_CONFIG_FILES([emacs/guix-init.el
  166. emacs/guix-profiles.el
  167. emacs/guix-helper.scm])
  168. AC_OUTPUT