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.
 
 
 
 
 
 

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