Commit 2db1c3fc673c2ddfa1f8dbb41326d9763ea0ae64
Committed by
Tom Rini
1 parent
1fd1e2f69f
Exists in
master
and in
53 other branches
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 <yorksun@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
Showing 8 changed files with 3 additions and 21 deletions Side-by-side Diff
tools/Makefile
... | ... | @@ -154,6 +154,7 @@ |
154 | 154 | # |
155 | 155 | # Use native tools and options |
156 | 156 | # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps |
157 | +# Define _GNU_SOURCE to obtain the getline prototype from stdio.h | |
157 | 158 | # |
158 | 159 | HOSTCPPFLAGS = -include $(SRCTREE)/include/libfdt_env.h \ |
159 | 160 | -idirafter $(SRCTREE)/include \ |
... | ... | @@ -163,7 +164,8 @@ |
163 | 164 | -I $(SRCTREE)/tools \ |
164 | 165 | -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \ |
165 | 166 | -DUSE_HOSTCC \ |
166 | - -D__KERNEL_STRICT_NAMES | |
167 | + -D__KERNEL_STRICT_NAMES \ | |
168 | + -D_GNU_SOURCE | |
167 | 169 | |
168 | 170 | |
169 | 171 | all: $(obj).depend $(BINS) $(LOGO-y) subdirs |
tools/aisimage.c
tools/imximage.c
tools/kwbimage.c
tools/mkenvimage.c
tools/omapimage.c
tools/pblimage.c
tools/ublimage.c