gnu: Add support for Guile in Linux initrd.
[jackhill/guix/guix.git] / configure.ac
CommitLineData
af51c820
LC
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.68)
5fc5c2f3 5AC_INIT([GNU Guix], [0.2], [bug-guix@gnu.org], [guix],
ec528860 6 [http://gnu.org/software/guix/])
af51c820
LC
7AC_CONFIG_AUX_DIR([build-aux])
8
8aab64fc 9AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects \
af51c820
LC
10 color-tests parallel-tests])
11
12AC_CONFIG_SRCDIR([guix.scm])
13AC_CONFIG_MACRO_DIR([m4])
14
c2033df4
LC
15dnl For the C++ code. This must be used early.
16AC_USE_SYSTEM_EXTENSIONS
17
f68b0893 18AM_GNU_GETTEXT([external])
0a042340 19AM_GNU_GETTEXT_VERSION([0.18.1])
f68b0893 20
af51c820
LC
21guilemoduledir="${datarootdir}/guile/site/2.0"
22AC_SUBST([guilemoduledir])
23
c2033df4
LC
24GUIX_SYSTEM_TYPE
25
26AC_ARG_WITH(store-dir,
27 AC_HELP_STRING([--with-store-dir=PATH],
28 [path of the store (defaults to /nix/store)]),
29 [storedir="$withval"],
30 [storedir="/nix/store"])
31AC_SUBST(storedir)
73d96596 32
3a61f801 33AC_ARG_ENABLE([daemon],
c9b70836 34 [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
3a61f801 35 [guix_build_daemon="$enableval"],
c9b70836 36 [guix_build_daemon="yes"])
3a61f801 37
d8eea3d2
LC
38# Prepare a version of $localstatedir that does not contain references
39# to shell variables.
40guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`"
41AC_SUBST([guix_localstatedir])
42
af51c820
LC
43PKG_CHECK_MODULES([GUILE], [guile-2.0])
44AC_PATH_PROG([GUILE], [guile])
45AC_PATH_PROG([GUILD], [guild])
73f9a978
CN
46if test "x$GUILD" = "x"; then
47 AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
48fi
af51c820
LC
49
50AC_ARG_WITH([nix-prefix],
51 [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
52 [case "$withval" in
53 yes|no) ;;
437e0729
LC
54 *)
55 NIX_PREFIX="$withval"
56 PATH="$NIX_PREFIX/bin:$PATH"; export PATH
57 AC_SUBST([NIX_PREFIX])
58 ;;
af51c820
LC
59 esac],
60 [])
61
62AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
63AC_PATH_PROG([NIX_HASH], [nix-hash])
3a61f801 64if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
af51c820
LC
65 AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
66fi
67
c217708f
LC
68if test "x$NIX_INSTANTIATE" = "x"; then
69 # This program is an optional dependency, so we just want it to be
70 # taken from $PATH if it's not available right now.
71 NIX_INSTANTIATE="nix-instantiate"
72fi
73
af51c820
LC
74AC_ARG_WITH([nixpkgs],
75 [AS_HELP_STRING([--with-nixpkgs=DIR], [search for Nixpkgs in DIR])],
76 [case "$withval" in
77 yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
78 *) NIXPKGS="$withval";;
79 esac],
80 [])
81
e76bdf8b 82AC_MSG_CHECKING([for Nixpkgs source tree])
af51c820 83if test -f "$NIXPKGS/default.nix"; then
af51c820
LC
84 AC_MSG_RESULT([$NIXPKGS])
85 AC_SUBST([NIXPKGS])
86else
e76bdf8b 87 AC_MSG_RESULT([not found])
af51c820
LC
88fi
89
3a310cc0
LC
90AC_ARG_WITH([libgcrypt-prefix],
91 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
92 [case "$withval" in
93 yes|no)
94 LIBGCRYPT="libgcrypt"
d388c2c4 95 LIBGCRYPT_PREFIX="no"
3a310cc0
LC
96 ;;
97 *)
98 LIBGCRYPT="$withval/lib/libgcrypt"
d388c2c4 99 LIBGCRYPT_PREFIX="$withval"
3a310cc0
LC
100 ;;
101 esac],
102 [LIBGCRYPT="libgcrypt"])
103
104dnl Library name suitable for `dynamic-link'.
105AC_MSG_CHECKING([for libgcrypt shared library name])
106AC_MSG_RESULT([$LIBGCRYPT])
107AC_SUBST([LIBGCRYPT])
d388c2c4
LC
108AC_SUBST([LIBGCRYPT_PREFIX])
109
110GUIX_ASSERT_LIBGCRYPT_USABLE
111
c2033df4
LC
112AC_CACHE_SAVE
113
114m4_include([config-daemon.ac])
3a310cc0 115
14a1c319
LC
116AC_CONFIG_FILES([Makefile
117 po/Makefile.in
8dc2ecfc
LC
118 guix/config.scm])
119
120AC_CONFIG_FILES([guix-build
c52a5bf0 121 guix-download
10226c05 122 guix-import
0afdc485 123 guix-package
fe8ff028 124 guix-gc
69cfce50 125 pre-inst-env
8dc2ecfc 126 test-env],
fe8ff028
LC
127 [chmod +x guix-build guix-download guix-import guix-package guix-gc \
128 pre-inst-env test-env])
af51c820
LC
129
130AC_OUTPUT