mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-02-21 17:26:41 +00:00
configure: move error message down to has_or_abort
When has_or_warn will come, we do want to print the error message only in has_or_abort, so move it down there. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
parent
5deed0f23f
commit
94314fce7c
26
configure
vendored
26
configure
vendored
@ -97,13 +97,13 @@ add_to_var_list() {
|
|||||||
# optional, defaults to: '${prog}: none found'
|
# optional, defaults to: '${prog}: none found'
|
||||||
# eg: err="'bash' 3.x or above was not found"
|
# eg: err="'bash' 3.x or above was not found"
|
||||||
check_for() {
|
check_for() {
|
||||||
local prog inc lib
|
|
||||||
local var ver err
|
|
||||||
local val
|
local val
|
||||||
local item
|
local item
|
||||||
local where
|
local where
|
||||||
local status
|
local status
|
||||||
|
|
||||||
|
# Note: prog/inc/lib and var/ver/err are set here,
|
||||||
|
# but declared by the caller (because it needs it)
|
||||||
for item in "${@}"; do
|
for item in "${@}"; do
|
||||||
case "${item}" in
|
case "${item}" in
|
||||||
prog=*|inc=*|lib=*|var=*|ver=*|err=*)
|
prog=*|inc=*|lib=*|var=*|ver=*|err=*)
|
||||||
@ -170,13 +170,6 @@ check_for() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -z "${status}" ]; then
|
if [ -z "${status}" ]; then
|
||||||
printf "\n${err:-${prog}${inc}${lib}: none found}\n\n"
|
|
||||||
printf "Either you are missing entirely the needed tool,\n"
|
|
||||||
printf "or the version you have is too old.\n"
|
|
||||||
if [ -n "${var}" ]; then
|
|
||||||
printf "You can give the path to this tool using: --with-${var}=PATH\n"
|
|
||||||
fi
|
|
||||||
printf "\n"
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -191,10 +184,21 @@ check_for() {
|
|||||||
# This function checks for a tool, and aborts if not found
|
# This function checks for a tool, and aborts if not found
|
||||||
# See check_for(), above, for how to call has_or_abort
|
# See check_for(), above, for how to call has_or_abort
|
||||||
has_or_abort() {
|
has_or_abort() {
|
||||||
|
# We declare these 6 variables here, although they are
|
||||||
|
# set in check_for(), called below
|
||||||
|
local prog inc lib
|
||||||
|
local var ver err
|
||||||
|
|
||||||
if ! check_for "$@"; then
|
if ! check_for "$@"; then
|
||||||
# FORCE can be set in the environment
|
printf "\n${err:-${prog}${inc}${lib}: none found}\n\n"
|
||||||
[ -z "${FORCE}" ] && do_error "Bailing out..."
|
printf "Either you are missing entirely the needed tool,\n"
|
||||||
|
printf "or the version you have is too old.\n"
|
||||||
|
if [ -n "${var}" ]; then
|
||||||
|
printf "You can give the path to this tool using: --with-${var}=PATH\n"
|
||||||
|
fi
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
# Bail out if --force is not specified
|
||||||
|
[ -z "${FORCE}" ] && do_error "Bailing out..."
|
||||||
printf "<* *>\n"
|
printf "<* *>\n"
|
||||||
printf "<* FORCE in action: *>\n"
|
printf "<* FORCE in action: *>\n"
|
||||||
printf "<* Continuing despite missing pre-requisite *>\n"
|
printf "<* Continuing despite missing pre-requisite *>\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user