From e813a158461d96a8219c0fc7166ce87d4d0d9ebc Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 25 Sep 2013 18:39:00 +0200 Subject: [PATCH] Minimal support for uname -p * This is used by cmake to know which CPU to build for. --- src/bin/coreutils/src/uname.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/bin/coreutils/src/uname.c b/src/bin/coreutils/src/uname.c index f85d7e9124..16b0b33c94 100644 --- a/src/bin/coreutils/src/uname.c +++ b/src/bin/coreutils/src/uname.c @@ -50,6 +50,10 @@ # include #endif +#ifdef __HAIKU__ +# include +#endif + #include "system.h" #include "error.h" #include "quote.h" @@ -339,6 +343,23 @@ main (int argc, char **argv) # endif } #endif + +#ifdef __HAIKU__ + { + system_info sysinfo; + get_system_info(&sysinfo); + + switch (sysinfo.platform_type) { + case B_AT_CLONE_PLATFORM: + element = "x86"; + break; + case B_64_BIT_PC_PLATFORM: + element = "x86_64"; + break; + } + } +#endif + if (! (toprint == UINT_MAX && element == unknown)) print_element (element); }