build: Run all the tests against the just-built daemon.
[jackhill/guix/guix.git] / m4 / guix.m4
CommitLineData
d388c2c4
LC
1dnl Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
2dnl Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
3dnl
4dnl This file is part of Guix.
5dnl
6dnl Guix is free software; you can redistribute it and/or modify it
7dnl under the terms of the GNU General Public License as published by
8dnl the Free Software Foundation; either version 3 of the License, or (at
9dnl your option) any later version.
10dnl
11dnl Guix is distributed in the hope that it will be useful, but
12dnl WITHOUT ANY WARRANTY; without even the implied warranty of
13dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14dnl GNU General Public License for more details.
15dnl
16dnl You should have received a copy of the GNU General Public License
17dnl along with Guix. If not, see <http://www.gnu.org/licenses/>.
18
19dnl GUIX_ASSERT_LIBGCRYPT_USABLE
20dnl
21dnl Assert that GNU libgcrypt is usable from Guile.
22AC_DEFUN([GUIX_ASSERT_LIBGCRYPT_USABLE],
23 [AC_CACHE_CHECK([whether $LIBGCRYPT can be dynamically loaded],
24 [guix_cv_libgcrypt_usable_p],
25 [GUILE_CHECK([retval],
26 [(dynamic-func \"gcry_md_hash_buffer\" (dynamic-link \"$LIBGCRYPT\"))])
27 if test "$retval" = 0; then
28 guix_cv_libgcrypt_usable_p="yes"
29 else
30 guix_cv_libgcrypt_usable_p="no"
31 fi])
32
33 if test "x$guix_cv_libgcrypt_usable_p" != "xyes"; then
34 AC_MSG_ERROR([GNU libgcrypt does not appear to be usable; see `--with-libgcrypt-prefix' and `README'.])
35 fi])
c2033df4
LC
36
37dnl GUIX_SYSTEM_TYPE
38dnl
39dnl Determine the Guix host system type, and store it in the
40dnl `guix_system' variable.
41AC_DEFUN([GUIX_SYSTEM_TYPE], [
42 AC_REQUIRE([AC_CANONICAL_HOST])
43 AC_ARG_WITH(system, AC_HELP_STRING([--with-system=SYSTEM],
44 [Platform identifier (e.g., `i686-linux').]),
45 [guix_system="$withval"],
46 [case "$host_cpu" in
47 i*86)
48 machine_name="i686";;
49 amd64)
50 machine_name="x86_64";;
51 *)
52 machine_name="$host_cpu";;
53 esac
54
55 case "$host_os" in
56 linux-gnu*)
57 # For backward compatibility, strip the `-gnu' part.
58 guix_system="$machine_name-linux";;
59 *)
60 # Strip the version number from names such as `gnu0.3',
61 # `darwin10.2.0', etc.
62 guix_system="$machine_name-`echo $host_os | "$SED" -e's/@<:@0-9.@:>@*$//g'`";;
63 esac])
64])