Browse Source

- crosstool: merge all crosstool targets into one

master
vanhofen 6 years ago
parent
commit
8826e0dd1f
  1. 18
      archive-configs/ct-ng-armbox-hd51.config
  2. 16
      archive-configs/ct-ng-coolstream-hd1.config
  3. 15
      archive-configs/ct-ng-coolstream-hd2.config
  4. 142
      make/crosstool.mk
  5. 11
      make/linux-kernel.mk

18
archive-configs/ct-ng-armbox-hd51.config

@ -33,15 +33,15 @@ CT_EXPERIMENTAL=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${NI_BASE_DIR}/download"
CT_LOCAL_TARBALLS_DIR="${NI_LOCAL_TARBALLS_DIR}"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/targets"
CT_BUILD_TOP_DIR="${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
CT_PREFIX_DIR="${NI_CROSS_DIR}"
CT_PREFIX_DIR="${NI_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
# CT_REMOVE_DOCS is not set
CT_REMOVE_DOCS=y
# CT_BUILD_MANUALS is not set
CT_PREFIX_DIR_RO=y
# CT_PREFIX_DIR_RO is not set
CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y
# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set
@ -76,7 +76,7 @@ CT_PATCH_ORDER="bundled"
#
# Build behavior
#
CT_PARALLEL_JOBS=2
CT_PARALLEL_JOBS=4
CT_LOAD=""
CT_USE_PIPES=y
CT_EXTRA_CFLAGS_FOR_BUILD=""
@ -224,12 +224,12 @@ CT_TOOLCHAIN_ENABLE_NLS=y
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="${NI_CUSTOM_KERNEL_VERSION}"
CT_KERNEL_VERSION="${NI_KERNEL_VERSION}"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_LINUX_CUSTOM=y
CT_KERNEL_LINUX_CUSTOM_LOCATION="${NI_CUSTOM_KERNEL}"
CT_KERNEL_LINUX_CUSTOM_VERSION="${NI_CUSTOM_KERNEL_VERSION}"
CT_KERNEL_LINUX_CUSTOM_LOCATION="${NI_KERNEL_LOCATION}"
CT_KERNEL_LINUX_CUSTOM_VERSION="${NI_KERNEL_VERSION}"
#
# Common kernel options
@ -349,7 +349,7 @@ CT_LIBC_ADDONS_LIST=""
# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set
CT_LIBC_GLIBC_MIN_KERNEL="${NI_CUSTOM_KERNEL_VERSION}"
CT_LIBC_GLIBC_MIN_KERNEL="${NI_KERNEL_VERSION}"
#
# C compiler

16
archive-configs/ct-ng-coolstream-hd1.config

@ -37,15 +37,15 @@ CT_DEBUG_CT=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${NI_BASE_DIR}/download"
CT_LOCAL_TARBALLS_DIR="${NI_LOCAL_TARBALLS_DIR}"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/targets"
CT_BUILD_TOP_DIR="${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
CT_PREFIX_DIR="${NI_CROSS_DIR}"
CT_PREFIX_DIR="${NI_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
# CT_REMOVE_DOCS is not set
CT_REMOVE_DOCS=y
# CT_BUILD_MANUALS is not set
CT_PREFIX_DIR_RO=y
# CT_PREFIX_DIR_RO is not set
CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y
# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set
@ -227,12 +227,12 @@ CT_BUILD_SUFFIX=""
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="${NI_CUSTOM_KERNEL_VERSION}"
CT_KERNEL_VERSION="${NI_KERNEL_VERSION}"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_LINUX_CUSTOM=y
CT_KERNEL_LINUX_CUSTOM_LOCATION="${NI_CUSTOM_KERNEL}"
CT_KERNEL_LINUX_CUSTOM_VERSION="${NI_CUSTOM_KERNEL_VERSION}"
CT_KERNEL_LINUX_CUSTOM_LOCATION="${NI_KERNEL_LOCATION}"
CT_KERNEL_LINUX_CUSTOM_VERSION="${NI_KERNEL_VERSION}"
#
# Common kernel options
@ -351,7 +351,7 @@ CT_LIBC_ADDONS_LIST=""
# CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set
CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y
# CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set
CT_LIBC_GLIBC_MIN_KERNEL="${NI_CUSTOM_KERNEL_VERSION}"
CT_LIBC_GLIBC_MIN_KERNEL="${NI_KERNEL_VERSION}"
#
# C compiler

15
archive-configs/ct-ng-coolstream-hd2.config

@ -33,14 +33,15 @@ CT_EXPERIMENTAL=y
#
# Paths
#
CT_LOCAL_TARBALLS_DIR="${NI_BASE_DIR}/download"
CT_LOCAL_TARBALLS_DIR="${NI_LOCAL_TARBALLS_DIR}"
CT_SAVE_TARBALLS=y
CT_WORK_DIR="${CT_TOP_DIR}/targets"
CT_BUILD_TOP_DIR="${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
CT_PREFIX_DIR="${NI_CROSS_DIR}"
CT_PREFIX_DIR="${NI_PREFIX_DIR}"
CT_RM_RF_PREFIX_DIR=y
CT_REMOVE_DOCS=y
CT_PREFIX_DIR_RO=y
# CT_BUILD_MANUALS is not set
# CT_PREFIX_DIR_RO is not set
CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES=y
# CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES is not set
@ -225,12 +226,12 @@ CT_TOOLCHAIN_ENABLE_NLS=y
#
CT_KERNEL_SUPPORTS_SHARED_LIBS=y
CT_KERNEL="linux"
CT_KERNEL_VERSION="${NI_CUSTOM_KERNEL_VERSION}"
CT_KERNEL_VERSION="${NI_KERNEL_VERSION}"
# CT_KERNEL_bare_metal is not set
CT_KERNEL_linux=y
CT_KERNEL_LINUX_CUSTOM=y
CT_KERNEL_LINUX_CUSTOM_LOCATION="${NI_CUSTOM_KERNEL}"
CT_KERNEL_LINUX_CUSTOM_VERSION="${NI_CUSTOM_KERNEL_VERSION}"
CT_KERNEL_LINUX_CUSTOM_LOCATION="${NI_KERNEL_LOCATION}"
CT_KERNEL_LINUX_CUSTOM_VERSION="${NI_KERNEL_VERSION}"
#
# Common kernel options
@ -324,7 +325,7 @@ CT_LIBC_UCLIBC_DEBUG_LEVEL_0=y
# CT_LIBC_UCLIBC_DEBUG_LEVEL_2 is not set
# CT_LIBC_UCLIBC_DEBUG_LEVEL_3 is not set
CT_LIBC_UCLIBC_DEBUG_LEVEL=0
CT_LIBC_UCLIBC_CONFIG_FILE="${NI_UCLIBC_CONFIG}"
CT_LIBC_UCLIBC_CONFIG_FILE="${NI_LIBC_UCLIBC_CONFIG_FILE}"
CT_LIBC_SUPPORT_THREADS_ANY=y
CT_LIBC_SUPPORT_THREADS_NATIVE=y
CT_LIBC_SUPPORT_THREADS_LT=y

142
make/crosstool.mk

@ -44,128 +44,78 @@ crosstools-renew:
# -----------------------------------------------------------------------------
# wrapper for manually call
crosstool-arm-hd1: $(CROSS_BASE)/arm/hd1
kernel-tarball: $(BUILD_TMP)/linux-$(KERNEL_VERSION).tar
$(CROSS_BASE)/arm/hd1: | $(SOURCE_DIR)/$(NI_LINUX-KERNEL)
make $(BUILD_TMP)
$(REMOVE)/crosstool-ng.git
get-git-source.sh https://github.com/crosstool-ng/crosstool-ng.git $(ARCHIVE)/crosstool-ng.git
$(CPDIR)/crosstool-ng.git
$(CHDIR)/crosstool-ng.git; \
git checkout 1dbb06f2 && \
unset CONFIG_SITE LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE && \
mkdir -p targets/src/ && \
pushd $(SOURCE_DIR)/$(NI_LINUX-KERNEL) && \
git checkout $(KERNEL_BRANCH) && \
popd && \
tar cf linux-$(KERNEL_VERSION).tar --exclude-vcs -C $(SOURCE_DIR)/$(NI_LINUX-KERNEL) . && \
mv linux-$(KERNEL_VERSION).tar targets/src/ && \
cp -a $(CONFIGS)/ct-ng-$(BOXTYPE)-$(BOXSERIES).config .config && \
sed -i "s@^CT_PARALLEL_JOBS=.*@CT_PARALLEL_JOBS=$(PARALLEL_JOBS)@" .config && \
export NI_BASE_DIR=$(BASE_DIR) && \
export NI_CROSS_DIR=$(CROSS_DIR) && \
export NI_CUSTOM_KERNEL=$(BUILD_TMP)/crosstool-ng.git/targets/src/linux-$(KERNEL_VERSION).tar && \
export NI_CUSTOM_KERNEL_VERSION=$(KERNEL_VERSION) && \
export LD_LIBRARY_PATH= && \
test -f ./configure || ./bootstrap && \
./configure --enable-local; MAKELEVEL=0 make; chmod 0755 ct-ng && \
./ct-ng oldconfig && \
./ct-ng build
chmod -R +w $(CROSS_DIR)
test -e $(CROSS_DIR)/$(TARGET)/lib && mv $(CROSS_DIR)/$(TARGET)/lib $(CROSS_DIR)/$(TARGET)/lib.x
test -e $(CROSS_DIR)/$(TARGET)/lib || ln -sf sys-root/lib $(CROSS_DIR)/$(TARGET)/
rm -f $(CROSS_DIR)/$(TARGET)/sys-root/lib/libstdc++.so.6.0.20-gdb.py
$(REMOVE)/crosstool-ng.git
# create kernel-tarball
$(BUILD_TMP)/linux-$(KERNEL_VERSION).tar: | $(BUILD_TMP)
make kernel.do_checkout
tar cf $@ --exclude-vcs -C $(SOURCE_DIR)/$(NI_LINUX-KERNEL) .
# -----------------------------------------------------------------------------
UCLIBC_VER = 1.0.24
# wrappers for manually call
crosstool-arm-hd1: $(CROSS_BASE)/arm/hd1
crosstool-arm-hd2: $(CROSS_BASE)/arm/hd2
crosstool-arm-hd51: $(CROSS_BASE)/arm/hd51
crosstool-arm-bre2ze4k: $(CROSS_BASE)/arm/bre2ze4k
# -----------------------------------------------------------------------------
GCC_VER = 4.9-2017.01
$(ARCHIVE)/gcc-linaro-$(GCC_VER).tar.xz:
$(WGET) https://releases.linaro.org/components/toolchain/gcc-linaro/$(GCC_VER)/gcc-linaro-$(GCC_VER).tar.xz
# wrapper for manually call
crosstool-arm-hd2: $(CROSS_BASE)/arm/hd2
$(CROSS_BASE)/arm/hd2: $(ARCHIVE)/gcc-linaro-$(GCC_VER).tar.xz | $(SOURCE_DIR)/$(NI_LINUX-KERNEL)
make $(BUILD_TMP)
$(REMOVE)/crosstool-ng.git
get-git-source.sh https://github.com/crosstool-ng/crosstool-ng.git $(ARCHIVE)/crosstool-ng.git
$(CPDIR)/crosstool-ng.git
$(CHDIR)/crosstool-ng.git; \
git checkout 1dbb06f2 && \
cp -a $(PATCHES)/crosstool-ng/gcc/* patches/gcc/linaro-6.3-2017.02 && \
unset CONFIG_SITE LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE && \
mkdir -p targets/src/ && \
pushd $(SOURCE_DIR)/$(NI_LINUX-KERNEL) && \
git checkout $(KERNEL_BRANCH) && \
popd && \
tar cf linux-$(KERNEL_VERSION).tar --exclude-vcs -C $(SOURCE_DIR)/$(NI_LINUX-KERNEL) . && \
mv linux-$(KERNEL_VERSION).tar targets/src/ && \
cp -a $(CONFIGS)/ct-ng-$(BOXTYPE)-$(BOXSERIES).config .config && \
sed -i "s@^CT_PARALLEL_JOBS=.*@CT_PARALLEL_JOBS=$(PARALLEL_JOBS)@" .config && \
export NI_BASE_DIR=$(BASE_DIR) && \
export NI_CROSS_DIR=$(CROSS_DIR) && \
export NI_CUSTOM_KERNEL=$(BUILD_TMP)/crosstool-ng.git/targets/src/linux-$(KERNEL_VERSION).tar && \
export NI_CUSTOM_KERNEL_VERSION=$(KERNEL_VERSION) && \
export NI_UCLIBC_CONFIG=$(CONFIGS)/ct-ng-uClibc-$(UCLIBC_VER).config && \
export LD_LIBRARY_PATH= && \
test -f ./configure || ./bootstrap && \
./configure --enable-local; MAKELEVEL=0 make; chmod 0755 ct-ng && \
./ct-ng oldconfig && \
./ct-ng build
chmod -R +w $(CROSS_DIR)
test -e $(CROSS_DIR)/$(TARGET)/lib && mv $(CROSS_DIR)/$(TARGET)/lib $(CROSS_DIR)/$(TARGET)/lib.x
test -e $(CROSS_DIR)/$(TARGET)/lib || ln -sf sys-root/lib $(CROSS_DIR)/$(TARGET)/
rm -f $(CROSS_DIR)/$(TARGET)/sys-root/lib/libstdc++.so.6.0.22-gdb.py
$(REMOVE)/crosstool-ng.git
UCLIBC_VER = 1.0.24
# -----------------------------------------------------------------------------
# wrapper for manually call
crosstool-arm-hd51: $(CROSS_BASE)/arm/hd51
# crosstool for hd2 depends on gcc-linaro
$(CROSS_BASE)/arm/hd2: $(ARCHIVE)/gcc-linaro-$(GCC_VER).tar.xz
$(CROSS_BASE)/arm/hd51: | $(SOURCE_DIR)/$(NI_LINUX-KERNEL)
make $(BUILD_TMP)
$(CROSS_BASE)/arm/hd1 \
$(CROSS_BASE)/arm/hd2 \
$(CROSS_BASE)/arm/hd51: | $(BUILD_TMP)
make $(BUILD_TMP)/linux-$(KERNEL_VERSION).tar
#
$(REMOVE)/crosstool-ng.git
get-git-source.sh https://github.com/crosstool-ng/crosstool-ng.git $(ARCHIVE)/crosstool-ng.git
$(CPDIR)/crosstool-ng.git
$(CHDIR)/crosstool-ng.git; \
git checkout 1dbb06f2 && \
cp -a $(PATCHES)/crosstool-ng/gcc/* patches/gcc/linaro-6.3-2017.02 && \
unset CONFIG_SITE LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE && \
mkdir -p targets/src/ && \
pushd $(SOURCE_DIR)/$(NI_LINUX-KERNEL) && \
git checkout $(KERNEL_BRANCH) && \
popd && \
tar cf linux-$(KERNEL_VERSION).tar --exclude-vcs -C $(SOURCE_DIR)/$(NI_LINUX-KERNEL) . && \
mv linux-$(KERNEL_VERSION).tar targets/src/ && \
cp -a $(CONFIGS)/ct-ng-$(BOXTYPE)-$(BOXSERIES).config .config && \
sed -i "s@^CT_PARALLEL_JOBS=.*@CT_PARALLEL_JOBS=$(PARALLEL_JOBS)@" .config && \
export NI_BASE_DIR=$(BASE_DIR) && \
export NI_CROSS_DIR=$(CROSS_DIR) && \
export NI_CUSTOM_KERNEL=$(BUILD_TMP)/crosstool-ng.git/targets/src/linux-$(KERNEL_VERSION).tar && \
export NI_CUSTOM_KERNEL_VERSION=$(KERNEL_VERSION) && \
export LD_LIBRARY_PATH= && \
test -f ./configure || ./bootstrap && \
./configure --enable-local; MAKELEVEL=0 make; chmod 0755 ct-ng && \
./ct-ng oldconfig && \
git checkout 1dbb06f2
ifeq ($(BOXMODEL), $(filter $(BOXMODEL), hd2 hd51 bre2ze4k))
$(CHDIR)/crosstool-ng.git; \
cp -a $(PATCHES)/crosstool-ng/gcc/* patches/gcc/linaro-6.3-2017.02
endif
$(CHDIR)/crosstool-ng.git; \
unset CONFIG_SITE LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE; \
install -m 0644 $(CONFIGS)/ct-ng-$(BOXTYPE)-$(BOXSERIES).config .config; \
sed -i "s|^CT_PARALLEL_JOBS=.*|CT_PARALLEL_JOBS=$(PARALLEL_JOBS)|" .config; \
export NI_LOCAL_TARBALLS_DIR=$(ARCHIVE); \
export NI_PREFIX_DIR=$@; \
export NI_KERNEL_VERSION=$(KERNEL_VERSION); \
export NI_KERNEL_LOCATION=$(BUILD_TMP)/linux-$(KERNEL_VERSION).tar; \
export NI_LIBC_UCLIBC_CONFIG_FILE=$(CONFIGS)/ct-ng-uClibc-$(UCLIBC_VER).config; \
export LD_LIBRARY_PATH=; \
test -f ./configure || ./bootstrap; \
./configure --enable-local; \
MAKELEVEL=0 make; \
chmod 0755 ct-ng; \
./ct-ng oldconfig; \
./ct-ng build
chmod -R +w $(CROSS_DIR)
ifeq ($(BOXMODEL), $(filter $(BOXMODEL), hd1 hd2))
test -e $(CROSS_DIR)/$(TARGET)/lib && mv $(CROSS_DIR)/$(TARGET)/lib $(CROSS_DIR)/$(TARGET)/lib.x
endif
test -e $(CROSS_DIR)/$(TARGET)/lib || ln -sf sys-root/lib $(CROSS_DIR)/$(TARGET)/
rm -f $(CROSS_DIR)/$(TARGET)/sys-root/lib/libstdc++.so.6.0.20-gdb.py
rm -f $(CROSS_BASE)/$(TARGET)/sys-root/lib/libstdc++.so.6.0.*-gdb.py
$(REMOVE)/crosstool-ng.git
# -----------------------------------------------------------------------------
# wrapper for manually call
crosstool-arm-bre2ze4k: $(CROSS_BASE)/arm/bre2ze4k
# bre2ze4k uses same crosstool as hd51; so let's just create a symlink
$(CROSS_BASE)/arm/bre2ze4k:
make $(CROSS_BASE)/arm/hd51
ln -sf hd51 $(CROSS_BASE)/arm/bre2ze4k
ln -sf hd51 $@
# -----------------------------------------------------------------------------

11
make/linux-kernel.mk

@ -51,12 +51,13 @@ endif
# -----------------------------------------------------------------------------
$(D)/kernel.do_checkout: $(SOURCE_DIR)/$(NI_LINUX-KERNEL)
kernel.do_checkout: $(SOURCE_DIR)/$(NI_LINUX-KERNEL)
$(CD) $(SOURCE_DIR)/$(NI_LINUX-KERNEL); \
git checkout $(KERNEL_BRANCH)
$(TOUCH)
$(D)/kernel.do_prepare: kernel.do_checkout
$(D)/kernel.do_prepare:
make kernel.do_checkout
#
$(REMOVE)/$(KERNEL_SRC)
$(REMOVE)/$(KERNEL_OBJ)
$(REMOVE)/$(KERNEL_MODULES)
@ -209,3 +210,7 @@ kernel-install-coolstream-all:
make get-update-info-hd2 BOXFAMILY=kronos
#
make clean > /dev/null 2>&1
# -----------------------------------------------------------------------------
PHONY += kernel.do_checkout

Loading…
Cancel
Save