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.
 
 
 
 
 
 

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