gnu: geiser: Update to 0.4.
[jackhill/guix/guix.git] / m4 / guix.m4
CommitLineData
2357f850 1dnl GNU Guix --- Functional package management for GNU
5fedc65b 2dnl Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
d388c2c4 3dnl
2357f850 4dnl This file is part of GNU Guix.
d388c2c4 5dnl
2357f850 6dnl GNU Guix is free software; you can redistribute it and/or modify it
d388c2c4
LC
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
2357f850 11dnl GNU Guix is distributed in the hope that it will be useful, but
d388c2c4
LC
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
2357f850 17dnl along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
d388c2c4
LC
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])
5fedc65b
LC
64
65 AC_MSG_CHECKING([for the Guix system type])
66 AC_MSG_RESULT([$guix_system])
67
d8eea3d2 68 AC_SUBST([guix_system])
c2033df4 69])