projects/guix·blob v0.7 · refs

177 lines · 5.0 KiB

1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.68)
5AC_INIT([GNU Guix], [0.7], [[email protected]], [guix],
6 [http://www.gnu.org/software/guix/])
7AC_CONFIG_AUX_DIR([build-aux])
8
9AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects \
10 color-tests parallel-tests -Woverride])
11
12AC_CONFIG_SRCDIR([guix.scm])
13AC_CONFIG_MACRO_DIR([m4])
14
15dnl For the C++ code. This must be used early.
16AC_USE_SYSTEM_EXTENSIONS
17
18AM_GNU_GETTEXT([external])
19AM_GNU_GETTEXT_VERSION([0.18.1])
20
21guilemoduledir="${datarootdir}/guile/site/2.0"
22AC_SUBST([guilemoduledir])
23
24GUIX_SYSTEM_TYPE
25GUIX_ASSERT_SUPPORTED_SYSTEM
26
27AC_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"])
32AC_SUBST(storedir)
33
34dnl Better be verbose.
35AC_MSG_CHECKING([for the store directory])
36AC_MSG_RESULT([$storedir])
37
38AC_ARG_ENABLE([daemon],
39 [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
40 [guix_build_daemon="$enableval"],
41 [guix_build_daemon="yes"])
42
43# Prepare a version of $localstatedir & co. that does not contain references
44# to shell variables.
45guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
46guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
47guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
48guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
49AC_SUBST([guix_localstatedir])
50AC_SUBST([guix_sysconfdir])
51AC_SUBST([guix_sbindir])
52
53dnl We require the pkg.m4 set of macros from pkg-config.
54dnl Make sure it's available.
55m4_pattern_forbid([PKG_CHECK_MODULES])
56
57PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
58AC_PATH_PROG([GUILE], [guile])
59AC_PATH_PROG([GUILD], [guild])
60if test "x$GUILD" = "x"; then
61 AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
62fi
63
64dnl Make sure we have a full-fledged Guile.
65GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
66
67dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't.
68GUIX_CHECK_SRFI_37
69AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
70
71AC_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)])],
74 [case "$withval" in
75 yes|no) ;;
76 *)
77 NIX_PREFIX="$withval"
78 PATH="$NIX_PREFIX/bin:$PATH"; export PATH
79 AC_SUBST([NIX_PREFIX])
80 ;;
81 esac],
82 [])
83
84AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
85AC_PATH_PROG([NIX_HASH], [nix-hash])
86if 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'.])
88fi
89
90if 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"
94fi
95
96AC_ARG_WITH([nixpkgs],
97 [AS_HELP_STRING([--with-nixpkgs=DIR],
98 [search for Nixpkgs in DIR (for testing purposes only)])],
99 [case "$withval" in
100 yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
101 *) NIXPKGS="$withval";;
102 esac],
103 [])
104
105AC_MSG_CHECKING([for Nixpkgs source tree])
106if test -f "$NIXPKGS/default.nix"; then
107 AC_MSG_RESULT([$NIXPKGS])
108 AC_SUBST([NIXPKGS])
109else
110 AC_MSG_RESULT([not found])
111fi
112
113AC_ARG_WITH([libgcrypt-prefix],
114 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
115 [case "$withval" in
116 yes|no)
117 LIBGCRYPT="libgcrypt"
118 LIBGCRYPT_PREFIX="no"
119 LIBGCRYPT_LIBDIR="no"
120 ;;
121 *)
122 LIBGCRYPT="$withval/lib/libgcrypt"
123 LIBGCRYPT_PREFIX="$withval"
124 LIBGCRYPT_LIBDIR="$withval/lib"
125 ;;
126 esac],
127 [LIBGCRYPT="libgcrypt"
128 LIBGCRYPT_PREFIX="no"
129 LIBGCRYPT_LIBDIR="no"])
130
131AC_ARG_WITH([libgcrypt-libdir],
132 [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
133 [search for GNU libgcrypt's shared library in DIR])],
134 [case "$withval" in
135 yes|no)
136 LIBGCRYPT="libgcrypt"
137 LIBGCRYPT_LIBDIR="no"
138 ;;
139 *)
140 LIBGCRYPT="$withval/libgcrypt"
141 LIBGCRYPT_LIBDIR="$withval"
142 ;;
143 esac],
144 [if test "x$LIBGCRYPT" = x; then
145 LIBGCRYPT="libgcrypt"
146 fi
147 if test "x$LIBGCRYPT_LIBDIR" = x; then
148 LIBGCRYPT_LIBDIR="no"
149 fi])
150
151dnl Library name suitable for `dynamic-link'.
152AC_MSG_CHECKING([for libgcrypt shared library name])
153AC_MSG_RESULT([$LIBGCRYPT])
154AC_SUBST([LIBGCRYPT])
155AC_SUBST([LIBGCRYPT_PREFIX])
156AC_SUBST([LIBGCRYPT_LIBDIR])
157
158GUIX_ASSERT_LIBGCRYPT_USABLE
159
160AC_CACHE_SAVE
161
162m4_include([config-daemon.ac])
163
164dnl `dot' (from the Graphviz package) is only needed for maintainers.
165dnl See `HACKING' for more info.
166AM_MISSING_PROG([DOT], [dot])
167
168AC_CONFIG_FILES([Makefile
169 po/guix/Makefile.in
170 po/packages/Makefile.in
171 guix/config.scm])
172
173AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
174AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
175AC_CONFIG_FILES([test-env], [chmod +x test-env])
176
177AC_OUTPUT