Commit | Line | Data |
---|---|---|
af51c820 LC |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | AC_PREREQ(2.68) | |
07ef14af | 5 | AC_INIT([GNU Guix], [0.5], [bug-guix@gnu.org], [guix], |
4bc3fcc7 | 6 | [http://www.gnu.org/software/guix/]) |
af51c820 LC |
7 | AC_CONFIG_AUX_DIR([build-aux]) |
8 | ||
8aab64fc | 9 | AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects \ |
a9424c08 | 10 | color-tests parallel-tests -Woverride]) |
af51c820 LC |
11 | |
12 | AC_CONFIG_SRCDIR([guix.scm]) | |
13 | AC_CONFIG_MACRO_DIR([m4]) | |
14 | ||
c2033df4 LC |
15 | dnl For the C++ code. This must be used early. |
16 | AC_USE_SYSTEM_EXTENSIONS | |
17 | ||
f68b0893 | 18 | AM_GNU_GETTEXT([external]) |
0a042340 | 19 | AM_GNU_GETTEXT_VERSION([0.18.1]) |
f68b0893 | 20 | |
af51c820 LC |
21 | guilemoduledir="${datarootdir}/guile/site/2.0" |
22 | AC_SUBST([guilemoduledir]) | |
23 | ||
c2033df4 | 24 | GUIX_SYSTEM_TYPE |
b97556d7 | 25 | GUIX_ASSERT_SUPPORTED_SYSTEM |
c2033df4 LC |
26 | |
27 | AC_ARG_WITH(store-dir, | |
28 | AC_HELP_STRING([--with-store-dir=PATH], | |
29 | [path of the store (defaults to /nix/store)]), | |
30 | [storedir="$withval"], | |
31 | [storedir="/nix/store"]) | |
32 | AC_SUBST(storedir) | |
73d96596 | 33 | |
3a61f801 | 34 | AC_ARG_ENABLE([daemon], |
c9b70836 | 35 | [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])], |
3a61f801 | 36 | [guix_build_daemon="$enableval"], |
c9b70836 | 37 | [guix_build_daemon="yes"]) |
3a61f801 | 38 | |
d8eea3d2 LC |
39 | # Prepare a version of $localstatedir that does not contain references |
40 | # to shell variables. | |
41 | guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`" | |
42 | AC_SUBST([guix_localstatedir]) | |
43 | ||
56dbcb09 | 44 | PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5]) |
af51c820 LC |
45 | AC_PATH_PROG([GUILE], [guile]) |
46 | AC_PATH_PROG([GUILD], [guild]) | |
73f9a978 CN |
47 | if test "x$GUILD" = "x"; then |
48 | AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.]) | |
49 | fi | |
af51c820 | 50 | |
9c7dd33a LC |
51 | dnl Make sure we have a full-fledged Guile. |
52 | GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads]) | |
53 | ||
1959fb04 LC |
54 | dnl Check whether (srfi srfi-37) works, and provide our own if it doesn't. |
55 | GUIX_CHECK_SRFI_37 | |
56 | AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes]) | |
57 | ||
af51c820 LC |
58 | AC_ARG_WITH([nix-prefix], |
59 | [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])], | |
60 | [case "$withval" in | |
61 | yes|no) ;; | |
437e0729 LC |
62 | *) |
63 | NIX_PREFIX="$withval" | |
64 | PATH="$NIX_PREFIX/bin:$PATH"; export PATH | |
65 | AC_SUBST([NIX_PREFIX]) | |
66 | ;; | |
af51c820 LC |
67 | esac], |
68 | []) | |
69 | ||
70 | AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate]) | |
71 | AC_PATH_PROG([NIX_HASH], [nix-hash]) | |
3a61f801 | 72 | if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then |
af51c820 LC |
73 | AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.]) |
74 | fi | |
75 | ||
c217708f LC |
76 | if test "x$NIX_INSTANTIATE" = "x"; then |
77 | # This program is an optional dependency, so we just want it to be | |
78 | # taken from $PATH if it's not available right now. | |
79 | NIX_INSTANTIATE="nix-instantiate" | |
80 | fi | |
81 | ||
af51c820 LC |
82 | AC_ARG_WITH([nixpkgs], |
83 | [AS_HELP_STRING([--with-nixpkgs=DIR], [search for Nixpkgs in DIR])], | |
84 | [case "$withval" in | |
85 | yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);; | |
86 | *) NIXPKGS="$withval";; | |
87 | esac], | |
88 | []) | |
89 | ||
e76bdf8b | 90 | AC_MSG_CHECKING([for Nixpkgs source tree]) |
af51c820 | 91 | if test -f "$NIXPKGS/default.nix"; then |
af51c820 LC |
92 | AC_MSG_RESULT([$NIXPKGS]) |
93 | AC_SUBST([NIXPKGS]) | |
94 | else | |
e76bdf8b | 95 | AC_MSG_RESULT([not found]) |
af51c820 LC |
96 | fi |
97 | ||
3a310cc0 LC |
98 | AC_ARG_WITH([libgcrypt-prefix], |
99 | [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])], | |
100 | [case "$withval" in | |
101 | yes|no) | |
102 | LIBGCRYPT="libgcrypt" | |
d388c2c4 | 103 | LIBGCRYPT_PREFIX="no" |
3a310cc0 LC |
104 | ;; |
105 | *) | |
106 | LIBGCRYPT="$withval/lib/libgcrypt" | |
d388c2c4 | 107 | LIBGCRYPT_PREFIX="$withval" |
3a310cc0 LC |
108 | ;; |
109 | esac], | |
110 | [LIBGCRYPT="libgcrypt"]) | |
111 | ||
112 | dnl Library name suitable for `dynamic-link'. | |
113 | AC_MSG_CHECKING([for libgcrypt shared library name]) | |
114 | AC_MSG_RESULT([$LIBGCRYPT]) | |
115 | AC_SUBST([LIBGCRYPT]) | |
d388c2c4 LC |
116 | AC_SUBST([LIBGCRYPT_PREFIX]) |
117 | ||
118 | GUIX_ASSERT_LIBGCRYPT_USABLE | |
119 | ||
c2033df4 LC |
120 | AC_CACHE_SAVE |
121 | ||
122 | m4_include([config-daemon.ac]) | |
3a310cc0 | 123 | |
cb9e50f6 LC |
124 | dnl `dot' (from the Graphviz package) is only needed for maintainers. |
125 | dnl See `HACKING' for more info. | |
126 | AM_MISSING_PROG([DOT], [dot]) | |
127 | ||
14a1c319 LC |
128 | AC_CONFIG_FILES([Makefile |
129 | po/Makefile.in | |
8dc2ecfc LC |
130 | guix/config.scm]) |
131 | ||
e8b3afeb LC |
132 | AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix]) |
133 | AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) | |
134 | AC_CONFIG_FILES([test-env], [chmod +x test-env]) | |
af51c820 LC |
135 | |
136 | AC_OUTPUT |