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.
 
 
 
 
 
 

145 lines
4.1 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.6], [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. [path of the store (defaults to /nix/store)]),
  22. [storedir="$withval"],
  23. [storedir="/nix/store"])
  24. AC_SUBST(storedir)
  25. AC_ARG_ENABLE([daemon],
  26. [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
  27. [guix_build_daemon="$enableval"],
  28. [guix_build_daemon="yes"])
  29. # Prepare a version of $localstatedir & co. that does not contain references
  30. # to shell variables.
  31. guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`"
  32. guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|/usr/local|g"`"
  33. AC_SUBST([guix_localstatedir])
  34. AC_SUBST([guix_sysconfdir])
  35. dnl We require the pkg.m4 set of macros from pkg-config.
  36. dnl Make sure it's available.
  37. m4_pattern_forbid([PKG_CHECK_MODULES])
  38. PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
  39. AC_PATH_PROG([GUILE], [guile])
  40. AC_PATH_PROG([GUILD], [guild])
  41. if test "x$GUILD" = "x"; then
  42. AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
  43. fi
  44. dnl Make sure we have a full-fledged Guile.
  45. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  46. dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
  47. GUIX_CHECK_SRFI_37
  48. AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
  49. AC_ARG_WITH([nix-prefix],
  50. [AS_HELP_STRING([--with-nix-prefix=DIR],
  51. [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
  52. [case "$withval" in
  53. yes|no) ;;
  54. *)
  55. NIX_PREFIX="$withval"
  56. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  57. AC_SUBST([NIX_PREFIX])
  58. ;;
  59. esac],
  60. [])
  61. AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
  62. AC_PATH_PROG([NIX_HASH], [nix-hash])
  63. if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
  64. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  65. fi
  66. if test "x$NIX_INSTANTIATE" = "x"; then
  67. # This program is an optional dependency, so we just want it to be
  68. # taken from $PATH if it's not available right now.
  69. NIX_INSTANTIATE="nix-instantiate"
  70. fi
  71. AC_ARG_WITH([nixpkgs],
  72. [AS_HELP_STRING([--with-nixpkgs=DIR],
  73. [search for Nixpkgs in DIR (for testing purposes only)])],
  74. [case "$withval" in
  75. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  76. *) NIXPKGS="$withval";;
  77. esac],
  78. [])
  79. AC_MSG_CHECKING([for Nixpkgs source tree])
  80. if test -f "$NIXPKGS/default.nix"; then
  81. AC_MSG_RESULT([$NIXPKGS])
  82. AC_SUBST([NIXPKGS])
  83. else
  84. AC_MSG_RESULT([not found])
  85. fi
  86. AC_ARG_WITH([libgcrypt-prefix],
  87. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  88. [case "$withval" in
  89. yes|no)
  90. LIBGCRYPT="libgcrypt"
  91. LIBGCRYPT_PREFIX="no"
  92. ;;
  93. *)
  94. LIBGCRYPT="$withval/lib/libgcrypt"
  95. LIBGCRYPT_PREFIX="$withval"
  96. ;;
  97. esac],
  98. [LIBGCRYPT="libgcrypt"])
  99. dnl Library name suitable for `dynamic-link'.
  100. AC_MSG_CHECKING([for libgcrypt shared library name])
  101. AC_MSG_RESULT([$LIBGCRYPT])
  102. AC_SUBST([LIBGCRYPT])
  103. AC_SUBST([LIBGCRYPT_PREFIX])
  104. GUIX_ASSERT_LIBGCRYPT_USABLE
  105. AC_CACHE_SAVE
  106. m4_include([config-daemon.ac])
  107. dnl `dot' (from the Graphviz package) is only needed for maintainers.
  108. dnl See `HACKING' for more info.
  109. AM_MISSING_PROG([DOT], [dot])
  110. AC_CONFIG_FILES([Makefile
  111. po/Makefile.in
  112. guix/config.scm])
  113. AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
  114. AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
  115. AC_CONFIG_FILES([test-env], [chmod +x test-env])
  116. AC_OUTPUT