summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-07-08 02:19:14 +0000
committerRich Felker <dalias@aerifal.cx>2016-07-08 03:53:19 +0000
commit99ee12d604e564fa5b403c942e2809881d34d114 (patch)
treea56c696433c04a7a11f464c5888a250104f681be
parentb537e759ef1bf262a519e20810aa296de70b4b5b (diff)
litecross: eliminate obstacles to toolchain config from make command lineHEADmaster
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.
-rw-r--r--litecross/Makefile23
1 files changed, 13 insertions, 10 deletions
diff --git a/litecross/Makefile b/litecross/Makefile
index 06621f0..56c57b9 100644
--- a/litecross/Makefile
+++ b/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 \