From 2db1c3fc673c2ddfa1f8dbb41326d9763ea0ae64 Mon Sep 17 00:00:00 2001 From: York Sun Date: Tue, 30 Jul 2013 15:26:11 -0700 Subject: tools/Makefile: Move _GNU_SOURCE to Makefile Commit 669dfc2e adds libfdt_env.h to HOSTCPPFLAGS. It causes stdio.h to be included before _GNU_SOURCE is defined in C files. On some old hosts some prototypes are protected by #ifdef __USE_GNU, which is set when _GNU_SOURCE is defined. Signed-off-by: York Sun Acked-by: Simon Glass --- tools/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools/Makefile') diff --git a/tools/Makefile b/tools/Makefile index 33fad6badba..6d456564a11 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -154,6 +154,7 @@ NOPEDOBJS := $(addprefix $(obj),$(NOPED_OBJ_FILES-y)) # # Use native tools and options # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps +# Define _GNU_SOURCE to obtain the getline prototype from stdio.h # HOSTCPPFLAGS = -include $(SRCTREE)/include/libfdt_env.h \ -idirafter $(SRCTREE)/include \ @@ -163,7 +164,8 @@ HOSTCPPFLAGS = -include $(SRCTREE)/include/libfdt_env.h \ -I $(SRCTREE)/tools \ -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \ -DUSE_HOSTCC \ - -D__KERNEL_STRICT_NAMES + -D__KERNEL_STRICT_NAMES \ + -D_GNU_SOURCE all: $(obj).depend $(BINS) $(LOGO-y) subdirs -- cgit v1.3.1