buildsystem: Determine the endianness only in the buildsystem
Let the buildsystem (make / meson) handle the endianness determination
and set the __FLASHROM_LITTLE_ENDIAN__ or __FLASHROM_BIG_ENDIAN__ macro
as cflag.
Change-Id: I37093528ae55e712cc30a0267a8ceac332750e7d
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/58273
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Original-Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72244
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/Makefile b/Makefile
index da092ce..d628f7d 100644
--- a/Makefile
+++ b/Makefile
@@ -248,6 +248,13 @@
$(call mark_unsupported,CONFIG_INTERNAL)
endif
+ifeq ($(ENDIAN), little)
+FEATURE_CFLAGS += -D'__FLASHROM_LITTLE_ENDIAN__=1'
+endif
+ifeq ($(ENDIAN), big)
+FEATURE_CFLAGS += -D'__FLASHROM_BIG_ENDIAN__=1'
+endif
+
# PCI port I/O support is unimplemented on PPC/MIPS/SPARC and unavailable on ARM.
# Right now this means the drivers below only work on x86.
ifneq ($(ARCH), x86)