Commit | Line | Data |
---|---|---|
af51c820 LC |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | AC_PREREQ(2.68) | |
4bc3fcc7 LC |
5 | AC_INIT([GNU Guix], [0.3], [bug-guix@gnu.org], [guix], |
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 \ |
af51c820 LC |
10 | color-tests parallel-tests]) |
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 LC |
24 | GUIX_SYSTEM_TYPE |
25 | ||
26 | AC_ARG_WITH(store-dir, | |
27 | AC_HELP_STRING([--with-store-dir=PATH], | |
28 | [path of the store (defaults to /nix/store)]), | |
29 | [storedir="$withval"], | |
30 | [storedir="/nix/store"]) | |
31 | AC_SUBST(storedir) | |
73d96596 | 32 | |
3a61f801 | 33 | AC_ARG_ENABLE([daemon], |
c9b70836 | 34 | [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])], |
3a61f801 | 35 | [guix_build_daemon="$enableval"], |
c9b70836 | 36 | [guix_build_daemon="yes"]) |
3a61f801 | 37 | |
d8eea3d2 LC |
38 | # Prepare a version of $localstatedir that does not contain references |
39 | # to shell variables. | |
40 | guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`" | |
41 | AC_SUBST([guix_localstatedir]) | |
42 | ||
56dbcb09 | 43 | PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5]) |
af51c820 LC |
44 | AC_PATH_PROG([GUILE], [guile]) |
45 | AC_PATH_PROG([GUILD], [guild]) | |
73f9a978 CN |
46 | if test "x$GUILD" = "x"; then |
47 | AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.]) | |
48 | fi | |
af51c820 | 49 | |
9c7dd33a LC |
50 | dnl Make sure we have a full-fledged Guile. |
51 | GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads]) | |
52 | ||
af51c820 LC |
53 | AC_ARG_WITH([nix-prefix], |
54 | [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])], | |
55 | [case "$withval" in | |
56 | yes|no) ;; | |
437e0729 LC |
57 | *) |
58 | NIX_PREFIX="$withval" | |
59 | PATH="$NIX_PREFIX/bin:$PATH"; export PATH | |
60 | AC_SUBST([NIX_PREFIX]) | |
61 | ;; | |
af51c820 LC |
62 | esac], |
63 | []) | |
64 | ||
65 | AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate]) | |
66 | AC_PATH_PROG([NIX_HASH], [nix-hash]) | |
3a61f801 | 67 | if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then |
af51c820 LC |
68 | AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.]) |
69 | fi | |
70 | ||
c217708f LC |
71 | if test "x$NIX_INSTANTIATE" = "x"; then |
72 | # This program is an optional dependency, so we just want it to be | |
73 | # taken from $PATH if it's not available right now. | |
74 | NIX_INSTANTIATE="nix-instantiate" | |
75 | fi | |
76 | ||
af51c820 LC |
77 | AC_ARG_WITH([nixpkgs], |
78 | [AS_HELP_STRING([--with-nixpkgs=DIR], [search for Nixpkgs in DIR])], | |
79 | [case "$withval" in | |
80 | yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);; | |
81 | *) NIXPKGS="$withval";; | |
82 | esac], | |
83 | []) | |
84 | ||
e76bdf8b | 85 | AC_MSG_CHECKING([for Nixpkgs source tree]) |
af51c820 | 86 | if test -f "$NIXPKGS/default.nix"; then |
af51c820 LC |
87 | AC_MSG_RESULT([$NIXPKGS]) |
88 | AC_SUBST([NIXPKGS]) | |
89 | else | |
e76bdf8b | 90 | AC_MSG_RESULT([not found]) |
af51c820 LC |
91 | fi |
92 | ||
3a310cc0 LC |
93 | AC_ARG_WITH([libgcrypt-prefix], |
94 | [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])], | |
95 | [case "$withval" in | |
96 | yes|no) | |
97 | LIBGCRYPT="libgcrypt" | |
d388c2c4 | 98 | LIBGCRYPT_PREFIX="no" |
3a310cc0 LC |
99 | ;; |
100 | *) | |
101 | LIBGCRYPT="$withval/lib/libgcrypt" | |
d388c2c4 | 102 | LIBGCRYPT_PREFIX="$withval" |
3a310cc0 LC |
103 | ;; |
104 | esac], | |
105 | [LIBGCRYPT="libgcrypt"]) | |
106 | ||
107 | dnl Library name suitable for `dynamic-link'. | |
108 | AC_MSG_CHECKING([for libgcrypt shared library name]) | |
109 | AC_MSG_RESULT([$LIBGCRYPT]) | |
110 | AC_SUBST([LIBGCRYPT]) | |
d388c2c4 LC |
111 | AC_SUBST([LIBGCRYPT_PREFIX]) |
112 | ||
113 | GUIX_ASSERT_LIBGCRYPT_USABLE | |
114 | ||
c2033df4 LC |
115 | AC_CACHE_SAVE |
116 | ||
117 | m4_include([config-daemon.ac]) | |
3a310cc0 | 118 | |
14a1c319 LC |
119 | AC_CONFIG_FILES([Makefile |
120 | po/Makefile.in | |
8dc2ecfc LC |
121 | guix/config.scm]) |
122 | ||
e8b3afeb LC |
123 | AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix]) |
124 | AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) | |
125 | AC_CONFIG_FILES([test-env], [chmod +x test-env]) | |
af51c820 LC |
126 | |
127 | AC_OUTPUT |