From 9000b48966335b0b3d7a3ec1ec8c15b045d59e9d Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Tue, 22 May 2018 18:57:07 +0300 Subject: shell: Don't include config.h for native helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit config.h contains settings for the cross compiler (most importantly 32/64bit versions of functions), so don't include it when calling the native compiler to build the helpers. Otherwise we get build errors like: /usr/bin/gcc -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN -g -O2 -Wall -o mkinit mkinit.c In file included from /usr/include/sys/stat.h:107, from /usr/include/fcntl.h:38, from mkinit.c:50: /usr/include/bits/stat.h:117: error: redefinition of ‘struct stat’ In file included from /usr/include/fcntl.h:38, from mkinit.c:50: /usr/include/sys/stat.h:504: error: redefinition of ‘stat’ /usr/include/sys/stat.h:455: note: previous definition of ‘stat’ was here Signed-off-by: Peter Korsgaard [baruch: apply to Makefile.am; update Peter's email address] Signed-off-by: Baruch Siach Signed-off-by: Herbert Xu --- src/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 46399c7..8b9eb8c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,11 +2,10 @@ AM_YFLAGS = -d COMMON_CFLAGS = -Wall COMMON_CPPFLAGS = \ - -include $(top_builddir)/config.h \ -DBSD=1 -DSHELL AM_CFLAGS = $(COMMON_CFLAGS) -AM_CPPFLAGS = $(COMMON_CPPFLAGS) +AM_CPPFLAGS = -include $(top_builddir)/config.h $(COMMON_CPPFLAGS) AM_CFLAGS_FOR_BUILD = -g -O2 $(COMMON_CFLAGS) AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS) -- cgit 1.4.1