diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2015-09-15 17:41:07 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-10-23 20:44:35 +0200 |
commit | 354c11d10e9e6278d08ea907f84bb2adac37cb32 (patch) | |
tree | f9f997c31c80e401ebaaf83ec6f64c706fa51c11 | |
parent | 421b47e05059d3dbcd2ed06be60f574fdbe69b15 (diff) | |
download | coreboot-354c11d10e9e6278d08ea907f84bb2adac37cb32.tar.xz |
cbfstool: Make sure fileno is available on Cygwin
This patch fixes compilation of cbfstool on Cygwin.
As reported in http://review.coreboot.org/#/c/10027
cbfstool on Cygwin likes to be compiled with -D_GNU_SOURCE.
That patch was abandoned because it would unwantedly turn on
more GNU extensions. Instead of doing that, only enable the
define on Cygwin, switch to -std=gnu99 instead of -std=c99 to
make fileno and strdup actually available.
A MINGW32 check that was forgotten in Makefile was copied over
from Makefile.inc to keep the two files in sync.
This patch has no impact on non-Windows builds.
Change-Id: I068b181d67daf9c7280110e64aefb634aa20c69b
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/11667
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
-rw-r--r-- | util/cbfstool/Makefile.inc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc index bd9bbeb5c2..9633ca48be 100644 --- a/util/cbfstool/Makefile.inc +++ b/util/cbfstool/Makefile.inc @@ -48,7 +48,7 @@ rmodobj += common.o rmodobj += elfheaders.o rmodobj += xdr.o -TOOLCFLAGS ?= -std=c99 -Werror -Wall -Wextra +TOOLCFLAGS ?= -Werror -Wall -Wextra TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h @@ -71,6 +71,12 @@ HOSTCFLAGS += -fms-extensions ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32) TOOLCFLAGS += -mno-ms-bitfields endif +ifeq ($(shell uname -o 2>/dev/null), Cygwin) +TOOLCFLAGS+=-std=gnu99 +TOOLCPPFLAGS+=-D_GNU_SOURCE +else +TOOLCFLAGS+=-std=c99 +endif $(objutil)/cbfstool/%.o: $(objutil)/cbfstool/%.c printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |