Remove the need for configure substitutions in scripts

... so that scripts/ directory can be installed verbatim.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2018-02-22 00:25:36 -08:00
parent dbe3877285
commit 69df9ae9dd
6 changed files with 14 additions and 11 deletions

View File

@ -13,7 +13,8 @@ config PARALLEL_JOBS
Enter 1 to have only one job at a time.
Enter 0 to set automatically based on how many processors the host has.
Enter 0 to set automatically based on how many processors the build
machine has.
config LOAD
string

View File

@ -22,6 +22,10 @@ export CT_DOC_DIR:=@docdir@
# This is crosstool-NG version string
export CT_VERSION:=@PACKAGE_VERSION@
# Download agents used by scripts.mk
CT_WGET := @wget@
CT_CURL := @curl@
# Paths found by ./configure
include $(CT_LIB_DIR)/paths.mk
@ -203,7 +207,8 @@ source: .config
$(SILENT)CT_SOURCE=y $(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh
build: .config
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh
$(SILENT)BUILD_NCPUS=`@@CT_cpucount@@ 2>/dev/null || echo 0` \
$(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh
build.%:
$(SILENT)$(MAKE) -rf $(CT_NG) build CT_JOBS=$*

3
scripts/.gitignore vendored
View File

@ -1,3 +0,0 @@
crosstool-NG.sh
saveSample.sh
scripts.mk

View File

@ -563,8 +563,8 @@ if [ -z "${CT_RESTART}" ]; then
CT_PARALLEL_JOBS="${CT_JOBS}"
fi
# Use the number of processors+1 when automatically setting the number of
# parallel jobs. Fall back to 1 if the host doesn't use GLIBC.
AUTO_JOBS=$((`@@CT_cpucount@@ 2>/dev/null || echo 0` + 1))
# parallel jobs.
AUTO_JOBS=$[ BUILD_NCPUS + 1 ]
[ ${CT_PARALLEL_JOBS} -eq 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${AUTO_JOBS}"
[ ${CT_PARALLEL_JOBS} -gt 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${CT_PARALLEL_JOBS}"
JOBSFLAGS="${JOBSFLAGS} -l${CT_LOAD}"

View File

@ -31,11 +31,11 @@ ifneq ($(strip $(V)),2)
curl_silent_opt = --silent
endif
ifneq (@@CT_wget@@,)
download_cmd = wget --passive-ftp $(wget_silent_opt) -O $@
ifneq ($(CT_wget),)
download_cmd = $(CT_wget) --passive-ftp $(wget_silent_opt) -O $@
else
ifneq (@@CT_curl@@,)
download_cmd = curl --ftp-pasv $(curl_silent_opt) -o $@
ifneq ($(CT_curl),)
download_cmd = $(CT_curl) --ftp-pasv $(curl_silent_opt) -o $@
else
download_cmd = $(error wget or curl needed for downloads)
endif