Mirror of GNU Guix
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.

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