gnu: python-tempora: Switch to pyproject-build-system.
[jackhill/guix/guix.git] / configure.ac
... / ...
CommitLineData
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 [bug-guix@gnu.org], [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
76# Prepare a version of $localstatedir & co. that does not contain references
77# to shell variables.
78guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`"
79guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
80guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
81guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
82AC_SUBST([guix_localstatedir])
83AC_SUBST([guix_sysconfdir])
84AC_SUBST([guix_sbindir])
85
86GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
87AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
88
89dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
90dnl Make sure they are available.
91m4_pattern_forbid([PKG_CHECK_MODULES])
92m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
93m4_pattern_forbid([^GUILE_P])
94m4_pattern_allow([^GUILE_PKG_ERRORS])
95m4_pattern_forbid([^GUIX_])
96
97dnl Search for 'guile' and 'guild'. This macro defines
98dnl 'GUILE_EFFECTIVE_VERSION'.
99GUILE_PKG([3.0])
100GUILE_PROGS
101if test "x$GUILD" = "x"; then
102 AC_MSG_ERROR(['guild' binary not found; please check your Guile installation.])
103fi
104
105dnl (guix ui), notably, requires 'default-optimization-level' added in 3.0.3.
106PKG_CHECK_MODULES([GUILE], [guile-3.0 >= 3.0.3])
107
108dnl Get CFLAGS and LDFLAGS for libguile.
109GUILE_FLAGS
110
111dnl Installation directories for .scm and .go files.
112guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
113guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
114AC_SUBST([guilemoduledir])
115AC_SUBST([guileobjectdir])
116
117dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix
118dnl pull', among other things.
119GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)])
120if test "x$have_gnutls" != "xyes"; then
121 AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.])
122fi
123
124dnl Check for Guile-Git.
125GUILE_MODULE_AVAILABLE([have_guile_git], [(git)])
126if test "x$have_guile_git" != "xyes"; then
127 AC_MSG_ERROR([Guile-Git is missing; please install it.])
128fi
129
130dnl Check for Guile-JSON.
131GUIX_CHECK_GUILE_JSON
132if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
133 AC_MSG_ERROR([Guile-JSON is missing; please install it.])
134fi
135
136dnl Guile-Sqlite3 is used by the (guix store ...) modules.
137GUIX_CHECK_GUILE_SQLITE3
138if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
139 AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
140fi
141
142GUIX_CHECK_GUILE_GCRYPT
143if test "x$guix_cv_have_recent_guile_gcrypt" != "xyes"; then
144 AC_MSG_ERROR([A recent Guile-Gcrypt could not be found; please install it.])
145fi
146
147GUIX_CHECK_GUILE_GIT
148if test "x$guix_cv_have_recent_guile_git" != "xyes"; then
149 AC_MSG_ERROR([A recent Guile-Git could not be found; please install it.])
150fi
151
152dnl Check for the optional Guile-Lib.
153GUILE_MODULE_EXPORTS([have_guile_lib], [(htmlprag)], [%strict-tokenizer?])
154AM_CONDITIONAL([HAVE_GUILE_LIB], [test "x$have_guile_lib" = "xyes"])
155AM_COND_IF(HAVE_GUILE_LIB,,
156 [AC_MSG_WARN([The Guile-Lib requirement was not satisfied (>= 0.2.7);
157Some features such as the Go importer will not be usable.])])
158
159dnl Check for Guile-zlib.
160GUIX_CHECK_GUILE_ZLIB
161if test "x$guix_cv_have_recent_guile_zlib" != "xyes"; then
162 AC_MSG_ERROR([A recent Guile-zlib could not be found; please install it.])
163fi
164
165dnl Check for Guile-lzlib.
166GUILE_MODULE_AVAILABLE([have_guile_lzlib], [(lzlib)])
167if test "x$have_guile_lzlib" != "xyes"; then
168 AC_MSG_ERROR([Guile-lzlib is missing; please install it.])
169fi
170
171dnl Check for Guile-Avahi.
172GUILE_MODULE_AVAILABLE([have_guile_avahi], [(avahi)])
173AM_CONDITIONAL([HAVE_GUILE_AVAHI],
174 [test "x$have_guile_avahi" = "xyes"])
175
176dnl Guile-newt is used by the graphical installer.
177GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)])
178
179AC_ARG_ENABLE([installer],
180 AS_HELP_STRING([--enable-installer], [Build the graphical installer sources.]))
181
182AS_IF([test "x$enable_installer" = "xyes"], [
183if test "x$have_guile_newt" != "xyes"; then
184 AC_MSG_ERROR([Guile-newt could not be found; please install it.])
185fi
186])
187
188AM_CONDITIONAL([ENABLE_INSTALLER],
189 [test "x$enable_installer" = "xyes"])
190
191dnl Make sure we have a full-fledged Guile.
192GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
193
194AC_PROG_SED
195
196dnl Decompressors, for use by the substituter and other modules.
197AC_PATH_PROG([GZIP], [gzip])
198AC_PATH_PROG([BZIP2], [bzip2])
199AC_PATH_PROG([XZ], [xz])
200AC_SUBST([GZIP])
201AC_SUBST([BZIP2])
202AC_SUBST([XZ])
203
204LIBGCRYPT_LIBDIR="no"
205LIBGCRYPT_PREFIX="no"
206
207AC_ARG_WITH([libgcrypt-prefix],
208 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
209 [case "$withval" in
210 yes|no)
211 ;;
212 *)
213 LIBGCRYPT_PREFIX="$withval"
214 LIBGCRYPT_LIBDIR="$withval/lib"
215 ;;
216 esac])
217
218AC_ARG_WITH([libgcrypt-libdir],
219 [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
220 [search for GNU libgcrypt's shared library in DIR])],
221 [case "$withval" in
222 yes|no)
223 LIBGCRYPT_LIBDIR="no"
224 ;;
225 *)
226 LIBGCRYPT_LIBDIR="$withval"
227 ;;
228 esac])
229
230dnl If none of the --with-libgcrypt-* options was used, try to determine the
231dnl the library directory.
232case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
233 xnono)
234 GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
235 ;;
236esac
237
238AC_SUBST([LIBGCRYPT_PREFIX])
239AC_SUBST([LIBGCRYPT_LIBDIR])
240
241dnl Check for Guile-SSH, for the (guix ssh) module.
242GUIX_CHECK_GUILE_SSH
243AM_CONDITIONAL([HAVE_GUILE_SSH],
244 [test "x$guix_cv_have_recent_guile_ssh" = "xyes"])
245
246AC_CACHE_SAVE
247
248m4_include([config-daemon.ac])
249
250dnl `dot' (from the Graphviz package) is only needed for maintainers.
251dnl See `Building from Git' in the manual for more info.
252AM_MISSING_PROG([DOT], [dot])
253
254dnl Manual pages.
255AM_MISSING_PROG([HELP2MAN], [help2man])
256
257dnl Documentation translation.
258AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate])
259AM_MISSING_PROG([PO4A_UPDATEPO], [po4a-updatepo])
260
261case "$storedir" in
262 /gnu/store)
263 ;;
264 *)
265 AC_MSG_WARN([Using a store directory other than '/gnu/store' will prevent you])
266 AC_MSG_WARN([from downloading substitutes from gnu.org.])
267 ;;
268esac
269
270AC_CONFIG_FILES([Makefile
271 po/guix/Makefile.in
272 po/packages/Makefile.in
273 etc/guix-daemon.cil
274 guix/config.scm])
275
276AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm])
277AC_CONFIG_FILES([etc/teams.scm], [chmod +x etc/teams.scm])
278AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
279AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
280 [chmod +x pre-inst-env])
281
282AC_OUTPUT