[flashrom] [PATCH] Detect Android target OS.

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Wed Dec 16 01:00:15 CET 2015


No other changes are required to build flashrom (excluding programmers
with NEED_PCI) on Android.

Signed-off-by: Stefan Tauner <stefan.tauner at alumni.tuwien.ac.at>
---
 os.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/os.h b/os.h
index 2e6dbaa..e5f72e4 100644
--- a/os.h
+++ b/os.h
@@ -58,6 +58,11 @@
 #define __FLASHROM_OS__ "libpayload"
 // Linux
 #elif defined(__linux__)
-#define __FLASHROM_OS__ "Linux"
+	// There are various flags in use on Android apparently. __ANDROID__ seems to be the most trustworthy.
+	#if defined(__ANDROID__)
+		#define __FLASHROM_OS__ "Android"
+	#else
+		#define __FLASHROM_OS__ "Linux"
+	#endif
 #endif
 __FLASHROM_OS__
-- 
Kind regards, Stefan Tauner





More information about the flashrom mailing list