瀏覽代碼

litecross: eliminate obstacles to toolchain config from make command line

the += approach which worked in config.mak does not work well if the
user wants to pass in configure options from the command line.
restructure configure command line construction such that setting
COMMON_CONFIG, GCC_CONFIG, or TOOLCHAIN_CONFIG from the command line
does not suppress necessary defaults.
Rich Felker 8 年之前
父節點
當前提交
99ee12d604
共有 1 個文件被更改,包括 13 次插入10 次删除
  1. 13 10
      litecross/Makefile

+ 13 - 10
litecross/Makefile

@@ -5,9 +5,10 @@ BINUTILS_SRCDIR = BINUTILS_SRCDIR_not_set
 GCC_SRCDIR = GCC_SRCDIR_not_set
 MUSL_SRCDIR = MUSL_SRCDIR_not_set
 
-COMMON_CONFIG = --enable-languages=c,c++
-GCC_CONFIG = $(COMMON_CONFIG) 
-TOOLCHAIN_CONFIG = $(GCC_CONFIG)
+GCC_CONFIG_FOR_TARGET = 
+COMMON_CONFIG = 
+GCC_CONFIG = 
+TOOLCHAIN_CONFIG = 
 
 XGCC_DIR = ../obj_toolchain/gcc
 XGCC = $(XGCC_DIR)/xgcc -B $(XGCC_DIR)
@@ -15,27 +16,27 @@ XGCC = $(XGCC_DIR)/xgcc -B $(XGCC_DIR)
 -include config.mak
 
 ifneq ($(findstring fdpic,$(TARGET)),)
-GCC_CONFIG += --enable-fdpic
+GCC_CONFIG_FOR_TARGET += --enable-fdpic
 endif
 
 ifneq ($(filter x86_64%x32,$(TARGET)),)
-GCC_CONFIG += --with-abi=x32
+GCC_CONFIG_FOR_TARGET += --with-abi=x32
 endif
 
 ifneq ($(findstring mips64,$(TARGET))$(findstring mipsisa64,$(TARGET)),)
 ifneq ($(findstring n32,$(TARGET)),)
-GCC_CONFIG += --with-abi=n32
+GCC_CONFIG_FOR_TARGET += --with-abi=n32
 else
-GCC_CONFIG += --with-abi=64
+GCC_CONFIG_FOR_TARGET += --with-abi=64
 endif
 endif
 
 ifneq ($(filter %sf,$(TARGET)),)
-GCC_CONFIG += --with-float=soft
+GCC_CONFIG_FOR_TARGET += --with-float=soft
 endif
 
 ifneq ($(filter %hf,$(TARGET)),)
-GCC_CONFIG += --with-float=hard
+GCC_CONFIG_FOR_TARGET += --with-float=hard
 endif
 
 
@@ -43,7 +44,9 @@ MAKE += MULTILIB_OSDIRNAMES=
 MAKE += INFO_DEPS= infodir=
 MAKE += ac_cv_prog_lex_root=lex.yy.c
 
-FULL_TOOLCHAIN_CONFIG = $(TOOLCHAIN_CONFIG) \
+FULL_TOOLCHAIN_CONFIG = --enable-languages=c,c++ \
+	$(GCC_CONFIG_FOR_TARGET) \
+	$(COMMON_CONFIG) $(GCC_CONFIG) $(TOOLCHAIN_CONFIG) \
 	--disable-werror \
 	--target=$(TARGET) --prefix= \
 	--libdir=/lib --disable-multilib \