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.
 
 
 
 
 
 

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