From c2033df432af87d0176347858c7d11acfe2ed89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 3 Dec 2012 23:04:47 +0100 Subject: 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. --- m4/guix.m4 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'm4/guix.m4') 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]) +]) -- cgit v1.2.3