From 1379e54f519234c07b7e0995de84ab782581c552 Mon Sep 17 00:00:00 2001 From: Thomas Heijligen Date: Tue, 12 Oct 2021 17:58:35 +0200 Subject: buildsystem: evaluate the USE_IOPL, USE_DEV_IO, USE_IOPERM macros Determine which macro has to be set for the target system. Do this in the buildsystem instead of using preprocessor macros. Change-Id: Ic41ea025e35feb93f07ce7a94c0d15e6e84f38b9 Signed-off-by: Thomas Heijligen Reviewed-on: https://review.coreboot.org/c/flashrom/+/58278 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 31d40258..18651bc0 100644 --- a/Makefile +++ b/Makefile @@ -278,6 +278,25 @@ $(call mark_unsupported,CONFIG_DRKAISER CONFIG_NICINTEL CONFIG_NICINTEL_SPI) $(call mark_unsupported,CONFIG_NICINTEL_EEPROM CONFIG_OGP_SPI CONFIG_IT8212) endif +ifeq ($(TARGET_OS), $(filter $(TARGET_OS), Linux Darwin NetBSD OpenBSD)) +FEATURE_CFLAGS += -D'USE_IOPL=1' +else +FEATURE_CFLAGS += -D'USE_IOPL=0' +endif + +ifeq ($(TARGET_OS), $(filter $(TARGET_OS), FreeBSD FreeBSD-glibc DragonFlyBSD)) +FEATURE_CFLAGS += -D'USE_DEV_IO=1' +else +FEATURE_CFLAGS += -D'USE_DEV_IO=0' +endif + +ifeq ($(TARGET_OS), $(filter $(TARGET_OS), Hurd)) +FEATURE_CFLAGS += -D'USE_IOPERM=1' +else +FEATURE_CFLAGS += -D'USE_IOPERM=0' +endif + + ############################################################################### # Flash chip drivers and bus support infrastructure. -- cgit v1.2.3