Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

316 linhas
9.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],
  5. [m4_esyscmd([build-aux/git-version-gen .tarball-version])],
  6. [bug-guix@gnu.org], [guix],
  7. [https://www.gnu.org/software/guix/])
  8. AC_CONFIG_AUX_DIR([build-aux])
  9. AM_INIT_AUTOMAKE([1.14 gnu silent-rules subdir-objects \
  10. color-tests parallel-tests -Woverride -Wno-portability])
  11. # Enable silent rules by default.
  12. AM_SILENT_RULES([yes])
  13. AC_CONFIG_SRCDIR([guix.scm])
  14. AC_CONFIG_MACRO_DIR([m4])
  15. dnl For the C++ code. This must be used early.
  16. AC_USE_SYSTEM_EXTENSIONS
  17. AM_GNU_GETTEXT([external])
  18. AM_GNU_GETTEXT_VERSION([0.18.1])
  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. AC_ARG_WITH([fish-completion-dir],
  40. AC_HELP_STRING([--with-fish-completion-dir=DIR],
  41. [name of the Fish completion directory]),
  42. [fishcompletiondir="$withval"],
  43. [fishcompletiondir='${datadir}/fish/vendor_completions.d'])
  44. AC_SUBST([fishcompletiondir])
  45. AC_ARG_WITH([selinux-policy-dir],
  46. AC_HELP_STRING([--with-selinux-policy-dir=DIR],
  47. [name of the SELinux policy directory]),
  48. [selinux_policydir="$withval"],
  49. [selinux_policydir='${datadir}/selinux/'])
  50. AC_SUBST([selinux_policydir])
  51. dnl Better be verbose.
  52. AC_MSG_CHECKING([for the store directory])
  53. AC_MSG_RESULT([$storedir])
  54. AC_ARG_ENABLE([daemon],
  55. [AS_HELP_STRING([--disable-daemon], [do not build the Nix daemon (C++)])],
  56. [guix_build_daemon="$enableval"],
  57. [guix_build_daemon="yes"])
  58. # Prepare a version of $localstatedir & co. that does not contain references
  59. # to shell variables.
  60. guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
  61. guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
  62. guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
  63. guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
  64. AC_SUBST([guix_localstatedir])
  65. AC_SUBST([guix_sysconfdir])
  66. AC_SUBST([guix_sbindir])
  67. GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
  68. AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
  69. dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
  70. dnl Make sure they are available.
  71. m4_pattern_forbid([PKG_CHECK_MODULES])
  72. m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
  73. m4_pattern_forbid([^GUILE_P])
  74. m4_pattern_allow([^GUILE_PKG_ERRORS])
  75. m4_pattern_forbid([^GUIX_])
  76. dnl Search for 'guile' and 'guild'. This macro defines
  77. dnl 'GUILE_EFFECTIVE_VERSION'.
  78. GUILE_PKG([3.0 2.2])
  79. GUILE_PROGS
  80. if test "x$GUILD" = "x"; then
  81. AC_MSG_ERROR(['guild' binary not found; please check your Guile installation.])
  82. fi
  83. if test "x$GUILE_EFFECTIVE_VERSION" = "x2.2"; then
  84. PKG_CHECK_MODULES([GUILE], [guile-2.2 >= 2.2.3])
  85. fi
  86. dnl Installation directories for .scm and .go files.
  87. guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
  88. guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
  89. AC_SUBST([guilemoduledir])
  90. AC_SUBST([guileobjectdir])
  91. dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix
  92. dnl pull', among other things.
  93. GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)])
  94. if test "x$have_gnutls" != "xyes"; then
  95. AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.])
  96. fi
  97. dnl Check for Guile-Git.
  98. GUILE_MODULE_AVAILABLE([have_guile_git], [(git)])
  99. if test "x$have_guile_git" != "xyes"; then
  100. AC_MSG_ERROR([Guile-Git is missing; please install it.])
  101. fi
  102. dnl Check for Guile-JSON.
  103. GUIX_CHECK_GUILE_JSON
  104. if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
  105. AC_MSG_ERROR([Guile-JSON is missing; please install it.])
  106. fi
  107. dnl Guile-Sqlite3 is used by the (guix store ...) modules.
  108. GUIX_CHECK_GUILE_SQLITE3
  109. if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
  110. AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
  111. fi
  112. GUILE_MODULE_AVAILABLE([have_guile_gcrypt], [(gcrypt hash)])
  113. if test "x$have_guile_gcrypt" != "xyes"; then
  114. AC_MSG_ERROR([Guile-Gcrypt could not be found; please install it.])
  115. fi
  116. dnl Guile-newt is used by the graphical installer.
  117. GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)])
  118. AC_ARG_ENABLE([installer],
  119. AS_HELP_STRING([--enable-installer], [Build the graphical installer sources.]))
  120. AS_IF([test "x$enable_installer" = "xyes"], [
  121. if test "x$have_guile_newt" != "xyes"; then
  122. AC_MSG_ERROR([Guile-newt could not be found; please install it.])
  123. fi
  124. ])
  125. AM_CONDITIONAL([ENABLE_INSTALLER],
  126. [test "x$enable_installer" = "xyes"])
  127. dnl Make sure we have a full-fledged Guile.
  128. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  129. dnl Make sure we don't suffer from the bug in 'equal?' wrt. syntax objects
  130. dnl found in 2.2.1. See <https://bugs.gnu.org/29903>.
  131. GUIX_ASSERT_SYNTAX_OBJECT_EQUAL
  132. AC_PROG_SED
  133. dnl Decompressors, for use by the substituter and other modules.
  134. AC_PATH_PROG([GZIP], [gzip])
  135. AC_PATH_PROG([BZIP2], [bzip2])
  136. AC_PATH_PROG([XZ], [xz])
  137. AC_SUBST([GZIP])
  138. AC_SUBST([BZIP2])
  139. AC_SUBST([XZ])
  140. AC_ARG_WITH([nix-prefix],
  141. [AS_HELP_STRING([--with-nix-prefix=DIR],
  142. [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
  143. [case "$withval" in
  144. yes|no) ;;
  145. *)
  146. NIX_PREFIX="$withval"
  147. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  148. AC_SUBST([NIX_PREFIX])
  149. ;;
  150. esac],
  151. [])
  152. AC_PATH_PROG([NIX_HASH], [nix-hash])
  153. if test "x$guix_build_daemon$NIX_HASH" = "xno"; then
  154. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  155. fi
  156. AC_ARG_WITH([nixpkgs],
  157. [AS_HELP_STRING([--with-nixpkgs=DIR],
  158. [search for Nixpkgs in DIR (for testing purposes only)])],
  159. [case "$withval" in
  160. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  161. *) NIXPKGS="$withval";;
  162. esac],
  163. [])
  164. AC_MSG_CHECKING([for Nixpkgs source tree])
  165. if test -f "$NIXPKGS/default.nix"; then
  166. AC_MSG_RESULT([$NIXPKGS])
  167. AC_SUBST([NIXPKGS])
  168. else
  169. AC_MSG_RESULT([not found])
  170. fi
  171. LIBGCRYPT_LIBDIR="no"
  172. LIBGCRYPT_PREFIX="no"
  173. AC_ARG_WITH([libgcrypt-prefix],
  174. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  175. [case "$withval" in
  176. yes|no)
  177. ;;
  178. *)
  179. LIBGCRYPT_PREFIX="$withval"
  180. LIBGCRYPT_LIBDIR="$withval/lib"
  181. ;;
  182. esac])
  183. AC_ARG_WITH([libgcrypt-libdir],
  184. [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
  185. [search for GNU libgcrypt's shared library in DIR])],
  186. [case "$withval" in
  187. yes|no)
  188. LIBGCRYPT_LIBDIR="no"
  189. ;;
  190. *)
  191. LIBGCRYPT_LIBDIR="$withval"
  192. ;;
  193. esac])
  194. dnl If none of the --with-libgcrypt-* options was used, try to determine the
  195. dnl the library directory.
  196. case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
  197. xnono)
  198. GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
  199. ;;
  200. esac
  201. AC_SUBST([LIBGCRYPT_PREFIX])
  202. AC_SUBST([LIBGCRYPT_LIBDIR])
  203. dnl Library name of zlib suitable for 'dynamic-link'.
  204. GUIX_LIBZ_LIBDIR([libz_libdir])
  205. if test "x$libz_libdir" = "x"; then
  206. LIBZ="libz"
  207. else
  208. LIBZ="$libz_libdir/libz"
  209. fi
  210. AC_MSG_CHECKING([for zlib's shared library name])
  211. AC_MSG_RESULT([$LIBZ])
  212. AC_SUBST([LIBZ])
  213. dnl Library name of lzlib suitable for 'dynamic-link'.
  214. GUIX_LIBLZ_FILE_NAME([LIBLZ])
  215. if test "x$LIBLZ" = "x"; then
  216. LIBLZ="liblz"
  217. else
  218. # Strip the .so or .so.1 extension since that's what 'dynamic-link' expects.
  219. LIBLZ="`echo $LIBLZ | sed -es'/\.so\(\.[[0-9.]]\+\)\?//g'`"
  220. fi
  221. AC_SUBST([LIBLZ])
  222. dnl Check for Guile-SSH, for the (guix ssh) module.
  223. GUIX_CHECK_GUILE_SSH
  224. AM_CONDITIONAL([HAVE_GUILE_SSH],
  225. [test "x$guix_cv_have_recent_guile_ssh" = "xyes"])
  226. AC_CACHE_SAVE
  227. m4_include([config-daemon.ac])
  228. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  229. dnl See `Building from Git' in the manual for more info.
  230. AM_MISSING_PROG([DOT], [dot])
  231. dnl Manual pages.
  232. AM_MISSING_PROG([HELP2MAN], [help2man])
  233. dnl Documentation translation.
  234. AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate])
  235. AM_MISSING_PROG([PO4A_UPDATEPO], [po4a-updatepo])
  236. dnl Emacs (optional), for 'etc/indent-code.el'.
  237. AC_PATH_PROG([EMACS], [emacs])
  238. if test "x$EMACS" = x; then
  239. AC_MSG_WARN([Please install GNU Emacs to use etc/indent-code.el.])
  240. else
  241. AC_SUBST([EMACS])
  242. AC_CONFIG_FILES([etc/indent-code.el], [chmod +x etc/indent-code.el])
  243. fi
  244. case "$storedir" in
  245. /gnu/store)
  246. ;;
  247. *)
  248. AC_MSG_WARN([Using a store directory other than '/gnu/store' will prevent you])
  249. AC_MSG_WARN([from downloading substitutes from gnu.org.])
  250. ;;
  251. esac
  252. AC_CONFIG_FILES([Makefile
  253. po/guix/Makefile.in
  254. po/packages/Makefile.in
  255. etc/guix-daemon.cil
  256. guix/config.scm])
  257. AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
  258. AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  259. [chmod +x pre-inst-env])
  260. AC_OUTPUT