summaryrefslogtreecommitdiff
path: root/m4/guix.m4
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-03 23:04:47 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-03 23:05:08 +0100
commitc2033df432af87d0176347858c7d11acfe2ed89f (patch)
tree05a7befd50cead52a401165c03dee3ae72840619 /m4/guix.m4
parent7eba5e6361b637a4c8aecbb13644f573a845732b (diff)
build: Include a copy of Nix's libstore and daemon; build it.
* configure.ac: Call `AC_USE_SYSTEM_EXTENSIONS', and `GUIX_SYSTEM_TYPE'. Add `--with-store-dir' option, and substitute `storedir'. Include `config-daemon.ac'. * config-daemon.ac: New file. * Makefile.am [BUILD_DAEMON]: Include `daemon.am'. * daemon.am: New file. * m4/guix.m4 (GUIX_SYSTEM_TYPE): New macro. * nix/libutil/gcrypt-hash.cc, nix/libutil/gcrypt-hash.hh, nix/libutil/md5.h, nix/libutil/sha1.h, nix/libutil/sha256.h, nix/nix-daemon/guix-daemon.cc, nix/nix-daemon/shared.hh: New files.
Diffstat (limited to 'm4/guix.m4')
-rw-r--r--m4/guix.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/m4/guix.m4 b/m4/guix.m4
index 29f928f653..9b5184ff55 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -33,3 +33,32 @@ AC_DEFUN([GUIX_ASSERT_LIBGCRYPT_USABLE],
if test "x$guix_cv_libgcrypt_usable_p" != "xyes"; then
AC_MSG_ERROR([GNU libgcrypt does not appear to be usable; see `--with-libgcrypt-prefix' and `README'.])
fi])
+
+dnl GUIX_SYSTEM_TYPE
+dnl
+dnl Determine the Guix host system type, and store it in the
+dnl `guix_system' variable.
+AC_DEFUN([GUIX_SYSTEM_TYPE], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_ARG_WITH(system, AC_HELP_STRING([--with-system=SYSTEM],
+ [Platform identifier (e.g., `i686-linux').]),
+ [guix_system="$withval"],
+ [case "$host_cpu" in
+ i*86)
+ machine_name="i686";;
+ amd64)
+ machine_name="x86_64";;
+ *)
+ machine_name="$host_cpu";;
+ esac
+
+ case "$host_os" in
+ linux-gnu*)
+ # For backward compatibility, strip the `-gnu' part.
+ guix_system="$machine_name-linux";;
+ *)
+ # Strip the version number from names such as `gnu0.3',
+ # `darwin10.2.0', etc.
+ guix_system="$machine_name-`echo $host_os | "$SED" -e's/@<:@0-9.@:>@*$//g'`";;
+ esac])
+])