$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
mkdir -p $(GCC_BUILD_DIR1)
(cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \
- CC="$(HOSTCC)" \
+ $(HOST_CONFIGURE_OPTS) \
$(GCC_DIR)/configure \
--prefix=$(STAGING_DIR)/usr \
--build=$(GNU_HOST_NAME) \
--disable-__cxa_atexit \
--enable-target-optspace \
--with-gnu-ld \
+ --with-as=$(TARGET_CROSS)as \
--disable-shared \
$(GCC_WITH_HOST_GMP) \
$(GCC_WITH_HOST_MPFR) \
# have something to do with "path translations" and possibly doesn't
# affect gcc-target. However, I haven't tested gcc-target yet so no
# guarantees. mjn3
+
comma:=,
GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(GCC_STAGING_PREREQ)
#ln -snf ../lib/ $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
(cd $(GCC_BUILD_DIR2); rm -rf config.cache; \
$(HOST_CONFIGURE_OPTS) \
+ GCC=$(TARGET_CROSS)gcc \
LDFLAGS_FOR_TARGET="$(patsubst %,LDFLAGS+=-Wl$(comma)%,$(TARGET_LDFLAGS)) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
$(GCC_DIR)/configure \
--prefix=$(STAGING_DIR) \
--disable-__cxa_atexit \
--enable-target-optspace \
--with-gnu-ld \
+ --with-as=$(TARGET_CROSS)as \
$(GCC_WITH_HOST_GMP) \
$(GCC_WITH_HOST_MPFR) \
$(GCC_SHARED_LIBGCC) \
touch $@
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
- PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all
+ PATH=$(TARGET_PATH) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(GCC_BUILD_DIR2) all
touch $@
$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled
- PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install
+ PATH=$(TARGET_PATH) \
+ $(MAKE) $(HOST_CONFIGURE_OPTS) \
+ LDFLAGS_FOR_TARGET="$(patsubst %,LDFLAGS+=-Wl$(comma)%,$(TARGET_LDFLAGS)) -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+ -C $(GCC_BUILD_DIR2) install
if [ -d "$(STAGING_DIR)/usr/lib64" ]; then \
if [ ! -e "$(STAGING_DIR)/usr/lib" ]; then \
mkdir "$(STAGING_DIR)/usr/lib"; \
--with-gxx-include-dir=/usr/include/c++ \
--disable-__cxa_atexit \
--with-gnu-ld \
+ --with-gnu-as \
$(GCC_SHARED_LIBGCC) \
$(GCC_WITH_TARGET_GMP) \
$(GCC_WITH_TARGET_MPFR) \
$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
PATH=$(TARGET_PATH) \
- $(MAKE) -C $(GCC_BUILD_DIR3) all
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS_FOR_BUILD="-g -O2 $(HOST_CFLAGS)" \
+ $(TARGET_GCC_FLAGS) \
+ -C $(GCC_BUILD_DIR3) all
touch $@
#
$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
PATH=$(TARGET_PATH) \
- $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GCC_BUILD_DIR3) install
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS_FOR_BUILD="-g -O2 $(HOST_CFLAGS)" \
+ $(TARGET_GCC_FLAGS) \
+ DESTDIR=$(TARGET_DIR) \
+ -C $(GCC_BUILD_DIR3) install
# Remove broken specs file (cross compile flag is set).
rm -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/specs
#