Alex James has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60232 )
Change subject: cbfstool: Avoid defining _XOPEN_SOURCE on macOS ......................................................................
cbfstool: Avoid defining _XOPEN_SOURCE on macOS
Similar to FreeBSD, defining _XOPEN_SOURCE on macOS restricts availability of non-standard functions, including memmem. Remove it to resolve a compilation error on macOS 10.15.7.
Change-Id: Iaee1ce7304c89f128a35a385032fce16a2772b13 Signed-off-by: Alex James theracermaster@gmail.com --- M util/cbfstool/Makefile M util/cbfstool/Makefile.inc 2 files changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/60232/1
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile index e853ae5..6edaa0c 100644 --- a/util/cbfstool/Makefile +++ b/util/cbfstool/Makefile @@ -3,6 +3,7 @@
CONFIG_FMD_GENPARSER ?= n
+OS_ARCH = $(shell uname) HOSTCC ?= $(CC) PREFIX ?= /usr/local BINDIR ?= $(PREFIX)/bin diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc index 4651f51..1932e01 100644 --- a/util/cbfstool/Makefile.inc +++ b/util/cbfstool/Makefile.inc @@ -134,7 +134,7 @@ TOOLLDFLAGS ?= HOSTCFLAGS += -fms-extensions
-ifneq ($(shell uname -o 2>/dev/null), FreeBSD) +ifneq ($(OS_ARCH),$(filter $(OS_ARCH), Darwin FreeBSD)) TOOLCPPFLAGS += -D_XOPEN_SOURCE=700 # strdup() from string.h endif