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.
 
 
 
 
 
 

129 lines
3.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.2], [bug-guix@gnu.org], [guix],
  5. [http://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])
  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. AC_ARG_WITH(store-dir,
  19. AC_HELP_STRING([--with-store-dir=PATH],
  20. [path of the store (defaults to /nix/store)]),
  21. [storedir="$withval"],
  22. [storedir="/nix/store"])
  23. AC_SUBST(storedir)
  24. AC_ARG_ENABLE([daemon],
  25. [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
  26. [guix_build_daemon="$enableval"],
  27. [guix_build_daemon="yes"])
  28. # Prepare a version of $localstatedir that does not contain references
  29. # to shell variables.
  30. guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`"
  31. AC_SUBST([guix_localstatedir])
  32. PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
  33. AC_PATH_PROG([GUILE], [guile])
  34. AC_PATH_PROG([GUILD], [guild])
  35. if test "x$GUILD" = "x"; then
  36. AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
  37. fi
  38. dnl Make sure we have a full-fledged Guile.
  39. GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
  40. AC_ARG_WITH([nix-prefix],
  41. [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
  42. [case "$withval" in
  43. yes|no) ;;
  44. *)
  45. NIX_PREFIX="$withval"
  46. PATH="$NIX_PREFIX/bin:$PATH"; export PATH
  47. AC_SUBST([NIX_PREFIX])
  48. ;;
  49. esac],
  50. [])
  51. AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
  52. AC_PATH_PROG([NIX_HASH], [nix-hash])
  53. if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
  54. AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
  55. fi
  56. if test "x$NIX_INSTANTIATE" = "x"; then
  57. # This program is an optional dependency, so we just want it to be
  58. # taken from $PATH if it's not available right now.
  59. NIX_INSTANTIATE="nix-instantiate"
  60. fi
  61. AC_ARG_WITH([nixpkgs],
  62. [AS_HELP_STRING([--with-nixpkgs=DIR], [search for Nixpkgs in DIR])],
  63. [case "$withval" in
  64. yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
  65. *) NIXPKGS="$withval";;
  66. esac],
  67. [])
  68. AC_MSG_CHECKING([for Nixpkgs source tree])
  69. if test -f "$NIXPKGS/default.nix"; then
  70. AC_MSG_RESULT([$NIXPKGS])
  71. AC_SUBST([NIXPKGS])
  72. else
  73. AC_MSG_RESULT([not found])
  74. fi
  75. AC_ARG_WITH([libgcrypt-prefix],
  76. [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  77. [case "$withval" in
  78. yes|no)
  79. LIBGCRYPT="libgcrypt"
  80. LIBGCRYPT_PREFIX="no"
  81. ;;
  82. *)
  83. LIBGCRYPT="$withval/lib/libgcrypt"
  84. LIBGCRYPT_PREFIX="$withval"
  85. ;;
  86. esac],
  87. [LIBGCRYPT="libgcrypt"])
  88. dnl Library name suitable for `dynamic-link'.
  89. AC_MSG_CHECKING([for libgcrypt shared library name])
  90. AC_MSG_RESULT([$LIBGCRYPT])
  91. AC_SUBST([LIBGCRYPT])
  92. AC_SUBST([LIBGCRYPT_PREFIX])
  93. GUIX_ASSERT_LIBGCRYPT_USABLE
  94. AC_CACHE_SAVE
  95. m4_include([config-daemon.ac])
  96. AC_CONFIG_FILES([Makefile
  97. po/Makefile.in
  98. guix/config.scm])
  99. AC_CONFIG_FILES([scripts/guix
  100. pre-inst-env
  101. test-env],
  102. [chmod +x scripts/guix pre-inst-env test-env])
  103. AC_OUTPUT