Browse Source

create HOST_CFLAGS/HOST_CXXFLAGS dynamically for static-libgcc systems

Waldemar Brodkorb 9 years ago
parent
commit
7fddef3753
3 changed files with 8 additions and 6 deletions
  1. 3 3
      mk/build.mk
  2. 0 2
      mk/vars.mk
  3. 5 1
      scripts/scan-tools.sh

+ 3 - 3
mk/build.mk

@@ -561,13 +561,13 @@ buildall:
 	$(GMAKE) ADK_VERBOSE=1 all 2>&1 | tee firmware/buildall.log
 
 $(ADK_TOPDIR)/adk/tools/pkgmaker: $(ADK_TOPDIR)/adk/tools/pkgmaker.c $(ADK_TOPDIR)/adk/tools/sortfile.c $(ADK_TOPDIR)/adk/tools/strmap.c
-	@$(HOST_CC) $(HOST_CFLAGS) -O0 -g0 -o $@ adk/tools/pkgmaker.c adk/tools/sortfile.c adk/tools/strmap.c
+	@$(HOST_CC) $(HOST_CFLAGS) -o $@ adk/tools/pkgmaker.c adk/tools/sortfile.c adk/tools/strmap.c
 
 $(ADK_TOPDIR)/adk/tools/pkgrebuild: $(ADK_TOPDIR)/adk/tools/pkgrebuild.c $(ADK_TOPDIR)/adk/tools/strmap.c
-	@$(HOST_CC) $(HOST_CFLAGS) -O0 -g0 -o $@ adk/tools/pkgrebuild.c adk/tools/strmap.c
+	@$(HOST_CC) $(HOST_CFLAGS) -o $@ adk/tools/pkgrebuild.c adk/tools/strmap.c
 
 $(ADK_TOPDIR)/adk/tools/depmaker: $(ADK_TOPDIR)/adk/tools/depmaker.c
-	$(HOST_CC) $(HOST_CFLAGS) -O0 -g0 -o $@ $(ADK_TOPDIR)/adk/tools/depmaker.c
+	@$(HOST_CC) $(HOST_CFLAGS) -o $@ $(ADK_TOPDIR)/adk/tools/depmaker.c
 
 menu .menu: $(wildcard package/*/Makefile) $(wildcard target/*/systems) $(wildcard target/*/systems/*) $(ADK_TOPDIR)/adk/tools/pkgmaker $(ADK_TOPDIR)/adk/tools/pkgrebuild $(wildcard target/appliances/*)
 	@echo "Generating menu structure ..."

+ 0 - 2
mk/vars.mk

@@ -280,8 +280,6 @@ endif
 
 # host compiler and linker flags
 HOST_CPPFLAGS:=		-I$(STAGING_HOST_DIR)/usr/include
-HOST_CFLAGS:=		-O0 -g0
-HOST_CXXFLAGS:=		-O0 -g0
 HOST_LDFLAGS:=		-L$(STAGING_HOST_DIR)/usr/lib -Wl,-rpath -Wl,${STAGING_HOST_DIR}/usr/lib
 
 PATCH=			PATH='${HOST_PATH}' ${BASH} $(SCRIPT_DIR)/patch.sh

+ 5 - 1
scripts/scan-tools.sh

@@ -100,7 +100,11 @@ X=$($makecmd ADK_TOPDIR=$topdir LDADD=-lgcc 2>&1)
 if [[ $X != *@(Native compiler works)* ]]; then
 	echo Cannot compile with shared libgcc use static one.
 	HOST_CFLAGS=-static-libgcc
-	echo "HOST_CFLAGS:=-static-libgcc" >> $topdir/prereq.mk
+	echo "HOST_CFLAGS:=-O0 -g0 -static-libgcc" >> $topdir/prereq.mk
+	echo "HOST_CXXFLAGS:=-O0 -g0 -static-libgcc" >> $topdir/prereq.mk
+else
+	echo "HOST_CFLAGS:=-O0 -g0" >> $topdir/prereq.mk
+	echo "HOST_CXXFLAGS:=-O0 -g0" >> $topdir/prereq.mk
 fi
 
 X=$($makecmd ADK_TOPDIR=$topdir HOST_CFLAGS=${HOST_CFLAGS} 2>&1)