projects/guix·blob wip-node-riscv64 · refs

299 lines · 8.9 KiB

1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.69])
5AC_INIT([GNU Guix],
6 [m4_esyscmd([build-aux/git-version-gen .tarball-version])],
7 [[email protected]], [guix],
8 [https://www.gnu.org/software/guix/])
9AC_CONFIG_AUX_DIR([build-aux])
10
11AM_INIT_AUTOMAKE([1.14 gnu tar-ustar silent-rules subdir-objects \
12 color-tests parallel-tests -Woverride -Wno-portability])
13
14# Enable silent rules by default.
15AM_SILENT_RULES([yes])
16
17AC_CONFIG_SRCDIR([guix.scm])
18AC_CONFIG_MACRO_DIR([m4])
19
20dnl For the C++ code. This must be used early.
21AC_USE_SYSTEM_EXTENSIONS
22
23AM_GNU_GETTEXT([external])
24AM_GNU_GETTEXT_VERSION([0.19.1])
25
26GUIX_SYSTEM_TYPE
27GUIX_ASSERT_SUPPORTED_SYSTEM
28GUIX_CHANNEL_METADATA
29
30AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
31
32AC_ARG_WITH(store-dir,
33 AS_HELP_STRING([--with-store-dir=PATH],
34 [file name of the store (defaults to /gnu/store)]),
35 [storedir="$withval"],
36 [storedir="/gnu/store"])
37AC_SUBST(storedir)
38
39AC_ARG_WITH([bash-completion-dir],
40 AS_HELP_STRING([--with-bash-completion-dir=DIR],
41 [name of the Bash completion directory]),
42 [bashcompletiondir="$withval"],
43 [bashcompletiondir='${sysconfdir}/bash_completion.d'])
44AC_SUBST([bashcompletiondir])
45
46AC_ARG_WITH([zsh-completion-dir],
47 AS_HELP_STRING([--with-zsh-completion-dir=DIR],
48 [name of the Zsh completion directory]),
49 [zshcompletiondir="$withval"],
50 [zshcompletiondir='${datadir}/zsh/site-functions'])
51AC_SUBST([zshcompletiondir])
52
53AC_ARG_WITH([fish-completion-dir],
54 AS_HELP_STRING([--with-fish-completion-dir=DIR],
55 [name of the Fish completion directory]),
56 [fishcompletiondir="$withval"],
57 [fishcompletiondir='${datadir}/fish/vendor_completions.d'])
58AC_SUBST([fishcompletiondir])
59
60AC_ARG_WITH([selinux-policy-dir],
61 AS_HELP_STRING([--with-selinux-policy-dir=DIR],
62 [name of the SELinux policy directory]),
63 [selinux_policydir="$withval"],
64 [selinux_policydir='${datadir}/selinux/'])
65AC_SUBST([selinux_policydir])
66
67dnl Better be verbose.
68AC_MSG_CHECKING([for the store directory])
69AC_MSG_RESULT([$storedir])
70
71AC_ARG_ENABLE([daemon],
72 [AS_HELP_STRING([--disable-daemon], [do not build the Nix daemon (C++)])],
73 [guix_build_daemon="$enableval"],
74 [guix_build_daemon="yes"])
75
76dnl Prepare a version of $localstatedir & co. that does not contain references
77dnl to shell variables. Also set some sane default directory variables for
78dnl use with the Guix. This also causes localstatedir to be /var and
79dnl sysconfdir to be /etc.
80test "$prefix" = NONE && prefix=
81guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
82guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
83guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
84AC_SUBST([guix_localstatedir])
85AC_SUBST([guix_sysconfdir])
86AC_SUBST([guix_sbindir])
87
88GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
89AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
90
91dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
92dnl Make sure they are available.
93m4_pattern_forbid([PKG_CHECK_MODULES])
94m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
95m4_pattern_forbid([^GUILE_P])
96m4_pattern_allow([^GUILE_PKG_ERRORS])
97m4_pattern_forbid([^GUIX_])
98
99dnl Search for 'guile' and 'guild'. This macro defines
100dnl 'GUILE_EFFECTIVE_VERSION'.
101GUILE_PKG([3.0])
102GUILE_PROGS
103if test "x$GUILD" = "x"; then
104 AC_MSG_ERROR(['guild' binary not found; please check your Guile installation.])
105fi
106
107dnl (guix ui), notably, requires 'default-optimization-level' added in 3.0.3.
108PKG_CHECK_MODULES([GUILE], [guile-3.0 >= 3.0.3])
109
110dnl Get CFLAGS and LDFLAGS for libguile.
111GUILE_FLAGS
112
113dnl Installation directories for .scm and .go files.
114guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
115guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
116AC_SUBST([guilemoduledir])
117AC_SUBST([guileobjectdir])
118
119dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix
120dnl pull', among other things.
121GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)])
122if test "x$have_gnutls" != "xyes"; then
123 AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.])
124fi
125
126dnl Check for Guile-Git.
127GUILE_MODULE_AVAILABLE([have_guile_git], [(git)])
128if test "x$have_guile_git" != "xyes"; then
129 AC_MSG_ERROR([Guile-Git is missing; please install it.])
130fi
131
132dnl Check for Guile-JSON.
133GUIX_CHECK_GUILE_JSON
134if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
135 AC_MSG_ERROR([Guile-JSON is missing; please install it.])
136fi
137
138dnl Guile-Sqlite3 is used by the (guix store ...) modules.
139GUIX_CHECK_GUILE_SQLITE3
140if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
141 AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
142fi
143
144GUIX_CHECK_GUILE_GCRYPT
145if test "x$guix_cv_have_recent_guile_gcrypt" != "xyes"; then
146 AC_MSG_ERROR([A recent Guile-Gcrypt could not be found; please install it.])
147fi
148
149GUIX_CHECK_GUILE_GIT
150if test "x$guix_cv_have_recent_guile_git" != "xyes"; then
151 AC_MSG_ERROR([A recent Guile-Git could not be found; please install it.])
152fi
153
154dnl Check for the optional Guile-Lib.
155GUILE_MODULE_EXPORTS([have_guile_lib], [(htmlprag)], [%strict-tokenizer?])
156AM_CONDITIONAL([HAVE_GUILE_LIB], [test "x$have_guile_lib" = "xyes"])
157AM_COND_IF(HAVE_GUILE_LIB,,
158 [AC_MSG_WARN([The Guile-Lib requirement was not satisfied (>= 0.2.7);
159Some features such as the Go importer will not be usable.])])
160
161dnl Check for Guile-zlib.
162GUIX_CHECK_GUILE_ZLIB
163if test "x$guix_cv_have_recent_guile_zlib" != "xyes"; then
164 AC_MSG_ERROR([A recent Guile-zlib could not be found; please install it.])
165fi
166
167dnl Check for Guile-lzlib.
168GUILE_MODULE_AVAILABLE([have_guile_lzlib], [(lzlib)])
169if test "x$have_guile_lzlib" != "xyes"; then
170 AC_MSG_ERROR([Guile-lzlib is missing; please install it.])
171fi
172
173dnl Check for Guile-Avahi.
174GUILE_MODULE_AVAILABLE([have_guile_avahi], [(avahi)])
175AM_CONDITIONAL([HAVE_GUILE_AVAHI],
176 [test "x$have_guile_avahi" = "xyes"])
177
178dnl Guile-newt is used by the graphical installer.
179GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)])
180
181AC_ARG_ENABLE([installer],
182 AS_HELP_STRING([--enable-installer], [Build the graphical installer sources.]))
183
184AS_IF([test "x$enable_installer" = "xyes"], [
185if test "x$have_guile_newt" != "xyes"; then
186 AC_MSG_ERROR([Guile-newt could not be found; please install it.])
187fi
188])
189
190AM_CONDITIONAL([ENABLE_INSTALLER],
191 [test "x$enable_installer" = "xyes"])
192
193dnl Make sure we have a full-fledged Guile.
194GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
195
196AC_PROG_SED
197
198dnl Decompressors, for use by the substituter and other modules.
199AC_PATH_PROG([GZIP], [gzip])
200AC_PATH_PROG([BZIP2], [bzip2])
201AC_PATH_PROG([XZ], [xz])
202AC_SUBST([GZIP])
203AC_SUBST([BZIP2])
204AC_SUBST([XZ])
205
206dnl Git is now required for the "builtin:git-download" derivation builder.
207AC_PATH_PROG([GIT], [git])
208if test "x$GIT" = "x"; then
209 AC_MSG_ERROR([Git is missing; please install it.])
210fi
211AC_SUBST([GIT])
212
213LIBGCRYPT_LIBDIR="no"
214LIBGCRYPT_PREFIX="no"
215
216AC_ARG_WITH([libgcrypt-prefix],
217 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
218 [case "$withval" in
219 yes|no)
220 ;;
221 *)
222 LIBGCRYPT_PREFIX="$withval"
223 LIBGCRYPT_LIBDIR="$withval/lib"
224 ;;
225 esac])
226
227AC_ARG_WITH([libgcrypt-libdir],
228 [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
229 [search for GNU libgcrypt's shared library in DIR])],
230 [case "$withval" in
231 yes|no)
232 LIBGCRYPT_LIBDIR="no"
233 ;;
234 *)
235 LIBGCRYPT_LIBDIR="$withval"
236 ;;
237 esac])
238
239dnl If none of the --with-libgcrypt-* options was used, try to determine the
240dnl the library directory.
241case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
242 xnono)
243 GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
244 ;;
245esac
246
247AC_SUBST([LIBGCRYPT_PREFIX])
248AC_SUBST([LIBGCRYPT_LIBDIR])
249
250dnl Check for Guile-SSH, for the (guix ssh) module.
251GUIX_CHECK_GUILE_SSH
252AM_CONDITIONAL([HAVE_GUILE_SSH],
253 [test "x$guix_cv_have_recent_guile_ssh" = "xyes"])
254
255AC_CACHE_SAVE
256
257m4_include([config-daemon.ac])
258
259dnl `dot' (from the Graphviz package) is only needed for maintainers.
260dnl See `Building from Git' in the manual for more info.
261AM_MISSING_PROG([DOT], [dot])
262
263dnl Manual pages.
264AM_MISSING_PROG([HELP2MAN], [help2man])
265
266dnl Documentation translation.
267AM_MISSING_PROG([PO4A], [po4a])
268
269AC_MSG_CHECKING([if building from git])
270if test -e .git; then
271 in_git_p=yes
272else
273 in_git_p=no
274fi
275AC_MSG_RESULT([$in_git_p])
276AM_CONDITIONAL([in_git_p],
277 [test "x$in_git_p" = "xyes"])
278
279case "$storedir" in
280 /gnu/store)
281 ;;
282 *)
283 AC_MSG_WARN([Using a store directory other than '/gnu/store' will prevent you])
284 AC_MSG_WARN([from downloading substitutes from gnu.org.])
285 ;;
286esac
287
288AC_CONFIG_FILES([Makefile
289 po/guix/Makefile.in
290 po/packages/Makefile.in
291 etc/guix-daemon.cil
292 guix/config.scm])
293
294AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm])
295AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
296AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
297 [chmod +x pre-inst-env])
298
299AC_OUTPUT