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.
 
 
 
 
 
 

242 lines
7.0 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. PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7])
  62. AC_PATH_PROG([GUILE], [guile])
  63. AC_PATH_PROG([GUILD], [guild])
  64. if test "x$GUILD" = "x"; then
  65. AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
  66. fi
  67. dnl guile-json is used for the PyPI package importer
  68. GUILE_MODULE_AVAILABLE([have_guile_json], [(json)])
  69. AM_CONDITIONAL([HAVE_GUILE_JSON], [test "x$have_guile_json" = "xyes"])
  70. dnl Make sure we have a full-fledged Guile.
  71. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  72. dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
  73. GUIX_CHECK_SRFI_37
  74. AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
  75. dnl Decompressors, for use by the substituter and other modules.
  76. AC_PATH_PROG([GZIP], [gzip])
  77. AC_PATH_PROG([BZIP2], [bzip2])
  78. AC_PATH_PROG([XZ], [xz])
  79. AC_SUBST([GZIP])
  80. AC_SUBST([BZIP2])
  81. AC_SUBST([XZ])
  82. AC_ARG_WITH([nix-prefix],
  83. [AS_HELP_STRING([--with-nix-prefix=DIR],
  84. [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
  85. [case "$withval" in
  86. yes|no) ;;
  87. *)
  88. NIX_PREFIX="$withval"
  89. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  90. AC_SUBST([NIX_PREFIX])
  91. ;;
  92. esac],
  93. [])
  94. AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
  95. AC_PATH_PROG([NIX_HASH], [nix-hash])
  96. if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
  97. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  98. fi
  99. if test "x$NIX_INSTANTIATE" = "x"; then
  100. # This program is an optional dependency, so we just want it to be
  101. # taken from $PATH if it's not available right now.
  102. NIX_INSTANTIATE="nix-instantiate"
  103. fi
  104. AC_ARG_WITH([nixpkgs],
  105. [AS_HELP_STRING([--with-nixpkgs=DIR],
  106. [search for Nixpkgs in DIR (for testing purposes only)])],
  107. [case "$withval" in
  108. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  109. *) NIXPKGS="$withval";;
  110. esac],
  111. [])
  112. AC_MSG_CHECKING([for Nixpkgs source tree])
  113. if test -f "$NIXPKGS/default.nix"; then
  114. AC_MSG_RESULT([$NIXPKGS])
  115. AC_SUBST([NIXPKGS])
  116. else
  117. AC_MSG_RESULT([not found])
  118. fi
  119. LIBGCRYPT="libgcrypt"
  120. LIBGCRYPT_LIBDIR="no"
  121. LIBGCRYPT_PREFIX="no"
  122. AC_ARG_WITH([libgcrypt-prefix],
  123. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  124. [case "$withval" in
  125. yes|no)
  126. ;;
  127. *)
  128. LIBGCRYPT="$withval/lib/libgcrypt"
  129. LIBGCRYPT_PREFIX="$withval"
  130. LIBGCRYPT_LIBDIR="$withval/lib"
  131. ;;
  132. esac])
  133. AC_ARG_WITH([libgcrypt-libdir],
  134. [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
  135. [search for GNU libgcrypt's shared library in DIR])],
  136. [case "$withval" in
  137. yes|no)
  138. LIBGCRYPT="libgcrypt"
  139. LIBGCRYPT_LIBDIR="no"
  140. ;;
  141. *)
  142. LIBGCRYPT="$withval/libgcrypt"
  143. LIBGCRYPT_LIBDIR="$withval"
  144. ;;
  145. esac])
  146. dnl If none of the --with-libgcrypt-* options was used, try to determine the
  147. dnl absolute file name of libgcrypt.so.
  148. case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
  149. xnono)
  150. GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
  151. if test "x$LIBGCRYPT_LIBDIR" != x; then
  152. LIBGCRYPT="$LIBGCRYPT_LIBDIR/libgcrypt"
  153. else
  154. dnl 'config-daemon.ac' expects "no" in this case.
  155. LIBGCRYPT_LIBDIR="no"
  156. fi
  157. ;;
  158. esac
  159. dnl Library name suitable for `dynamic-link'.
  160. AC_MSG_CHECKING([for libgcrypt shared library name])
  161. AC_MSG_RESULT([$LIBGCRYPT])
  162. AC_SUBST([LIBGCRYPT])
  163. AC_SUBST([LIBGCRYPT_PREFIX])
  164. AC_SUBST([LIBGCRYPT_LIBDIR])
  165. GUIX_ASSERT_LIBGCRYPT_USABLE
  166. dnl Library name of zlib suitable for 'dynamic-link'.
  167. GUIX_LIBZ_LIBDIR([libz_libdir])
  168. if test "x$libz_libdir" = "x"; then
  169. LIBZ="libz"
  170. else
  171. LIBZ="$libz_libdir/libz"
  172. fi
  173. AC_MSG_CHECKING([for zlib's shared library name])
  174. AC_MSG_RESULT([$LIBZ])
  175. AC_SUBST([LIBZ])
  176. AC_CACHE_SAVE
  177. m4_include([config-daemon.ac])
  178. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  179. dnl See `Building from Git' in the manual for more info.
  180. AM_MISSING_PROG([DOT], [dot])
  181. dnl Manual pages.
  182. AM_MISSING_PROG([HELP2MAN], [help2man])
  183. AC_CONFIG_FILES([Makefile
  184. po/guix/Makefile.in
  185. po/packages/Makefile.in
  186. guix/config.scm])
  187. AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
  188. AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
  189. AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  190. [chmod +x pre-inst-env])
  191. dnl Emacs interface.
  192. AC_PATH_PROG([DOT_USER_PROGRAM], [dot], [dot])
  193. AM_PATH_LISPDIR
  194. AM_CONDITIONAL([HAVE_EMACS], [test "x$EMACS" != "xno"])
  195. emacsuidir="${guilemoduledir}/guix/emacs"
  196. AC_SUBST([emacsuidir])
  197. AC_CONFIG_FILES([emacs/guix-config.el
  198. emacs/guix-helper.scm])
  199. AC_OUTPUT