gnu: kicad-doc: Fix build.
[jackhill/guix/guix.git] / configure.ac
CommitLineData
af51c820
LC
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
dbdae9f9 4AC_PREREQ([2.69])
e6860b5e
LC
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/])
af51c820
LC
9AC_CONFIG_AUX_DIR([build-aux])
10
05c4e379 11AM_INIT_AUTOMAKE([1.14 gnu silent-rules subdir-objects \
a84e523c 12 color-tests parallel-tests -Woverride -Wno-portability])
af51c820 13
032c7c5f
LC
14# Enable silent rules by default.
15AM_SILENT_RULES([yes])
16
af51c820
LC
17AC_CONFIG_SRCDIR([guix.scm])
18AC_CONFIG_MACRO_DIR([m4])
19
c2033df4
LC
20dnl For the C++ code. This must be used early.
21AC_USE_SYSTEM_EXTENSIONS
22
f68b0893 23AM_GNU_GETTEXT([external])
a23789bb 24AM_GNU_GETTEXT_VERSION([0.19.1])
f68b0893 25
c2033df4 26GUIX_SYSTEM_TYPE
b97556d7 27GUIX_ASSERT_SUPPORTED_SYSTEM
55daad12 28GUIX_CHANNEL_METADATA
c2033df4 29
62bc3c5b
LC
30AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
31
c2033df4 32AC_ARG_WITH(store-dir,
dbdae9f9 33 AS_HELP_STRING([--with-store-dir=PATH],
834129e0 34 [file name of the store (defaults to /gnu/store)]),
c2033df4 35 [storedir="$withval"],
834129e0 36 [storedir="/gnu/store"])
c2033df4 37AC_SUBST(storedir)
73d96596 38
ee3e157d 39AC_ARG_WITH([bash-completion-dir],
dbdae9f9 40 AS_HELP_STRING([--with-bash-completion-dir=DIR],
ee3e157d
LC
41 [name of the Bash completion directory]),
42 [bashcompletiondir="$withval"],
43 [bashcompletiondir='${sysconfdir}/bash_completion.d'])
44AC_SUBST([bashcompletiondir])
45
96dbc930 46AC_ARG_WITH([zsh-completion-dir],
dbdae9f9 47 AS_HELP_STRING([--with-zsh-completion-dir=DIR],
96dbc930
ELB
48 [name of the Zsh completion directory]),
49 [zshcompletiondir="$withval"],
50 [zshcompletiondir='${datadir}/zsh/site-functions'])
51AC_SUBST([zshcompletiondir])
52
b83fc85f 53AC_ARG_WITH([fish-completion-dir],
dbdae9f9 54 AS_HELP_STRING([--with-fish-completion-dir=DIR],
b83fc85f 55 [name of the Fish completion directory]),
56 [fishcompletiondir="$withval"],
57 [fishcompletiondir='${datadir}/fish/vendor_completions.d'])
58AC_SUBST([fishcompletiondir])
59
b617a9fe 60AC_ARG_WITH([selinux-policy-dir],
dbdae9f9 61 AS_HELP_STRING([--with-selinux-policy-dir=DIR],
b617a9fe
RW
62 [name of the SELinux policy directory]),
63 [selinux_policydir="$withval"],
64 [selinux_policydir='${datadir}/selinux/'])
65AC_SUBST([selinux_policydir])
66
834129e0
LC
67dnl Better be verbose.
68AC_MSG_CHECKING([for the store directory])
69AC_MSG_RESULT([$storedir])
70
3a61f801 71AC_ARG_ENABLE([daemon],
a4c1e99e 72 [AS_HELP_STRING([--disable-daemon], [do not build the Nix daemon (C++)])],
3a61f801 73 [guix_build_daemon="$enableval"],
c9b70836 74 [guix_build_daemon="yes"])
3a61f801 75
3f40cfde 76# Prepare a version of $localstatedir & co. that does not contain references
d8eea3d2 77# to shell variables.
6bfec3ed
LC
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"`"
d8eea3d2 82AC_SUBST([guix_localstatedir])
3f40cfde 83AC_SUBST([guix_sysconfdir])
6bfec3ed 84AC_SUBST([guix_sbindir])
d8eea3d2 85
bb251307
LC
86GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
87AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
2178ed66 88
0e991c25
LC
89dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
90dnl Make sure they are available.
ff1cbb95 91m4_pattern_forbid([PKG_CHECK_MODULES])
0e991c25 92m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
dde49cfe
LC
93m4_pattern_forbid([^GUILE_P])
94m4_pattern_allow([^GUILE_PKG_ERRORS])
28f436a9 95m4_pattern_forbid([^GUIX_])
ff1cbb95 96
608e42e7
LC
97dnl Search for 'guile' and 'guild'. This macro defines
98dnl 'GUILE_EFFECTIVE_VERSION'.
82d8ab01 99GUILE_PKG([3.0])
9d126aa2 100GUILE_PROGS
73f9a978 101if test "x$GUILD" = "x"; then
e688c2df
LC
102 AC_MSG_ERROR(['guild' binary not found; please check your Guile installation.])
103fi
104
880fe019
LC
105dnl Get CFLAGS and LDFLAGS for libguile.
106GUILE_FLAGS
107
9437fd73 108dnl Installation directories for .scm and .go files.
301d73f6 109guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
9437fd73 110guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
301d73f6 111AC_SUBST([guilemoduledir])
9437fd73 112AC_SUBST([guileobjectdir])
301d73f6 113
1dbe3a8d
LC
114dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix
115dnl pull', among other things.
116GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)])
117if test "x$have_gnutls" != "xyes"; then
118 AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.])
119fi
120
7441f1db
LC
121dnl Check for Guile-Git.
122GUILE_MODULE_AVAILABLE([have_guile_git], [(git)])
123if test "x$have_guile_git" != "xyes"; then
124 AC_MSG_ERROR([Guile-Git is missing; please install it.])
125fi
126
6776af04 127dnl Check for Guile-JSON.
81c3dc32
LC
128GUIX_CHECK_GUILE_JSON
129if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
6776af04
EB
130 AC_MSG_ERROR([Guile-JSON is missing; please install it.])
131fi
1b3e9685 132
d59e75f3
LC
133dnl Guile-Sqlite3 is used by the (guix store ...) modules.
134GUIX_CHECK_GUILE_SQLITE3
c5a2e1ff
LC
135if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
136 AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
137fi
d59e75f3 138
c1dc50ab
LC
139GUIX_CHECK_GUILE_GCRYPT
140if test "x$guix_cv_have_recent_guile_gcrypt" != "xyes"; then
141 AC_MSG_ERROR([A recent Guile-Gcrypt could not be found; please install it.])
ca719424
LC
142fi
143
59bb1ae3
LC
144GUIX_CHECK_GUILE_GIT
145if test "x$guix_cv_have_recent_guile_git" != "xyes"; then
146 AC_MSG_ERROR([A recent Guile-Git could not be found; please install it.])
147fi
148
ee990899
MC
149dnl Check for the optional Guile-Lib.
150GUILE_MODULE_EXPORTS([have_guile_lib], [(htmlprag)], [%strict-tokenizer?])
151AM_CONDITIONAL([HAVE_GUILE_LIB], [test "x$have_guile_lib" = "xyes"])
152AM_COND_IF(HAVE_GUILE_LIB,,
153 [AC_MSG_WARN([The Guile-Lib requirement was not satisfied (>= 0.2.7);
154Some features such as the Go importer will not be usable.])])
155
4c0c65ac 156dnl Check for Guile-zlib.
62a09136
LC
157GUIX_CHECK_GUILE_ZLIB
158if test "x$guix_cv_have_recent_guile_zlib" != "xyes"; then
159 AC_MSG_ERROR([A recent Guile-zlib could not be found; please install it.])
4c0c65ac
MO
160fi
161
162dnl Check for Guile-lzlib.
163GUILE_MODULE_AVAILABLE([have_guile_lzlib], [(lzlib)])
164if test "x$have_guile_lzlib" != "xyes"; then
165 AC_MSG_ERROR([Guile-lzlib is missing; please install it.])
166fi
167
375cc7de
MO
168dnl Check for Guile-Avahi.
169GUILE_MODULE_AVAILABLE([have_guile_avahi], [(avahi)])
35a32fef
MO
170AM_CONDITIONAL([HAVE_GUILE_AVAHI],
171 [test "x$have_guile_avahi" = "xyes"])
375cc7de 172
d0f3a672
MO
173dnl Guile-newt is used by the graphical installer.
174GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)])
7d328e34
MO
175
176AC_ARG_ENABLE([installer],
177 AS_HELP_STRING([--enable-installer], [Build the graphical installer sources.]))
178
179AS_IF([test "x$enable_installer" = "xyes"], [
d0f3a672
MO
180if test "x$have_guile_newt" != "xyes"; then
181 AC_MSG_ERROR([Guile-newt could not be found; please install it.])
182fi
7d328e34
MO
183])
184
185AM_CONDITIONAL([ENABLE_INSTALLER],
186 [test "x$enable_installer" = "xyes"])
d0f3a672 187
9c7dd33a
LC
188dnl Make sure we have a full-fledged Guile.
189GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
190
cba386c1
ML
191AC_PROG_SED
192
cd48eae5
LC
193dnl Decompressors, for use by the substituter and other modules.
194AC_PATH_PROG([GZIP], [gzip])
195AC_PATH_PROG([BZIP2], [bzip2])
196AC_PATH_PROG([XZ], [xz])
197AC_SUBST([GZIP])
198AC_SUBST([BZIP2])
199AC_SUBST([XZ])
200
dd01fecd
LC
201LIBGCRYPT_LIBDIR="no"
202LIBGCRYPT_PREFIX="no"
203
3a310cc0
LC
204AC_ARG_WITH([libgcrypt-prefix],
205 [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
206 [case "$withval" in
207 yes|no)
3a310cc0
LC
208 ;;
209 *)
d388c2c4 210 LIBGCRYPT_PREFIX="$withval"
14af289e 211 LIBGCRYPT_LIBDIR="$withval/lib"
3a310cc0 212 ;;
dd01fecd 213 esac])
3a310cc0 214
14af289e
LC
215AC_ARG_WITH([libgcrypt-libdir],
216 [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
217 [search for GNU libgcrypt's shared library in DIR])],
218 [case "$withval" in
219 yes|no)
14af289e
LC
220 LIBGCRYPT_LIBDIR="no"
221 ;;
222 *)
14af289e
LC
223 LIBGCRYPT_LIBDIR="$withval"
224 ;;
dd01fecd
LC
225 esac])
226
227dnl If none of the --with-libgcrypt-* options was used, try to determine the
ca719424 228dnl the library directory.
dd01fecd
LC
229case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
230 xnono)
231 GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
dd01fecd
LC
232 ;;
233esac
14af289e 234
d388c2c4 235AC_SUBST([LIBGCRYPT_PREFIX])
14af289e 236AC_SUBST([LIBGCRYPT_LIBDIR])
d388c2c4 237
987a29ba
LC
238dnl Check for Guile-SSH, for the (guix ssh) module.
239GUIX_CHECK_GUILE_SSH
240AM_CONDITIONAL([HAVE_GUILE_SSH],
241 [test "x$guix_cv_have_recent_guile_ssh" = "xyes"])
242
c2033df4
LC
243AC_CACHE_SAVE
244
245m4_include([config-daemon.ac])
3a310cc0 246
cb9e50f6 247dnl `dot' (from the Graphviz package) is only needed for maintainers.
8c01b9d0 248dnl See `Building from Git' in the manual for more info.
cb9e50f6
LC
249AM_MISSING_PROG([DOT], [dot])
250
52eca736
LC
251dnl Manual pages.
252AM_MISSING_PROG([HELP2MAN], [help2man])
253
b9fe8fd6
JL
254dnl Documentation translation.
255AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate])
256AM_MISSING_PROG([PO4A_UPDATEPO], [po4a-updatepo])
257
d480ed7e
LC
258case "$storedir" in
259 /gnu/store)
260 ;;
261 *)
262 AC_MSG_WARN([Using a store directory other than '/gnu/store' will prevent you])
263 AC_MSG_WARN([from downloading substitutes from gnu.org.])
264 ;;
265esac
266
14a1c319 267AC_CONFIG_FILES([Makefile
ef1a9bb7 268 po/guix/Makefile.in
ee764179 269 po/packages/Makefile.in
b617a9fe
RW
270 etc/guix-daemon.cil
271 guix/config.scm])
8dc2ecfc 272
76a841cc 273AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm])
a1097caa
ML
274AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
275AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
276 [chmod +x pre-inst-env])
af51c820
LC
277
278AC_OUTPUT