Print 'uname -mrs' from the information collected at compile time.

Signed-off-by: Idwer Vollering <[email protected]>
Index: Makefile
===================================================================
--- Makefile	(revision 808)
+++ Makefile	(working copy)
@@ -25,7 +25,7 @@
 DIFF    = diff
 PREFIX  ?= /usr/local
 MANDIR  ?= $(PREFIX)/share/man
-CFLAGS  ?= -Os -Wall -Werror
+CFLAGS  ?= -Os -Wall -Werror -DBUILD_OS="\"$(shell uname -mrs)\""
 EXPORTDIR ?= .
 
 OS_ARCH	= $(shell uname)
Index: flashrom.c
===================================================================
--- flashrom.c	(revision 808)
+++ flashrom.c	(working copy)
@@ -1,3 +1,4 @@
+
 /*
  * This file is part of the flashrom project.
  *
@@ -24,6 +25,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/utsname.h>
 #include <string.h>
 #include <stdlib.h>
 #include <getopt.h>
@@ -31,6 +33,7 @@
 #include "flashchips.h"
 
 const char *flashrom_version = FLASHROM_VERSION;
+const char *build_os = BUILD_OS;
 char *chip_to_probe = NULL;
 int verbose = 0;
 
@@ -968,7 +971,7 @@
 
 void print_version(void)
 {
-	printf("flashrom v%s\n", flashrom_version);
+	printf("flashrom v%s (%s)\n", flashrom_version, build_os);
 }
 
 int main(int argc, char *argv[])
_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to