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.
 
 
 
 
 
 

172 lines
4.8 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.7], [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 Make sure we have a full-fledged Guile.
  51. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  52. dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
  53. GUIX_CHECK_SRFI_37
  54. AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
  55. AC_ARG_WITH([nix-prefix],
  56. [AS_HELP_STRING([--with-nix-prefix=DIR],
  57. [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
  58. [case "$withval" in
  59. yes|no) ;;
  60. *)
  61. NIX_PREFIX="$withval"
  62. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  63. AC_SUBST([NIX_PREFIX])
  64. ;;
  65. esac],
  66. [])
  67. AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
  68. AC_PATH_PROG([NIX_HASH], [nix-hash])
  69. if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
  70. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  71. fi
  72. if test "x$NIX_INSTANTIATE" = "x"; then
  73. # This program is an optional dependency, so we just want it to be
  74. # taken from $PATH if it's not available right now.
  75. NIX_INSTANTIATE="nix-instantiate"
  76. fi
  77. AC_ARG_WITH([nixpkgs],
  78. [AS_HELP_STRING([--with-nixpkgs=DIR],
  79. [search for Nixpkgs in DIR (for testing purposes only)])],
  80. [case "$withval" in
  81. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  82. *) NIXPKGS="$withval";;
  83. esac],
  84. [])
  85. AC_MSG_CHECKING([for Nixpkgs source tree])
  86. if test -f "$NIXPKGS/default.nix"; then
  87. AC_MSG_RESULT([$NIXPKGS])
  88. AC_SUBST([NIXPKGS])
  89. else
  90. AC_MSG_RESULT([not found])
  91. fi
  92. AC_ARG_WITH([libgcrypt-prefix],
  93. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  94. [case "$withval" in
  95. yes|no)
  96. LIBGCRYPT="libgcrypt"
  97. LIBGCRYPT_PREFIX="no"
  98. LIBGCRYPT_LIBDIR="no"
  99. ;;
  100. *)
  101. LIBGCRYPT="$withval/lib/libgcrypt"
  102. LIBGCRYPT_PREFIX="$withval"
  103. LIBGCRYPT_LIBDIR="$withval/lib"
  104. ;;
  105. esac],
  106. [LIBGCRYPT="libgcrypt"])
  107. AC_ARG_WITH([libgcrypt-libdir],
  108. [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
  109. [search for GNU libgcrypt's shared library in DIR])],
  110. [case "$withval" in
  111. yes|no)
  112. LIBGCRYPT="libgcrypt"
  113. LIBGCRYPT_LIBDIR="no"
  114. ;;
  115. *)
  116. LIBGCRYPT="$withval/libgcrypt"
  117. LIBGCRYPT_LIBDIR="$withval"
  118. ;;
  119. esac],
  120. [if test "x$LIBGCRYPT" = x; then
  121. LIBGCRYPT="libgcrypt"
  122. fi])
  123. dnl Library name suitable for `dynamic-link'.
  124. AC_MSG_CHECKING([for libgcrypt shared library name])
  125. AC_MSG_RESULT([$LIBGCRYPT])
  126. AC_SUBST([LIBGCRYPT])
  127. AC_SUBST([LIBGCRYPT_PREFIX])
  128. AC_SUBST([LIBGCRYPT_LIBDIR])
  129. GUIX_ASSERT_LIBGCRYPT_USABLE
  130. AC_CACHE_SAVE
  131. m4_include([config-daemon.ac])
  132. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  133. dnl See `HACKING' for more info.
  134. AM_MISSING_PROG([DOT], [dot])
  135. AC_CONFIG_FILES([Makefile
  136. po/Makefile.in
  137. guix/config.scm])
  138. AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
  139. AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
  140. AC_CONFIG_FILES([test-env], [chmod +x test-env])
  141. AC_OUTPUT