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.
 
 
 
 
 
 

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