From 5d2b424804ec93567ddf15639f84c4098d80f659 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 Dec 2003 14:36:50 +0000 Subject: [PATCH] * Use a system name that does not include the OS manufacturer (i.e., "i686-linux" instead of "i686-suse-linux"). --- configure.ac | 8 ++++++++ scripts/nix-prefetch-url.in | 2 +- scripts/nix-pull.in | 4 ++-- scripts/nix-push.in | 2 +- src/libstore/Makefile.am | 2 +- src/libutil/Makefile.am | 2 +- substitute.mk | 2 +- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index fe5fa136e..3e0bca31e 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,14 @@ AC_PREFIX_DEFAULT(/nix) AC_CANONICAL_HOST +# Construct a Nix system name (like "i686-linux"). +AC_MSG_CHECKING([for the canonical Nix system name]) +machine_name=`uname -m` +sys_name=`uname -s | tr [A-Z] [a-z]` +system="${machine_name}-${sys_name}" +AC_MSG_RESULT($system) +AC_SUBST(system) + AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB diff --git a/scripts/nix-prefetch-url.in b/scripts/nix-prefetch-url.in index 0873f5a8d..050955682 100644 --- a/scripts/nix-prefetch-url.in +++ b/scripts/nix-prefetch-url.in @@ -25,7 +25,7 @@ rename $out, $out2; # Create a Nix expression. my $nixexpr = "(import @datadir@/nix/corepkgs/fetchurl) " . - "{url = $url; md5 = \"$hash\"; system = \"@host@\"}"; + "{url = $url; md5 = \"$hash\"; system = \"@system@\"}"; print "expr: $nixexpr\n"; diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in index 1453a46ac..ded4281cf 100644 --- a/scripts/nix-pull.in +++ b/scripts/nix-pull.in @@ -61,10 +61,10 @@ sub processURL { # Nix archive from the network. my $fetch = "(import @datadir@/nix/corepkgs/fetchurl) " . - "{url = $fullurl; md5 = \"$hash\"; system = \"@host@\"}"; + "{url = $fullurl; md5 = \"$hash\"; system = \"@system@\"}"; my $nixexpr = "((import @datadir@/nix/corepkgs/nar/unnar.nix) " . - "{narFile = ($fetch); outPath = \"$storepath\"; system = \"@host@\"}) "; + "{narFile = ($fetch); outPath = \"$storepath\"; system = \"@system@\"}) "; $fullexpr .= $nixexpr; # !!! O(n^2)? push @srcpaths, $storepath; diff --git a/scripts/nix-push.in b/scripts/nix-push.in index c1624d835..38afc7f74 100644 --- a/scripts/nix-push.in +++ b/scripts/nix-push.in @@ -45,7 +45,7 @@ foreach my $id (@ARGV) { my $nixexpr = "((import @datadir@/nix/corepkgs/nar/nar.nix) " . # !!! $path should be represented as a closure - "{path = \"$path\"; system = \"@host@\"}) "; + "{path = \"$path\"; system = \"@system@\"}) "; print NIX $nixexpr; } diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am index 6605a76c2..3e2777f6a 100644 --- a/src/libstore/Makefile.am +++ b/src/libstore/Makefile.am @@ -6,5 +6,5 @@ libstore_a_SOURCES = \ globals.cc globals.hh db.cc db.hh \ references.cc references.hh pathlocks.cc pathlocks.hh -AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall \ +AM_CXXFLAGS = -Wall \ -I.. -I../../externals/inst/include -I../libutil diff --git a/src/libutil/Makefile.am b/src/libutil/Makefile.am index 362a6e55c..5d9111868 100644 --- a/src/libutil/Makefile.am +++ b/src/libutil/Makefile.am @@ -3,7 +3,7 @@ noinst_LIBRARIES = libutil.a libutil_a_SOURCES = util.cc util.hh hash.cc hash.hh \ archive.cc archive.hh md5.c md5.h aterm.cc aterm.hh -AM_CXXFLAGS = -DSYSTEM=\"@host@\" -Wall -I.. -I../../externals/inst/include +AM_CXXFLAGS = -DSYSTEM=\"@system@\" -Wall -I.. -I../../externals/inst/include check_PROGRAMS = test-aterm diff --git a/substitute.mk b/substitute.mk index 1f09f73b9..6557e496d 100644 --- a/substitute.mk +++ b/substitute.mk @@ -5,7 +5,7 @@ -e "s^@sysconfdir\@^$(sysconfdir)^g" \ -e "s^@localstatedir\@^$(localstatedir)^g" \ -e "s^@datadir\@^$(datadir)^g" \ - -e "s^@host\@^$(host_triplet)^g" \ + -e "s^@system\@^$(system)^g" \ -e "s^@wget\@^$(wget)^g" \ < $< > $@ || rm $@ chmod +x $@