2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([GNU Guix], [0.8], [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 -Woverride])
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 [file name of the store (defaults to /gnu/store)]),
30 [storedir="$withval"],
31 [storedir="/gnu/store"])
34 dnl Better be verbose.
35 AC_MSG_CHECKING([for the store directory])
36 AC_MSG_RESULT([$storedir])
38 AC_ARG_ENABLE([daemon],
39 [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
40 [guix_build_daemon="$enableval"],
41 [guix_build_daemon="yes"])
43 # Prepare a version of $localstatedir & co. that does not contain references
45 guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
46 guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
47 guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
48 guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
49 AC_SUBST([guix_localstatedir])
50 AC_SUBST([guix_sysconfdir])
51 AC_SUBST([guix_sbindir])
53 dnl We require the pkg.m4 set of macros from pkg-config.
54 dnl Make sure it's available.
55 m4_pattern_forbid([PKG_CHECK_MODULES])
57 PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
58 AC_PATH_PROG([GUILE], [guile])
59 AC_PATH_PROG([GUILD], [guild])
60 if test "x$GUILD" = "x"; then
61 AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
64 dnl Make sure we have a full-fledged Guile.
65 GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
67 dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
69 AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
71 AC_ARG_WITH([nix-prefix],
72 [AS_HELP_STRING([--with-nix-prefix=DIR],
73 [search for Nix in DIR (for testing purposes and '--disable-daemon' builds)])],
78 PATH="$NIX_PREFIX/bin:$PATH"; export PATH
79 AC_SUBST([NIX_PREFIX])
84 AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
85 AC_PATH_PROG([NIX_HASH], [nix-hash])
86 if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
87 AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
90 if test "x$NIX_INSTANTIATE" = "x"; then
91 # This program is an optional dependency, so we just want it to be
92 # taken from $PATH if it's not available right now.
93 NIX_INSTANTIATE="nix-instantiate"
96 AC_ARG_WITH([nixpkgs],
97 [AS_HELP_STRING([--with-nixpkgs=DIR],
98 [search for Nixpkgs in DIR (for testing purposes only)])],
100 yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
101 *) NIXPKGS="$withval";;
105 AC_MSG_CHECKING([for Nixpkgs source tree])
106 if test -f "$NIXPKGS/default.nix"; then
107 AC_MSG_RESULT([$NIXPKGS])
110 AC_MSG_RESULT([not found])
113 AC_ARG_WITH([libgcrypt-prefix],
114 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
117 LIBGCRYPT="libgcrypt"
118 LIBGCRYPT_PREFIX="no"
119 LIBGCRYPT_LIBDIR="no"
122 LIBGCRYPT="$withval/lib/libgcrypt"
123 LIBGCRYPT_PREFIX="$withval"
124 LIBGCRYPT_LIBDIR="$withval/lib"
127 [LIBGCRYPT="libgcrypt"
128 LIBGCRYPT_PREFIX="no"
129 LIBGCRYPT_LIBDIR="no"])
131 AC_ARG_WITH([libgcrypt-libdir],
132 [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
133 [search for GNU libgcrypt's shared library in DIR])],
136 LIBGCRYPT="libgcrypt"
137 LIBGCRYPT_LIBDIR="no"
140 LIBGCRYPT="$withval/libgcrypt"
141 LIBGCRYPT_LIBDIR="$withval"
144 [if test "x$LIBGCRYPT" = x; then
145 LIBGCRYPT="libgcrypt"
147 if test "x$LIBGCRYPT_LIBDIR" = x; then
148 LIBGCRYPT_LIBDIR="no"
151 dnl Library name suitable for `dynamic-link'.
152 AC_MSG_CHECKING([for libgcrypt shared library name])
153 AC_MSG_RESULT([$LIBGCRYPT])
154 AC_SUBST([LIBGCRYPT])
155 AC_SUBST([LIBGCRYPT_PREFIX])
156 AC_SUBST([LIBGCRYPT_LIBDIR])
158 GUIX_ASSERT_LIBGCRYPT_USABLE
162 m4_include([config-daemon.ac])
164 dnl `dot' (from the Graphviz package) is only needed for maintainers.
165 dnl See `HACKING' for more info.
166 AM_MISSING_PROG([DOT], [dot])
168 AC_CONFIG_FILES([Makefile
170 po/packages/Makefile.in
173 AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
174 AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
175 AC_CONFIG_FILES([test-env], [chmod +x test-env])