浏览代码

pass CFLAGS to gcc configure as env vars, not on command line

old versions of gcc, such as 4.2.1 which I'm in the process of adding
support for, have broken configure scripts that do not accept
variables on the command line and instead interpret them as the target
name. the easiest solution is just passing these in the environment.
Rich Felker 9 年之前
父节点
当前提交
35cdd4619f
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Makefile

+ 3 - 3
Makefile

@@ -15,12 +15,12 @@ GCC_CONFIG = $(COMMON_CONFIG) --enable-tls \
 	--disable-libmudflap --disable-libsanitizer \
 	--disable-libquadmath --disable-decimal-float
 
+GCC0_VARS = CFLAGS="-O0 -g0" CXXFLAGS="-O0 -g0"
 GCC0_CONFIG = $(GCC_CONFIG) \
 	--with-newlib --disable-libssp --disable-threads \
 	--disable-shared --disable-libgomp --disable-libatomic \
 	--disable-libquadmath --disable-decimal-float --disable-nls \
-	--enable-languages=c \
-	CFLAGS="-O0 -g0" CXXFLAGS="-O0 -g0"
+	--enable-languages=c
 
 GCC0_BDIR = $(PWD)/gcc-$(GCC_VER)/build0/gcc
 GCC0_CC = $(GCC0_BDIR)/xgcc -B $(GCC0_BDIR)
@@ -86,7 +86,7 @@ steps/extract_gcc: sources/gcc-$(GCC_VER).tar.bz2 sources/config.sub
 
 steps/configure_gcc0: steps/extract_gcc
 	mkdir -p gcc-$(GCC_VER)/build0
-	test -e gcc-$(GCC_VER)/build0/config.status || ( cd gcc-$(GCC_VER)/build0 && ../configure $(GCC0_CONFIG) )
+	test -e gcc-$(GCC_VER)/build0/config.status || ( cd gcc-$(GCC_VER)/build0 && $(GCC0_VARS) ../configure $(GCC0_CONFIG) )
 	touch $@
 
 steps/build_gcc0: steps/configure_gcc0