]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
tools/Makefile: Move _GNU_SOURCE to Makefile
authorYork Sun <yorksun@freescale.com>
Tue, 30 Jul 2013 22:26:11 +0000 (15:26 -0700)
committerTom Rini <trini@ti.com>
Fri, 16 Aug 2013 17:45:15 +0000 (13:45 -0400)
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>
tools/Makefile
tools/aisimage.c
tools/imximage.c
tools/kwbimage.c
tools/mkenvimage.c
tools/omapimage.c
tools/pblimage.c
tools/ublimage.c

index 33fad6badba1f28cf1aef647ade7de8274d91ce3..6d456564a11d73673662ea148a9c110d246414d3 100644 (file)
@@ -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
index cd89145867d5b17351b27112017ef7d83a7b80d7..980bf2e1a7b9c700389df00a57525c8cf78cf63c 100644 (file)
@@ -5,9 +5,6 @@
  * SPDX-License-Identifier:    GPL-2.0+ 
  */
 
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
 #include "mkimage.h"
 #include "aisimage.h"
 #include <image.h>
index c8a9ad578bc932cd8491c77390062921ace60481..cab208b5ac889f5e5235e1ca79dc5c9c2c82f205 100644 (file)
@@ -9,9 +9,6 @@
  * SPDX-License-Identifier:    GPL-2.0+ 
  */
 
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
 #include "mkimage.h"
 #include <image.h>
 #include "imximage.h"
index d08e49892d59e028b8080ef0bea361b0dc31ba06..1df6b2051e83738644dd9f9d8ff7eb84476bccbd 100644 (file)
@@ -6,9 +6,6 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
 #include "mkimage.h"
 #include <image.h>
 #include "kwbimage.h"
index f685ff2e30c72617e699f428cfd806a8c9226d98..bbd3041e36f4e5a2ac909fbe101ecfdd91b6345b 100644 (file)
@@ -9,9 +9,6 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-/* We want the GNU version of basename() */
-#define _GNU_SOURCE
-
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
index d4d77d8858ea9d609590a0cf8c1a566eb5b0b328..00853dd7413bdc68d5c1d80623dd48931b646449 100644 (file)
@@ -14,9 +14,6 @@
  * SPDX-License-Identifier:    GPL-2.0+ 
  */
 
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
 #include "mkimage.h"
 #include <image.h>
 #include "omapimage.h"
index 4542a9c10f52a0670555c2282754cc06460fc280..bac5faff9883acb727502f890f3ab8d6b0902f45 100644 (file)
@@ -3,8 +3,6 @@
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
-#define _GNU_SOURCE
-
 #include "mkimage.h"
 #include <image.h>
 #include "pblimage.h"
index 6495db6d6a8bf8488ae56e7740eaa30ed6bd38de..b4ef7f080ea3d70a6a486055f59bd1f9b2d2a143 100644 (file)
@@ -13,9 +13,6 @@
  * SPDX-License-Identifier:    GPL-2.0+ 
  */
 
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
 #include "mkimage.h"
 #include <image.h>
 #include "ublimage.h"