projects/guix·blob v0.2 · refs

127 lines · 3.4 KiB

1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.68)
5AC_INIT([GNU Guix], [0.2], [[email protected]], [guix],
6 [http://gnu.org/software/guix/])
7AC_CONFIG_AUX_DIR([build-aux])
8
9AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects \
10 color-tests parallel-tests])
11
12AC_CONFIG_SRCDIR([guix.scm])
13AC_CONFIG_MACRO_DIR([m4])
14
15dnl For the C++ code. This must be used early.
16AC_USE_SYSTEM_EXTENSIONS
17
18AM_GNU_GETTEXT([external])
19AM_GNU_GETTEXT_VERSION([0.18.1])
20
21guilemoduledir="${datarootdir}/guile/site/2.0"
22AC_SUBST([guilemoduledir])
23
24GUIX_SYSTEM_TYPE
25
26AC_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"])
31AC_SUBST(storedir)
32
33AC_ARG_ENABLE([daemon],
34 [AS_HELP_STRING([--disable-daemon], [build the Nix daemon (C++)])],
35 [guix_build_daemon="$enableval"],
36 [guix_build_daemon="yes"])
37
38# Prepare a version of $localstatedir that does not contain references
39# to shell variables.
40guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|/usr/local|g"`"
41AC_SUBST([guix_localstatedir])
42
43PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.5])
44AC_PATH_PROG([GUILE], [guile])
45AC_PATH_PROG([GUILD], [guild])
46if test "x$GUILD" = "x"; then
47 AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
48fi
49
50dnl Make sure we have a full-fledged Guile.
51GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
52
53AC_ARG_WITH([nix-prefix],
54 [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
55 [case "$withval" in
56 yes|no) ;;
57 *)
58 NIX_PREFIX="$withval"
59 PATH="$NIX_PREFIX/bin:$PATH"; export PATH
60 AC_SUBST([NIX_PREFIX])
61 ;;
62 esac],
63 [])
64
65AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
66AC_PATH_PROG([NIX_HASH], [nix-hash])
67if test "x$guix_build_daemon$NIX_INSTANTIATE$NIX_HASH" = "xno"; then
68 AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
69fi
70
71if 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"
75fi
76
77AC_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
85AC_MSG_CHECKING([for Nixpkgs source tree])
86if test -f "$NIXPKGS/default.nix"; then
87 AC_MSG_RESULT([$NIXPKGS])
88 AC_SUBST([NIXPKGS])
89else
90 AC_MSG_RESULT([not found])
91fi
92
93AC_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"
98 LIBGCRYPT_PREFIX="no"
99 ;;
100 *)
101 LIBGCRYPT="$withval/lib/libgcrypt"
102 LIBGCRYPT_PREFIX="$withval"
103 ;;
104 esac],
105 [LIBGCRYPT="libgcrypt"])
106
107dnl Library name suitable for `dynamic-link'.
108AC_MSG_CHECKING([for libgcrypt shared library name])
109AC_MSG_RESULT([$LIBGCRYPT])
110AC_SUBST([LIBGCRYPT])
111AC_SUBST([LIBGCRYPT_PREFIX])
112
113GUIX_ASSERT_LIBGCRYPT_USABLE
114
115AC_CACHE_SAVE
116
117m4_include([config-daemon.ac])
118
119AC_CONFIG_FILES([Makefile
120 po/Makefile.in
121 guix/config.scm])
122
123AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix])
124AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
125AC_CONFIG_FILES([test-env], [chmod +x test-env])
126
127AC_OUTPUT