Permalink
Browse files

Autodetect platform properly

  • Loading branch information...
1 parent a9e546a commit 203d07766389172b25490574928cbeacc502a13e @chneukirchen committed May 5, 2011
Showing with 11 additions and 4 deletions.
  1. +0 −1 COOKBOOK
  2. +0 −1 KEEP/config.stage0
  3. +0 −1 KEEP/config.stage1
  4. +0 −1 README
  5. +1 −0 build-stage0
  6. +1 −0 mkfile
  7. +9 −0 utils/platform
View
@@ -52,7 +52,6 @@ Now reboot into your freshly installed Sabotage system!
Git clone the sabotage repository. Copy "KEEP/config.stage" to "config"
and adjust the variables:
- $A architecture (i386 or x86_64)
$K directory with patches
$S where sources are compiled (stage0: ~700MB, stage1: ~2.1GB)
$R root file system, potentially loopback-mounted or on a real partition
View
@@ -1,4 +1,3 @@
-export A=$(uname -m)
export K=$(pwd)/KEEP
export S=/tmp/sabotage/src
export R=/tmp/sabotage/root
View
@@ -1,4 +1,3 @@
-export A=$(uname -m)
export K=/tmp/src/KEEP
export S=/tmp/src
export R=/
View
1 README
@@ -17,7 +17,6 @@ DO NOT RUN SCRIPTS YOU HAVE NOT READ.
% cp KEEP/config.stage0 config
% vi config
- $A architecture (x86_64 or i386)
$K directory with patches
$S where sources are compiled (stage0: ~700MB, stage1: ~2.1GB)
$R root file system
View
@@ -2,6 +2,7 @@
set -e -x
export H=$(pwd)
+export A=$($H/utils/platform)
. $H/config
. $H/utils/utils
View
1 mkfile
@@ -12,6 +12,7 @@ help:QV:
echo " list show all packages"
PATH=utils:$PATH
+A=`utils/platform`
<|sed 's/export//' config
<deps
<|recipes
View
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+cpp -P <<EOF | grep -v "^$"
+#ifdef __i386__
+i386
+#elif __amd64__
+x86_64
+#endif
+EOF

4 comments on commit 203d077

keks replied Jun 5, 2011

$ ./utils/platform  
1

on

$ cpp --version
cpp (GCC) 4.6.0 20110513 (prerelease)
Owner

chneukirchen replied Jun 5, 2011

keks replied Jun 5, 2011

% uname -a
Linux keks-netbook 2.6.38-ARCH #1 SMP PREEMPT Fri May 13 07:54:18 UTC 2011 i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz GenuineIntel GNU/Linux

keks replied Jun 5, 2011

inserting

#elif __i686__
i686

doesn't help.

Please sign in to comment.