Commit | Line | Data |
---|---|---|
2357f850 LC |
1 | dnl GNU Guix --- Functional package management for GNU |
2 | dnl Copyright © 2012 Ludovic Courtès <ludo@gnu.org> | |
d388c2c4 | 3 | dnl |
2357f850 | 4 | dnl This file is part of GNU Guix. |
d388c2c4 | 5 | dnl |
2357f850 | 6 | dnl GNU Guix is free software; you can redistribute it and/or modify it |
d388c2c4 LC |
7 | dnl under the terms of the GNU General Public License as published by |
8 | dnl the Free Software Foundation; either version 3 of the License, or (at | |
9 | dnl your option) any later version. | |
10 | dnl | |
2357f850 | 11 | dnl GNU Guix is distributed in the hope that it will be useful, but |
d388c2c4 LC |
12 | dnl WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | dnl GNU General Public License for more details. | |
15 | dnl | |
16 | dnl You should have received a copy of the GNU General Public License | |
2357f850 | 17 | dnl along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
d388c2c4 LC |
18 | |
19 | dnl GUIX_ASSERT_LIBGCRYPT_USABLE | |
20 | dnl | |
21 | dnl Assert that GNU libgcrypt is usable from Guile. | |
22 | AC_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 | |
37 | dnl GUIX_SYSTEM_TYPE | |
38 | dnl | |
39 | dnl Determine the Guix host system type, and store it in the | |
40 | dnl `guix_system' variable. | |
41 | AC_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]) | |
d8eea3d2 | 64 | AC_SUBST([guix_system]) |
c2033df4 | 65 | ]) |