build: Be cross-compilation-ready.
[jackhill/guix/guix.git] / configure.ac
CommitLineData
af51c820
LC
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.68)
5AC_INIT([guix], [0.0], [guile-user@gnu.org])
6AC_CONFIG_AUX_DIR([build-aux])
7
8AM_INIT_AUTOMAKE([1.11 foreign silent-rules subdir-objects \
9 color-tests parallel-tests])
10
11AC_CONFIG_SRCDIR([guix.scm])
12AC_CONFIG_MACRO_DIR([m4])
13
14guilemoduledir="${datarootdir}/guile/site/2.0"
15AC_SUBST([guilemoduledir])
16
73d96596
LC
17AC_CANONICAL_HOST
18
af51c820
LC
19PKG_CHECK_MODULES([GUILE], [guile-2.0])
20AC_PATH_PROG([GUILE], [guile])
21AC_PATH_PROG([GUILD], [guild])
22
23AC_ARG_WITH([nix-prefix],
24 [AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
25 [case "$withval" in
26 yes|no) ;;
27 *) PATH="$withval/bin:$PATH"; export PATH;;
28 esac],
29 [])
30
31AC_PATH_PROG([NIX_INSTANTIATE], [nix-instantiate])
32AC_PATH_PROG([NIX_HASH], [nix-hash])
33if test "x$NIX_INSTANTIATE$NIX_HASH" = "x"; then
34 AC_MSG_ERROR([Nix programs not found; please install Nix or use `--with-nix-prefix'.])
35fi
36
37AC_ARG_WITH([nixpkgs],
38 [AS_HELP_STRING([--with-nixpkgs=DIR], [search for Nixpkgs in DIR])],
39 [case "$withval" in
40 yes|no) AC_MSG_ERROR([Please use `--with-nixpkgs=DIR'.]);;
41 *) NIXPKGS="$withval";;
42 esac],
43 [])
44
45if test -f "$NIXPKGS/default.nix"; then
46 AC_MSG_CHECKING([for Nixpkgs source tree])
47 AC_MSG_RESULT([$NIXPKGS])
48 AC_SUBST([NIXPKGS])
49else
50 AC_MSG_WARN([Nixpkgs not found; this will prevent most tests from running.])
51 AC_MSG_WARN([Please use `--with-nixpkgs'.])
52fi
53
54AC_CONFIG_FILES([Makefile])
55
56AC_OUTPUT