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.
 
 
 
 
 
 

250 lines
7.2 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.11.0], [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 -Wno-portability])
  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. AC_ARG_WITH([zsh-completion-dir],
  34. AC_HELP_STRING([--with-zsh-completion-dir=DIR],
  35. [name of the Zsh completion directory]),
  36. [zshcompletiondir="$withval"],
  37. [zshcompletiondir='${datadir}/zsh/site-functions'])
  38. AC_SUBST([zshcompletiondir])
  39. dnl Better be verbose.
  40. AC_MSG_CHECKING([for the store directory])
  41. AC_MSG_RESULT([$storedir])
  42. AC_ARG_ENABLE([daemon],
  43. [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
  44. [guix_build_daemon="$enableval"],
  45. [guix_build_daemon="yes"])
  46. # Prepare a version of $localstatedir & co. that does not contain references
  47. # to shell variables.
  48. guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
  49. guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
  50. guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
  51. guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
  52. AC_SUBST([guix_localstatedir])
  53. AC_SUBST([guix_sysconfdir])
  54. AC_SUBST([guix_sbindir])
  55. GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
  56. AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
  57. dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
  58. dnl Make sure they are available.
  59. m4_pattern_forbid([PKG_CHECK_MODULES])
  60. m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
  61. m4_pattern_forbid([^GUILE_P$])
  62. dnl Search for 'guile' and 'guild'. Prefer 2.0 until the 2.2 upgrade is
  63. dnl complete.
  64. GUILE_PKG([2.0 2.2])
  65. GUILE_PROGS
  66. if test "x$GUILD" = "x"; then
  67. AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
  68. fi
  69. if test "x$GUILE_EFFECTIVE_VERSION" = "x2.0"; then
  70. PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7])
  71. else
  72. AC_MSG_WARN([Guile $GUILE_EFFECTIVE_VERSION is not fully supported!])
  73. fi
  74. dnl guile-json is used for the PyPI package importer
  75. GUILE_MODULE_AVAILABLE([have_guile_json], [(json)])
  76. AM_CONDITIONAL([HAVE_GUILE_JSON], [test "x$have_guile_json" = "xyes"])
  77. dnl Make sure we have a full-fledged Guile.
  78. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  79. dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
  80. GUIX_CHECK_SRFI_37
  81. AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
  82. dnl Decompressors, for use by the substituter and other modules.
  83. AC_PATH_PROG([GZIP], [gzip])
  84. AC_PATH_PROG([BZIP2], [bzip2])
  85. AC_PATH_PROG([XZ], [xz])
  86. AC_SUBST([GZIP])
  87. AC_SUBST([BZIP2])
  88. AC_SUBST([XZ])
  89. AC_ARG_WITH([nix-prefix],
  90. [AS_HELP_STRING([--with-nix-prefix=DIR],
  91. [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
  92. [case "$withval" in
  93. yes|no) ;;
  94. *)
  95. NIX_PREFIX="$withval"
  96. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  97. AC_SUBST([NIX_PREFIX])
  98. ;;
  99. esac],
  100. [])
  101. AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
  102. AC_PATH_PROG([NIX_HASH], [nix-hash])
  103. if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
  104. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  105. fi
  106. if test "x$NIX_INSTANTIATE" = "x"; then
  107. # This program is an optional dependency, so we just want it to be
  108. # taken from $PATH if it's not available right now.
  109. NIX_INSTANTIATE="nix-instantiate"
  110. fi
  111. AC_ARG_WITH([nixpkgs],
  112. [AS_HELP_STRING([--with-nixpkgs=DIR],
  113. [search for Nixpkgs in DIR (for testing purposes only)])],
  114. [case "$withval" in
  115. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  116. *) NIXPKGS="$withval";;
  117. esac],
  118. [])
  119. AC_MSG_CHECKING([for Nixpkgs source tree])
  120. if test -f "$NIXPKGS/default.nix"; then
  121. AC_MSG_RESULT([$NIXPKGS])
  122. AC_SUBST([NIXPKGS])
  123. else
  124. AC_MSG_RESULT([not found])
  125. fi
  126. LIBGCRYPT="libgcrypt"
  127. LIBGCRYPT_LIBDIR="no"
  128. LIBGCRYPT_PREFIX="no"
  129. AC_ARG_WITH([libgcrypt-prefix],
  130. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  131. [case "$withval" in
  132. yes|no)
  133. ;;
  134. *)
  135. LIBGCRYPT="$withval/lib/libgcrypt"
  136. LIBGCRYPT_PREFIX="$withval"
  137. LIBGCRYPT_LIBDIR="$withval/lib"
  138. ;;
  139. esac])
  140. AC_ARG_WITH([libgcrypt-libdir],
  141. [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
  142. [search for GNU libgcrypt's shared library in DIR])],
  143. [case "$withval" in
  144. yes|no)
  145. LIBGCRYPT="libgcrypt"
  146. LIBGCRYPT_LIBDIR="no"
  147. ;;
  148. *)
  149. LIBGCRYPT="$withval/libgcrypt"
  150. LIBGCRYPT_LIBDIR="$withval"
  151. ;;
  152. esac])
  153. dnl If none of the --with-libgcrypt-* options was used, try to determine the
  154. dnl absolute file name of libgcrypt.so.
  155. case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
  156. xnono)
  157. GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
  158. if test "x$LIBGCRYPT_LIBDIR" != x; then
  159. LIBGCRYPT="$LIBGCRYPT_LIBDIR/libgcrypt"
  160. else
  161. dnl 'config-daemon.ac' expects "no" in this case.
  162. LIBGCRYPT_LIBDIR="no"
  163. fi
  164. ;;
  165. esac
  166. dnl Library name suitable for `dynamic-link'.
  167. AC_MSG_CHECKING([for libgcrypt shared library name])
  168. AC_MSG_RESULT([$LIBGCRYPT])
  169. AC_SUBST([LIBGCRYPT])
  170. AC_SUBST([LIBGCRYPT_PREFIX])
  171. AC_SUBST([LIBGCRYPT_LIBDIR])
  172. GUIX_ASSERT_LIBGCRYPT_USABLE
  173. dnl Library name of zlib suitable for 'dynamic-link'.
  174. GUIX_LIBZ_LIBDIR([libz_libdir])
  175. if test "x$libz_libdir" = "x"; then
  176. LIBZ="libz"
  177. else
  178. LIBZ="$libz_libdir/libz"
  179. fi
  180. AC_MSG_CHECKING([for zlib's shared library name])
  181. AC_MSG_RESULT([$LIBZ])
  182. AC_SUBST([LIBZ])
  183. AC_CACHE_SAVE
  184. m4_include([config-daemon.ac])
  185. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  186. dnl See `Building from Git' in the manual for more info.
  187. AM_MISSING_PROG([DOT], [dot])
  188. dnl Manual pages.
  189. AM_MISSING_PROG([HELP2MAN], [help2man])
  190. AC_CONFIG_FILES([Makefile
  191. po/guix/Makefile.in
  192. po/packages/Makefile.in
  193. guix/config.scm])
  194. AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
  195. AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
  196. AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  197. [chmod +x pre-inst-env])
  198. dnl Emacs interface.
  199. AC_PATH_PROG([DOT_USER_PROGRAM], [dot], [dot])
  200. AM_PATH_LISPDIR
  201. AM_CONDITIONAL([HAVE_EMACS], [test "x$EMACS" != "xno"])
  202. emacsuidir="${guilemoduledir}/guix/emacs"
  203. AC_SUBST([emacsuidir])
  204. AC_CONFIG_FILES([emacs/guix-config.el
  205. emacs/guix-helper.scm])
  206. AC_OUTPUT