massive cleanup of toolchain/
SVN-Revision: 4038
This commit is contained in:
parent
1f20179ce5
commit
e248cf0f00
114
openwrt/include/host-build.mk
Normal file
114
openwrt/include/host-build.mk
Normal file
@ -0,0 +1,114 @@
|
||||
ifneq ($(strip $(PKG_CAT)),)
|
||||
ifeq ($(PKG_CAT),unzip)
|
||||
UNPACK=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
|
||||
else
|
||||
UNPACK=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) -
|
||||
endif
|
||||
define Build/Prepare/Default
|
||||
$(UNPACK)
|
||||
@if [ -d ./patches ]; then \
|
||||
$(PATCH) $(PKG_BUILD_DIR) ./patches; \
|
||||
fi
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
endef
|
||||
|
||||
define Build/Configure/Default
|
||||
@(cd $(PKG_BUILD_DIR)/$(3); \
|
||||
[ -x configure ] && \
|
||||
$(2) \
|
||||
CPPFLAGS="-I$(STAGING_DIR)/host/include" \
|
||||
LDFLAGS="-L$(STAGING_DIR)/host/lib" \
|
||||
./configure \
|
||||
--target=$(GNU_TARGET_NAME) \
|
||||
--host=$(GNU_TARGET_NAME) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--program-prefix="" \
|
||||
--program-suffix="" \
|
||||
--prefix=/usr \
|
||||
--exec-prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--libexecdir=/usr/lib \
|
||||
--sysconfdir=/etc \
|
||||
--datadir=/usr/share \
|
||||
--localstatedir=/var \
|
||||
--mandir=/usr/man \
|
||||
--infodir=/usr/info \
|
||||
$(DISABLE_NLS) \
|
||||
$(1); \
|
||||
true; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default)
|
||||
endef
|
||||
|
||||
define Build/Compile/Default
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) $(1)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default)
|
||||
endef
|
||||
|
||||
|
||||
ifneq ($(strip $(PKG_SOURCE)),)
|
||||
source: $(DL_DIR)/$(PKG_SOURCE)
|
||||
|
||||
$(DL_DIR)/$(PKG_SOURCE):
|
||||
mkdir -p $(DL_DIR)
|
||||
$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
|
||||
|
||||
$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
|
||||
endif
|
||||
|
||||
define HostBuild
|
||||
$(PKG_BUILD_DIR)/.prepared:
|
||||
@-rm -rf $(PKG_BUILD_DIR)
|
||||
@mkdir -p $(PKG_BUILD_DIR)
|
||||
$(call Build/Prepare)
|
||||
touch $$@
|
||||
|
||||
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
|
||||
$(call Build/Configure)
|
||||
touch $$@
|
||||
|
||||
$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
|
||||
$(call Build/Compile)
|
||||
touch $$@
|
||||
|
||||
$(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed: $(PKG_BUILD_DIR)/.built
|
||||
$(call Build/Install)
|
||||
touch $$@
|
||||
|
||||
ifdef Build/Install
|
||||
install-targets: $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
|
||||
endif
|
||||
|
||||
package-clean: FORCE
|
||||
$(call Build/Clean)
|
||||
$(call Build/Uninstall)
|
||||
rm -f $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
|
||||
|
||||
source:
|
||||
prepare: $(PKG_BUILD_DIR)/.prepared
|
||||
configure: $(PKG_BUILD_DIR)/.configured
|
||||
|
||||
compile-targets: $(PKG_BUILD_DIR)/.built
|
||||
compile: compile-targets
|
||||
|
||||
install-targets:
|
||||
install: install-targets
|
||||
|
||||
clean-targets:
|
||||
clean: FORCE
|
||||
@$(MAKE) clean-targets
|
||||
$(call Build/Clean)
|
||||
rm -rf $(PKG_BUILD_DIR)
|
||||
|
||||
endef
|
@ -201,14 +201,15 @@ define BuildPackage
|
||||
endef
|
||||
|
||||
ifneq ($(strip $(PKG_CAT)),)
|
||||
ifeq ($(PKG_CAT),unzip)
|
||||
UNPACK=unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE)
|
||||
else
|
||||
UNPACK=$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) -
|
||||
endif
|
||||
define Build/Prepare/Default
|
||||
@if [ "$(PKG_CAT)" = "unzip" ]; then \
|
||||
unzip -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE) ; \
|
||||
else \
|
||||
$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(PKG_BUILD_DIR)/.. $(TAR_OPTIONS) - ; \
|
||||
fi
|
||||
$(UNPACK)
|
||||
@if [ -d ./patches ]; then \
|
||||
$(PATCH) $(PKG_BUILD_DIR) ./patches ; \
|
||||
$(PATCH) $(PKG_BUILD_DIR) ./patches; \
|
||||
fi
|
||||
endef
|
||||
endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Main makefile for the toolchain
|
||||
include $(TOPDIR)/rules.mk
|
||||
TARGETS-y:=sed kernel-headers utils binutils gcc uClibc ipkg-utils libnotimpl squashfs jffs2 lzma
|
||||
TARGETS-y:=sed kernel-headers sstrip binutils gcc uClibc ipkg-utils libnotimpl squashfs jffs2 lzma
|
||||
TARGETS-$(CONFIG_GDB) += gdb
|
||||
|
||||
TARGETS_DOWNLOAD:=$(patsubst %,%-source,$(TARGETS-y))
|
||||
@ -12,12 +12,13 @@ download: $(TARGETS_DOWNLOAD)
|
||||
install: $(TARGETS_INSTALL)
|
||||
clean: $(TARGETS_CLEAN)
|
||||
|
||||
uClibc-prepare: kernel-headers-prepare sed-install utils-install
|
||||
kernel-headers-prepare: sed-install
|
||||
uClibc-prepare: kernel-headers-prepare sstrip-install
|
||||
binutils-prepare: uClibc-prepare
|
||||
gcc-prepare: binutils-install
|
||||
uClibc-compile: gcc-prepare
|
||||
gcc-compile: uClibc-install
|
||||
squashfs-compile: lzma-compile
|
||||
uClibc-compile: gcc-compile
|
||||
gcc-install: uClibc-install
|
||||
squashfs-compile: lzma-install
|
||||
|
||||
TOOLCHAIN_STAMP_DIR:=$(STAGING_DIR)/stampfiles
|
||||
|
||||
|
@ -1,105 +1,59 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# build binutils for use on the host system
|
||||
#
|
||||
#############################################################
|
||||
BINUTILS_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))#"))
|
||||
PKG_NAME:=binutils
|
||||
PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))#"))
|
||||
|
||||
BINUTILS_SITE:=http://www.fr.kernel.org/pub/linux/devel/binutils \
|
||||
http://www.fi.kernel.org/pub/linux/devel/binutils \
|
||||
http://ftp.kernel.org/pub/linux/devel/binutils \
|
||||
http://www.de.kernel.org/pub/linux/devel/binutils
|
||||
|
||||
BINUTILS_STABLE_SITE:=http://ftp.gnu.org/gnu/binutils/ \
|
||||
STABLE_SITE:=http://ftp.gnu.org/gnu/binutils/ \
|
||||
ftp://gatekeeper.dec.com/pub/GNU/ \
|
||||
ftp://ftp.uu.net/archive/systems/gnu/ \
|
||||
ftp://ftp.eu.uu.net/pub/gnu/ \
|
||||
ftp://ftp.funet.fi/pub/gnu/prep/ \
|
||||
ftp://ftp.leo.org/pub/comp/os/unix/gnu/
|
||||
|
||||
DEVEL_SITE:=http://www.fr.kernel.org/pub/linux/devel/binutils \
|
||||
http://www.fi.kernel.org/pub/linux/devel/binutils \
|
||||
http://ftp.kernel.org/pub/linux/devel/binutils \
|
||||
http://www.de.kernel.org/pub/linux/devel/binutils
|
||||
|
||||
ifeq ($(BINUTILS_VERSION),2.16.1)
|
||||
BINUTILS_SITE:=$(BINUTILS_STABLE_SITE)
|
||||
PKG_SOURCE_URL:=$(STABLE_SITE)
|
||||
else
|
||||
PKG_SOURCE_URL:=$(DEVEL_SITE)
|
||||
endif
|
||||
|
||||
BINUTILS_SOURCE:=binutils-$(BINUTILS_VERSION).tar.bz2
|
||||
BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)
|
||||
BINUTILS_CAT:=bzcat
|
||||
PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
|
||||
PKG_MD5SUM:=unknown
|
||||
PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_CAT:=bzcat
|
||||
|
||||
BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
$(DL_DIR)/$(BINUTILS_SOURCE):
|
||||
mkdir -p $(DL_DIR)
|
||||
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(BINUTILS_SOURCE) x $(BINUTILS_SITE)
|
||||
|
||||
$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
|
||||
mkdir -p $(TOOL_BUILD_DIR)
|
||||
$(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
||||
touch $(BINUTILS_DIR)/.unpacked
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
if [ -d ./patches/$(PKG_VERSION) ]; then \
|
||||
$(SCRIPT_DIR)/patch-kernel.sh $(PKG_BUILD_DIR) ./patches/$(PKG_VERSION); \
|
||||
fi
|
||||
endef
|
||||
|
||||
$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
|
||||
# Apply appropriate binutils patches.
|
||||
$(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./all \*.patch
|
||||
$(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./$(BINUTILS_VERSION) \*.patch
|
||||
touch $(BINUTILS_DIR)/.patched
|
||||
|
||||
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
|
||||
mkdir -p $(BINUTILS_DIR1)
|
||||
(cd $(BINUTILS_DIR1); \
|
||||
$(BINUTILS_DIR)/configure \
|
||||
define Build/Configure
|
||||
(cd $(PKG_BUILD_DIR); \
|
||||
./configure \
|
||||
--prefix=$(STAGING_DIR) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--host=$(GNU_HOST_NAME) \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
--disable-werror \
|
||||
$(DISABLE_NLS) \
|
||||
$(MULTILIB) \
|
||||
$(SOFT_FLOAT_CONFIG_OPTION) );
|
||||
touch $(BINUTILS_DIR1)/.configured
|
||||
--disable-nls \
|
||||
);
|
||||
endef
|
||||
|
||||
$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
|
||||
$(MAKE) -C $(BINUTILS_DIR1) -j $(CONFIG_JLEVEL) all
|
||||
|
||||
# Make install will put gettext data in staging_dir/share/locale.
|
||||
# Unfortunatey, it isn't configureable.
|
||||
$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld: $(BINUTILS_DIR1)/binutils/objdump
|
||||
$(MAKE) -C $(BINUTILS_DIR1) -j $(CONFIG_JLEVEL) install
|
||||
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# build binutils for use on the target system
|
||||
#
|
||||
#############################################################
|
||||
BINUTILS_DIR2:=$(BUILD_DIR)/binutils-$(BINUTILS_VERSION)-target
|
||||
$(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
|
||||
mkdir -p $(BINUTILS_DIR2)
|
||||
(cd $(BINUTILS_DIR2); \
|
||||
PATH=$(TARGET_PATH) \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
CFLAGS_FOR_BUILD="-O2 -g" \
|
||||
$(BINUTILS_DIR)/configure \
|
||||
--prefix=/usr \
|
||||
--exec-prefix=/usr \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--host=$(REAL_GNU_TARGET_NAME) \
|
||||
--target=$(REAL_GNU_TARGET_NAME) \
|
||||
$(DISABLE_NLS) \
|
||||
$(MULTILIB) \
|
||||
$(SOFT_FLOAT_CONFIG_OPTION) );
|
||||
touch $(BINUTILS_DIR2)/.configured
|
||||
|
||||
$(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
|
||||
PATH=$(TARGET_PATH) \
|
||||
$(MAKE) -C $(BINUTILS_DIR2) -j $(CONFIG_JLEVEL) all
|
||||
|
||||
source: $(DL_DIR)/$(BINUTILS_SOURCE)
|
||||
prepare: $(BINUTILS_DIR)/.patched
|
||||
compile: $(BINUTILS_DIR1)/binutils/objdump
|
||||
install: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld
|
||||
clean: FORCE
|
||||
rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
|
||||
rm -rf $(BINUTILS_DIR) $(BINUTILS_DIR1)
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) -j $(CONFIG_JLEVEL) all
|
||||
endef
|
||||
|
||||
define Build/Install
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) -j $(CONFIG_JLEVEL) install
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
|
||||
# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
|
||||
# Copyright (C) 2005 Felix Fietkau <openwrt@nbd.name>
|
||||
# Copyright (C) 2005-2006 Felix Fietkau <nbd@openwrt.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -20,68 +20,36 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
GCC_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#"))
|
||||
PKG_NAME:=gcc
|
||||
PKG_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#"))
|
||||
|
||||
#GCC_SITE:=ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(GCC_VERSION)
|
||||
GCC_SITE:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(GCC_VERSION) \
|
||||
http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(GCC_VERSION)
|
||||
PKG_SOURCE:=gcc-$(PKG_VERSION).tar.bz2
|
||||
PKG_MD5SUM:=unknown
|
||||
PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \
|
||||
http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \
|
||||
ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION)
|
||||
PKG_CAT:=bzcat
|
||||
|
||||
GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2
|
||||
GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)
|
||||
GCC_CAT:=bzcat
|
||||
PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/gcc-$(PKG_VERSION)
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# Setup some initial stuff
|
||||
#
|
||||
#############################################################
|
||||
|
||||
ifeq ($(CONFIG_INSTALL_LIBGCJ),y)
|
||||
TARGET_LANGUAGES:=c,c++,java
|
||||
else
|
||||
ifeq ($(CONFIG_INSTALL_LIBSTDCPP),y)
|
||||
TARGET_LANGUAGES:=c,c++
|
||||
else
|
||||
TARGET_LANGUAGES:=c
|
||||
ifeq ($(CONFIG_INSTALL_LIBSTDCPP),y)
|
||||
TARGET_LANGUAGES:=$(TARGET_LANGUAGES),c++
|
||||
endif
|
||||
ifeq ($(CONFIG_INSTALL_LIBGCJ),y)
|
||||
TARGET_LANGUAGES:=$(TARGET_LANGUAGES),java
|
||||
endif
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# build the first pass gcc compiler
|
||||
#
|
||||
#############################################################
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-initial
|
||||
BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(PKG_VERSION)-initial
|
||||
BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(PKG_VERSION)-final
|
||||
|
||||
$(DL_DIR)/$(GCC_SOURCE):
|
||||
mkdir -p $(DL_DIR)
|
||||
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(GCC_SOURCE) x $(GCC_SITE)
|
||||
|
||||
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
|
||||
mkdir -p $(TOOL_BUILD_DIR)
|
||||
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
||||
touch $(GCC_DIR)/.unpacked
|
||||
|
||||
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
|
||||
# Apply any files named gcc-*.patch from the source directory to gcc
|
||||
$(SCRIPT_DIR)/patch-kernel.sh $(GCC_DIR) ./$(GCC_VERSION) \*.patch
|
||||
# Note: The soft float situation has improved considerably with gcc 3.4.x.
|
||||
# We can dispense with the custom spec files, as well as libfloat for the arm case.
|
||||
# However, we still need a patch for arm. There's a similar patch for gcc 3.3.x
|
||||
# which needs to be integrated so we can kill of libfloat for good.
|
||||
$(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(GCC_DIR)/gcc/version.c
|
||||
$(SED) 's,\(bug_report_url.. = "\).*\(";\),\1<URL:https://dev.openwrt.org/>\2,' $(GCC_DIR)/gcc/version.c
|
||||
touch $(GCC_DIR)/.patched
|
||||
|
||||
# The --without-headers option stopped working with gcc 3.0 and has never been
|
||||
# # fixed, so we need to actually have working C library header files prior to
|
||||
# # the step or libgcc will not build...
|
||||
|
||||
$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
|
||||
mkdir -p $(GCC_BUILD_DIR1)
|
||||
(cd $(GCC_BUILD_DIR1); rm -f config.cache; PATH=$(TARGET_PATH) \
|
||||
$(GCC_DIR)/configure \
|
||||
define Stage1/Configure
|
||||
mkdir -p $(BUILD_DIR1)
|
||||
(cd $(BUILD_DIR1); rm -f config.cache; PATH=$(TARGET_PATH) \
|
||||
$(PKG_BUILD_DIR)/configure \
|
||||
--prefix=$(STAGING_DIR) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--host=$(GNU_HOST_NAME) \
|
||||
@ -92,41 +60,25 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
|
||||
--disable-__cxa_atexit \
|
||||
--enable-target-optspace \
|
||||
--with-gnu-ld \
|
||||
$(DISABLE_NLS) \
|
||||
$(MULTILIB) \
|
||||
--disable-nls \
|
||||
);
|
||||
touch $(GCC_BUILD_DIR1)/.configured
|
||||
endef
|
||||
define Stage1/Compile
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(BUILD_DIR1) all-gcc
|
||||
endef
|
||||
define Stage1/Install
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(BUILD_DIR1) install-gcc
|
||||
endef
|
||||
|
||||
$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc
|
||||
touch $(GCC_BUILD_DIR1)/.compiled
|
||||
|
||||
$(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
|
||||
|
||||
#############################################################
|
||||
#
|
||||
# second pass compiler build. Build the compiler targeting
|
||||
# the newly built shared uClibc library.
|
||||
#
|
||||
#############################################################
|
||||
#
|
||||
# Sigh... I had to rework things because using --with-gxx-include-dir
|
||||
# causes issues with include dir search order for g++. This seems to
|
||||
# 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
|
||||
|
||||
GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final
|
||||
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/lib/libc.a
|
||||
mkdir -p $(GCC_BUILD_DIR2)
|
||||
define Stage2/Configure
|
||||
mkdir -p $(BUILD_DIR2)
|
||||
# Important! Required for limits.h to be fixed.
|
||||
rm -rf $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
|
||||
ln -sf ../include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
|
||||
rm -rf $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
|
||||
ln -sf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
|
||||
(cd $(GCC_BUILD_DIR2); rm -f config.cache; PATH=$(TARGET_PATH) \
|
||||
$(GCC_DIR)/configure \
|
||||
(cd $(BUILD_DIR2); rm -f config.cache; PATH=$(TARGET_PATH) \
|
||||
$(PKG_BUILD_DIR)/configure \
|
||||
--prefix=$(STAGING_DIR) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--host=$(GNU_HOST_NAME) \
|
||||
@ -136,18 +88,15 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/lib/libc.a
|
||||
--disable-__cxa_atexit \
|
||||
--enable-target-optspace \
|
||||
--with-gnu-ld \
|
||||
$(DISABLE_NLS) \
|
||||
$(MULTILIB) \
|
||||
--disable-nls \
|
||||
);
|
||||
touch $(GCC_BUILD_DIR2)/.configured
|
||||
|
||||
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all
|
||||
touch $(GCC_BUILD_DIR2)/.compiled
|
||||
|
||||
gcc-install: $(GCC_BUILD_DIR2)/.compiled FORCE
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install
|
||||
echo $(GCC_VERSION) > $(STAGING_DIR)/gcc_version
|
||||
endef
|
||||
define Stage2/Compile
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(BUILD_DIR2) all
|
||||
endef
|
||||
define Stage2/Install
|
||||
PATH=$(TARGET_PATH) $(MAKE) -C $(BUILD_DIR2) install
|
||||
echo $(PKG_VERSION) > $(STAGING_DIR)/gcc_version
|
||||
# Set up the symlinks to enable lying about target name.
|
||||
set -e; \
|
||||
(cd $(STAGING_DIR); \
|
||||
@ -158,14 +107,36 @@ gcc-install: $(GCC_BUILD_DIR2)/.compiled FORCE
|
||||
$(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
|
||||
done; \
|
||||
);
|
||||
endef
|
||||
|
||||
source: $(DL_DIR)/$(GCC_SOURCE)
|
||||
prepare: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc
|
||||
compile: gcc-install
|
||||
install:
|
||||
clean: gcc-clean
|
||||
rm -rf $(GCC_DIR)
|
||||
rm -rf $(GCC_BUILD_DIR1)
|
||||
rm -rf $(GCC_BUILD_DIR2)
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(SCRIPT_DIR)/patch-kernel.sh $(PKG_BUILD_DIR) ./patches/$(PKG_VERSION) \*.patch
|
||||
$(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c
|
||||
$(SED) 's,\(bug_report_url.. = "\).*\(";\),\1<URL:https://dev.openwrt.org/>\2,' $(PKG_BUILD_DIR)/gcc/version.c
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Stage1/Configure)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Stage1/Compile)
|
||||
$(call Stage1/Install)
|
||||
endef
|
||||
|
||||
define Build/Install
|
||||
$(call Stage2/Configure)
|
||||
$(call Stage2/Compile)
|
||||
$(call Stage2/Install)
|
||||
endef
|
||||
|
||||
define Build/Clean
|
||||
rm -rf $(PKG_BUILD_DIR)
|
||||
rm -rf $(BUILD_DIR1)
|
||||
rm -rf $(BUILD_DIR2)
|
||||
rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc*
|
||||
rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c*
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user