2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([GNU Guix], [0.3], [bug-guix@gnu.org], [guix],
6 [http://www.gnu.org/software/guix/])
7 AC_CONFIG_AUX_DIR([build-aux])
9 AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects \
10 color-tests parallel-tests])
12 AC_CONFIG_SRCDIR([guix.scm])
13 AC_CONFIG_MACRO_DIR([m4])
15 dnl For the C++ code. This must be used early.
16 AC_USE_SYSTEM_EXTENSIONS
18 AM_GNU_GETTEXT([external])
19 AM_GNU_GETTEXT_VERSION([0.18.1])
21 guilemoduledir="${datarootdir}/guile/site/2.0"
22 AC_SUBST([guilemoduledir])
25 GUIX_ASSERT_SUPPORTED_SYSTEM
27 AC_ARG_WITH(store-dir,
28 AC_HELP_STRING([--with-store-dir=PATH],
29 [path of the store (defaults to /nix/store)]),
30 [storedir="$withval"],
31 [storedir="/nix/store"])
34 AC_ARG_ENABLE([daemon],
35 [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
36 [guix_build_daemon="$enableval"],
37 [guix_build_daemon="yes"])
39 # Prepare a version of $localstatedir that does not contain references
41 guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`"
42 AC_SUBST([guix_localstatedir])
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.])
51 dnl Make sure we have a full-fledged Guile.
52 GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
54 AC_ARG_WITH([nix-prefix],
55 [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
60 PATH="$NIX_PREFIX/bin:$PATH"; export PATH
61 AC_SUBST([NIX_PREFIX])
66 AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
67 AC_PATH_PROG([NIX_HASH], [nix-hash])
68 if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
69 AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
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"
78 AC_ARG_WITH([nixpkgs],
79 [AS_HELP_STRING([--with-nixpkgs=DIR], [search for Nixpkgs in DIR])],
81 yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
82 *) NIXPKGS="$withval";;
86 AC_MSG_CHECKING([for Nixpkgs source tree])
87 if test -f "$NIXPKGS/default.nix"; then
88 AC_MSG_RESULT([$NIXPKGS])
91 AC_MSG_RESULT([not found])
94 AC_ARG_WITH([libgcrypt-prefix],
95 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
102 LIBGCRYPT="$withval/lib/libgcrypt"
103 LIBGCRYPT_PREFIX="$withval"
106 [LIBGCRYPT="libgcrypt"])
108 dnl Library name suitable for `dynamic-link'.
109 AC_MSG_CHECKING([for libgcrypt shared library name])
110 AC_MSG_RESULT([$LIBGCRYPT])
111 AC_SUBST([LIBGCRYPT])
112 AC_SUBST([LIBGCRYPT_PREFIX])
114 GUIX_ASSERT_LIBGCRYPT_USABLE
118 m4_include([config-daemon.ac])
120 AC_CONFIG_FILES([Makefile
124 AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
125 AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
126 AC_CONFIG_FILES([test-env], [chmod +x test-env])