Commit | Line | Data |
---|---|---|
af51c820 LC |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
dbdae9f9 | 4 | AC_PREREQ([2.69]) |
e6860b5e LC |
5 | AC_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 |
9 | AC_CONFIG_AUX_DIR([build-aux]) |
10 | ||
05c4e379 | 11 | AM_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. |
15 | AM_SILENT_RULES([yes]) | |
16 | ||
af51c820 LC |
17 | AC_CONFIG_SRCDIR([guix.scm]) |
18 | AC_CONFIG_MACRO_DIR([m4]) | |
19 | ||
c2033df4 LC |
20 | dnl For the C++ code. This must be used early. |
21 | AC_USE_SYSTEM_EXTENSIONS | |
22 | ||
f68b0893 | 23 | AM_GNU_GETTEXT([external]) |
5ac12a4f | 24 | AM_GNU_GETTEXT_VERSION([0.18.1]) |
f68b0893 | 25 | |
c2033df4 | 26 | GUIX_SYSTEM_TYPE |
b97556d7 | 27 | GUIX_ASSERT_SUPPORTED_SYSTEM |
55daad12 | 28 | GUIX_CHANNEL_METADATA |
c2033df4 | 29 | |
62bc3c5b LC |
30 | AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"]) |
31 | ||
c2033df4 | 32 | AC_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 | 37 | AC_SUBST(storedir) |
73d96596 | 38 | |
ee3e157d | 39 | AC_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']) | |
44 | AC_SUBST([bashcompletiondir]) | |
45 | ||
96dbc930 | 46 | AC_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']) | |
51 | AC_SUBST([zshcompletiondir]) | |
52 | ||
b83fc85f | 53 | AC_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']) | |
58 | AC_SUBST([fishcompletiondir]) | |
59 | ||
b617a9fe | 60 | AC_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/']) | |
65 | AC_SUBST([selinux_policydir]) | |
66 | ||
834129e0 LC |
67 | dnl Better be verbose. |
68 | AC_MSG_CHECKING([for the store directory]) | |
69 | AC_MSG_RESULT([$storedir]) | |
70 | ||
3a61f801 | 71 | AC_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 |
78 | guix_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`" |
79 | guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`" | |
80 | guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`" | |
81 | guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`" | |
d8eea3d2 | 82 | AC_SUBST([guix_localstatedir]) |
3f40cfde | 83 | AC_SUBST([guix_sysconfdir]) |
6bfec3ed | 84 | AC_SUBST([guix_sbindir]) |
d8eea3d2 | 85 | |
bb251307 LC |
86 | GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests]) |
87 | AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"]) | |
2178ed66 | 88 | |
0e991c25 LC |
89 | dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.) |
90 | dnl Make sure they are available. | |
ff1cbb95 | 91 | m4_pattern_forbid([PKG_CHECK_MODULES]) |
0e991c25 | 92 | m4_pattern_forbid([GUILE_MODULE_AVAILABLE]) |
dde49cfe LC |
93 | m4_pattern_forbid([^GUILE_P]) |
94 | m4_pattern_allow([^GUILE_PKG_ERRORS]) | |
28f436a9 | 95 | m4_pattern_forbid([^GUIX_]) |
ff1cbb95 | 96 | |
608e42e7 LC |
97 | dnl Search for 'guile' and 'guild'. This macro defines |
98 | dnl 'GUILE_EFFECTIVE_VERSION'. | |
7b2a47a7 | 99 | GUILE_PKG([3.0 2.2]) |
9d126aa2 | 100 | GUILE_PROGS |
73f9a978 | 101 | if test "x$GUILD" = "x"; then |
e688c2df LC |
102 | AC_MSG_ERROR(['guild' binary not found; please check your Guile installation.]) |
103 | fi | |
104 | ||
105 | if test "x$GUILE_EFFECTIVE_VERSION" = "x2.2"; then | |
4f621a2b | 106 | PKG_CHECK_MODULES([GUILE], [guile-2.2 >= 2.2.6]) |
73f9a978 | 107 | fi |
af51c820 | 108 | |
880fe019 LC |
109 | dnl Get CFLAGS and LDFLAGS for libguile. |
110 | GUILE_FLAGS | |
111 | ||
9437fd73 | 112 | dnl Installation directories for .scm and .go files. |
301d73f6 | 113 | guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION" |
9437fd73 | 114 | guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache" |
301d73f6 | 115 | AC_SUBST([guilemoduledir]) |
9437fd73 | 116 | AC_SUBST([guileobjectdir]) |
301d73f6 | 117 | |
1dbe3a8d LC |
118 | dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix |
119 | dnl pull', among other things. | |
120 | GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)]) | |
121 | if test "x$have_gnutls" != "xyes"; then | |
122 | AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.]) | |
123 | fi | |
124 | ||
7441f1db LC |
125 | dnl Check for Guile-Git. |
126 | GUILE_MODULE_AVAILABLE([have_guile_git], [(git)]) | |
127 | if test "x$have_guile_git" != "xyes"; then | |
128 | AC_MSG_ERROR([Guile-Git is missing; please install it.]) | |
129 | fi | |
130 | ||
6776af04 | 131 | dnl Check for Guile-JSON. |
81c3dc32 LC |
132 | GUIX_CHECK_GUILE_JSON |
133 | if test "x$guix_cv_have_recent_guile_json" != "xyes"; then | |
6776af04 EB |
134 | AC_MSG_ERROR([Guile-JSON is missing; please install it.]) |
135 | fi | |
1b3e9685 | 136 | |
d59e75f3 LC |
137 | dnl Guile-Sqlite3 is used by the (guix store ...) modules. |
138 | GUIX_CHECK_GUILE_SQLITE3 | |
c5a2e1ff LC |
139 | if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then |
140 | AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.]) | |
141 | fi | |
d59e75f3 | 142 | |
c1dc50ab LC |
143 | GUIX_CHECK_GUILE_GCRYPT |
144 | if test "x$guix_cv_have_recent_guile_gcrypt" != "xyes"; then | |
145 | AC_MSG_ERROR([A recent Guile-Gcrypt could not be found; please install it.]) | |
ca719424 LC |
146 | fi |
147 | ||
59bb1ae3 LC |
148 | GUIX_CHECK_GUILE_GIT |
149 | if test "x$guix_cv_have_recent_guile_git" != "xyes"; then | |
150 | AC_MSG_ERROR([A recent Guile-Git could not be found; please install it.]) | |
151 | fi | |
152 | ||
4c0c65ac MO |
153 | dnl Check for Guile-zlib. |
154 | GUILE_MODULE_AVAILABLE([have_guile_zlib], [(zlib)]) | |
155 | if test "x$have_guile_zlib" != "xyes"; then | |
156 | AC_MSG_ERROR([Guile-zlib is missing; please install it.]) | |
157 | fi | |
158 | ||
159 | dnl Check for Guile-lzlib. | |
160 | GUILE_MODULE_AVAILABLE([have_guile_lzlib], [(lzlib)]) | |
161 | if test "x$have_guile_lzlib" != "xyes"; then | |
162 | AC_MSG_ERROR([Guile-lzlib is missing; please install it.]) | |
163 | fi | |
164 | ||
375cc7de MO |
165 | dnl Check for Guile-Avahi. |
166 | GUILE_MODULE_AVAILABLE([have_guile_avahi], [(avahi)]) | |
35a32fef MO |
167 | AM_CONDITIONAL([HAVE_GUILE_AVAHI], |
168 | [test "x$have_guile_avahi" = "xyes"]) | |
375cc7de | 169 | |
d0f3a672 MO |
170 | dnl Guile-newt is used by the graphical installer. |
171 | GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)]) | |
7d328e34 MO |
172 | |
173 | AC_ARG_ENABLE([installer], | |
174 | AS_HELP_STRING([--enable-installer], [Build the graphical installer sources.])) | |
175 | ||
176 | AS_IF([test "x$enable_installer" = "xyes"], [ | |
d0f3a672 MO |
177 | if test "x$have_guile_newt" != "xyes"; then |
178 | AC_MSG_ERROR([Guile-newt could not be found; please install it.]) | |
179 | fi | |
7d328e34 MO |
180 | ]) |
181 | ||
182 | AM_CONDITIONAL([ENABLE_INSTALLER], | |
183 | [test "x$enable_installer" = "xyes"]) | |
d0f3a672 | 184 | |
9c7dd33a LC |
185 | dnl Make sure we have a full-fledged Guile. |
186 | GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads]) | |
187 | ||
cba386c1 ML |
188 | AC_PROG_SED |
189 | ||
cd48eae5 LC |
190 | dnl Decompressors, for use by the substituter and other modules. |
191 | AC_PATH_PROG([GZIP], [gzip]) | |
192 | AC_PATH_PROG([BZIP2], [bzip2]) | |
193 | AC_PATH_PROG([XZ], [xz]) | |
194 | AC_SUBST([GZIP]) | |
195 | AC_SUBST([BZIP2]) | |
196 | AC_SUBST([XZ]) | |
197 | ||
af51c820 | 198 | AC_ARG_WITH([nixpkgs], |
bb0a70e1 LC |
199 | [AS_HELP_STRING([--with-nixpkgs=DIR], |
200 | [search for Nixpkgs in DIR (for testing purposes only)])], | |
af51c820 LC |
201 | [case "$withval" in |
202 | yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);; | |
203 | *) NIXPKGS="$withval";; | |
204 | esac], | |
205 | []) | |
206 | ||
e76bdf8b | 207 | AC_MSG_CHECKING([for Nixpkgs source tree]) |
af51c820 | 208 | if test -f "$NIXPKGS/default.nix"; then |
af51c820 LC |
209 | AC_MSG_RESULT([$NIXPKGS]) |
210 | AC_SUBST([NIXPKGS]) | |
211 | else | |
e76bdf8b | 212 | AC_MSG_RESULT([not found]) |
af51c820 LC |
213 | fi |
214 | ||
dd01fecd LC |
215 | LIBGCRYPT_LIBDIR="no" |
216 | LIBGCRYPT_PREFIX="no" | |
217 | ||
3a310cc0 LC |
218 | AC_ARG_WITH([libgcrypt-prefix], |
219 | [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])], | |
220 | [case "$withval" in | |
221 | yes|no) | |
3a310cc0 LC |
222 | ;; |
223 | *) | |
d388c2c4 | 224 | LIBGCRYPT_PREFIX="$withval" |
14af289e | 225 | LIBGCRYPT_LIBDIR="$withval/lib" |
3a310cc0 | 226 | ;; |
dd01fecd | 227 | esac]) |
3a310cc0 | 228 | |
14af289e LC |
229 | AC_ARG_WITH([libgcrypt-libdir], |
230 | [AS_HELP_STRING([--with-libgcrypt-libdir=DIR], | |
231 | [search for GNU libgcrypt's shared library in DIR])], | |
232 | [case "$withval" in | |
233 | yes|no) | |
14af289e LC |
234 | LIBGCRYPT_LIBDIR="no" |
235 | ;; | |
236 | *) | |
14af289e LC |
237 | LIBGCRYPT_LIBDIR="$withval" |
238 | ;; | |
dd01fecd LC |
239 | esac]) |
240 | ||
241 | dnl If none of the --with-libgcrypt-* options was used, try to determine the | |
ca719424 | 242 | dnl the library directory. |
dd01fecd LC |
243 | case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in |
244 | xnono) | |
245 | GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR]) | |
dd01fecd LC |
246 | ;; |
247 | esac | |
14af289e | 248 | |
d388c2c4 | 249 | AC_SUBST([LIBGCRYPT_PREFIX]) |
14af289e | 250 | AC_SUBST([LIBGCRYPT_LIBDIR]) |
d388c2c4 | 251 | |
987a29ba LC |
252 | dnl Check for Guile-SSH, for the (guix ssh) module. |
253 | GUIX_CHECK_GUILE_SSH | |
254 | AM_CONDITIONAL([HAVE_GUILE_SSH], | |
255 | [test "x$guix_cv_have_recent_guile_ssh" = "xyes"]) | |
256 | ||
c2033df4 LC |
257 | AC_CACHE_SAVE |
258 | ||
259 | m4_include([config-daemon.ac]) | |
3a310cc0 | 260 | |
cb9e50f6 | 261 | dnl `dot' (from the Graphviz package) is only needed for maintainers. |
8c01b9d0 | 262 | dnl See `Building from Git' in the manual for more info. |
cb9e50f6 LC |
263 | AM_MISSING_PROG([DOT], [dot]) |
264 | ||
52eca736 LC |
265 | dnl Manual pages. |
266 | AM_MISSING_PROG([HELP2MAN], [help2man]) | |
267 | ||
b9fe8fd6 JL |
268 | dnl Documentation translation. |
269 | AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate]) | |
270 | AM_MISSING_PROG([PO4A_UPDATEPO], [po4a-updatepo]) | |
271 | ||
d480ed7e LC |
272 | case "$storedir" in |
273 | /gnu/store) | |
274 | ;; | |
275 | *) | |
276 | AC_MSG_WARN([Using a store directory other than '/gnu/store' will prevent you]) | |
277 | AC_MSG_WARN([from downloading substitutes from gnu.org.]) | |
278 | ;; | |
279 | esac | |
280 | ||
14a1c319 | 281 | AC_CONFIG_FILES([Makefile |
ef1a9bb7 | 282 | po/guix/Makefile.in |
ee764179 | 283 | po/packages/Makefile.in |
b617a9fe RW |
284 | etc/guix-daemon.cil |
285 | guix/config.scm]) | |
8dc2ecfc | 286 | |
76a841cc | 287 | AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm]) |
a1097caa ML |
288 | AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env]) |
289 | AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], | |
290 | [chmod +x pre-inst-env]) | |
af51c820 LC |
291 | |
292 | AC_OUTPUT |